Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(647)

Unified Diff: util/mac/mac_util_test.mm

Issue 640383002: In tests, use ASSERT_NO_FATAL_FAILURE() (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « minidump/minidump_system_info_writer_test.cc ('k') | util/mac/mach_o_image_reader_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: util/mac/mac_util_test.mm
diff --git a/util/mac/mac_util_test.mm b/util/mac/mac_util_test.mm
index 7bbba48404ce306068ccbb6cfa1b15d55817b25b..5b41b4209ec10e47958d05dce2a28a9b3a882ecb 100644
--- a/util/mac/mac_util_test.mm
+++ b/util/mac/mac_util_test.mm
@@ -41,7 +41,7 @@ namespace {
// Runs /usr/bin/sw_vers with a single argument, |argument|, and places the
// command’s standard output into |output| after stripping the trailing newline.
// Fatal gtest assertions report tool failures, which the caller should check
-// for with testing::Test::HasFatalFailure().
+// for with ASSERT_NO_FATAL_FAILURE() or testing::Test::HasFatalFailure().
void SwVers(NSString* argument, std::string* output) {
@autoreleasepool {
base::scoped_nsobject<NSPipe> pipe([[NSPipe alloc] init]);
@@ -90,26 +90,18 @@ TEST(MacUtil, MacOSXVersion) {
}
std::string expected_product_version;
- SwVers(@"-productVersion", &expected_product_version);
- if (Test::HasFatalFailure()) {
- return;
- }
+ ASSERT_NO_FATAL_FAILURE(
+ SwVers(@"-productVersion", &expected_product_version));
EXPECT_EQ(expected_product_version, version);
std::string expected_build_version;
- SwVers(@"-buildVersion", &expected_build_version);
- if (Test::HasFatalFailure()) {
- return;
- }
+ ASSERT_NO_FATAL_FAILURE(SwVers(@"-buildVersion", &expected_build_version));
EXPECT_EQ(expected_build_version, build);
std::string expected_product_name;
- SwVers(@"-productName", &expected_product_name);
- if (Test::HasFatalFailure()) {
- return;
- }
+ ASSERT_NO_FATAL_FAILURE(SwVers(@"-productName", &expected_product_name));
// Look for a space after the product name in the complete version string.
expected_product_name += ' ';
« no previous file with comments | « minidump/minidump_system_info_writer_test.cc ('k') | util/mac/mach_o_image_reader_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698