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

Unified Diff: minidump/minidump_misc_info_writer_test.cc

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_memory_writer_test.cc ('k') | minidump/minidump_module_writer_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: minidump/minidump_misc_info_writer_test.cc
diff --git a/minidump/minidump_misc_info_writer_test.cc b/minidump/minidump_misc_info_writer_test.cc
index ea22b59e40a4a090d169022d28db415875707803..44602bc60af9131373d43050412bf0f05df1f000 100644
--- a/minidump/minidump_misc_info_writer_test.cc
+++ b/minidump/minidump_misc_info_writer_test.cc
@@ -45,10 +45,7 @@ void GetMiscInfoStream(const std::string& file_contents, const T** misc_info) {
const MINIDUMP_HEADER* header =
reinterpret_cast<const MINIDUMP_HEADER*>(&file_contents[0]);
- VerifyMinidumpHeader(header, 1, 0);
- if (testing::Test::HasFatalFailure()) {
- return;
- }
+ ASSERT_NO_FATAL_FAILURE(VerifyMinidumpHeader(header, 1, 0));
const MINIDUMP_DIRECTORY* directory =
reinterpret_cast<const MINIDUMP_DIRECTORY*>(
@@ -170,10 +167,7 @@ TEST(MinidumpMiscInfoWriter, Empty) {
ASSERT_TRUE(minidump_file_writer.WriteEverything(&file_writer));
const MINIDUMP_MISC_INFO* observed;
- GetMiscInfoStream(file_writer.string(), &observed);
- if (Test::HasFatalFailure()) {
- return;
- }
+ ASSERT_NO_FATAL_FAILURE(GetMiscInfoStream(file_writer.string(), &observed));
MINIDUMP_MISC_INFO expected = {};
@@ -194,10 +188,7 @@ TEST(MinidumpMiscInfoWriter, ProcessId) {
ASSERT_TRUE(minidump_file_writer.WriteEverything(&file_writer));
const MINIDUMP_MISC_INFO* observed;
- GetMiscInfoStream(file_writer.string(), &observed);
- if (Test::HasFatalFailure()) {
- return;
- }
+ ASSERT_NO_FATAL_FAILURE(GetMiscInfoStream(file_writer.string(), &observed));
MINIDUMP_MISC_INFO expected = {};
expected.Flags1 = MINIDUMP_MISC1_PROCESS_ID;
@@ -223,10 +214,7 @@ TEST(MinidumpMiscInfoWriter, ProcessTimes) {
ASSERT_TRUE(minidump_file_writer.WriteEverything(&file_writer));
const MINIDUMP_MISC_INFO* observed;
- GetMiscInfoStream(file_writer.string(), &observed);
- if (Test::HasFatalFailure()) {
- return;
- }
+ ASSERT_NO_FATAL_FAILURE(GetMiscInfoStream(file_writer.string(), &observed));
MINIDUMP_MISC_INFO expected = {};
expected.Flags1 = MINIDUMP_MISC1_PROCESS_TIMES;
@@ -259,10 +247,7 @@ TEST(MinidumpMiscInfoWriter, ProcessorPowerInfo) {
ASSERT_TRUE(minidump_file_writer.WriteEverything(&file_writer));
const MINIDUMP_MISC_INFO_2* observed;
- GetMiscInfoStream(file_writer.string(), &observed);
- if (Test::HasFatalFailure()) {
- return;
- }
+ ASSERT_NO_FATAL_FAILURE(GetMiscInfoStream(file_writer.string(), &observed));
MINIDUMP_MISC_INFO_2 expected = {};
expected.Flags1 = MINIDUMP_MISC1_PROCESSOR_POWER_INFO;
@@ -289,10 +274,7 @@ TEST(MinidumpMiscInfoWriter, ProcessIntegrityLevel) {
ASSERT_TRUE(minidump_file_writer.WriteEverything(&file_writer));
const MINIDUMP_MISC_INFO_3* observed;
- GetMiscInfoStream(file_writer.string(), &observed);
- if (Test::HasFatalFailure()) {
- return;
- }
+ ASSERT_NO_FATAL_FAILURE(GetMiscInfoStream(file_writer.string(), &observed));
MINIDUMP_MISC_INFO_3 expected = {};
expected.Flags1 = MINIDUMP_MISC3_PROCESS_INTEGRITY;
@@ -315,10 +297,7 @@ TEST(MinidumpMiscInfoWriter, ProcessExecuteFlags) {
ASSERT_TRUE(minidump_file_writer.WriteEverything(&file_writer));
const MINIDUMP_MISC_INFO_3* observed;
- GetMiscInfoStream(file_writer.string(), &observed);
- if (Test::HasFatalFailure()) {
- return;
- }
+ ASSERT_NO_FATAL_FAILURE(GetMiscInfoStream(file_writer.string(), &observed));
MINIDUMP_MISC_INFO_3 expected = {};
expected.Flags1 = MINIDUMP_MISC3_PROCESS_EXECUTE_FLAGS;
@@ -341,10 +320,7 @@ TEST(MinidumpMiscInfoWriter, ProtectedProcess) {
ASSERT_TRUE(minidump_file_writer.WriteEverything(&file_writer));
const MINIDUMP_MISC_INFO_3* observed;
- GetMiscInfoStream(file_writer.string(), &observed);
- if (Test::HasFatalFailure()) {
- return;
- }
+ ASSERT_NO_FATAL_FAILURE(GetMiscInfoStream(file_writer.string(), &observed));
MINIDUMP_MISC_INFO_3 expected = {};
expected.Flags1 = MINIDUMP_MISC3_PROTECTED_PROCESS;
@@ -381,10 +357,7 @@ TEST(MinidumpMiscInfoWriter, TimeZone) {
ASSERT_TRUE(minidump_file_writer.WriteEverything(&file_writer));
const MINIDUMP_MISC_INFO_3* observed;
- GetMiscInfoStream(file_writer.string(), &observed);
- if (Test::HasFatalFailure()) {
- return;
- }
+ ASSERT_NO_FATAL_FAILURE(GetMiscInfoStream(file_writer.string(), &observed));
MINIDUMP_MISC_INFO_3 expected = {};
expected.Flags1 = MINIDUMP_MISC3_TIMEZONE;
@@ -446,10 +419,7 @@ TEST(MinidumpMiscInfoWriter, TimeZoneStringsOverflow) {
ASSERT_TRUE(minidump_file_writer.WriteEverything(&file_writer));
const MINIDUMP_MISC_INFO_3* observed;
- GetMiscInfoStream(file_writer.string(), &observed);
- if (Test::HasFatalFailure()) {
- return;
- }
+ ASSERT_NO_FATAL_FAILURE(GetMiscInfoStream(file_writer.string(), &observed));
MINIDUMP_MISC_INFO_3 expected = {};
expected.Flags1 = MINIDUMP_MISC3_TIMEZONE;
@@ -490,10 +460,7 @@ TEST(MinidumpMiscInfoWriter, BuildStrings) {
ASSERT_TRUE(minidump_file_writer.WriteEverything(&file_writer));
const MINIDUMP_MISC_INFO_4* observed;
- GetMiscInfoStream(file_writer.string(), &observed);
- if (Test::HasFatalFailure()) {
- return;
- }
+ ASSERT_NO_FATAL_FAILURE(GetMiscInfoStream(file_writer.string(), &observed));
MINIDUMP_MISC_INFO_4 expected = {};
expected.Flags1 = MINIDUMP_MISC4_BUILDSTRING;
@@ -529,10 +496,7 @@ TEST(MinidumpMiscInfoWriter, BuildStringsOverflow) {
ASSERT_TRUE(minidump_file_writer.WriteEverything(&file_writer));
const MINIDUMP_MISC_INFO_4* observed;
- GetMiscInfoStream(file_writer.string(), &observed);
- if (Test::HasFatalFailure()) {
- return;
- }
+ ASSERT_NO_FATAL_FAILURE(GetMiscInfoStream(file_writer.string(), &observed));
MINIDUMP_MISC_INFO_4 expected = {};
expected.Flags1 = MINIDUMP_MISC4_BUILDSTRING;
@@ -601,10 +565,7 @@ TEST(MinidumpMiscInfoWriter, Everything) {
ASSERT_TRUE(minidump_file_writer.WriteEverything(&file_writer));
const MINIDUMP_MISC_INFO_4* observed;
- GetMiscInfoStream(file_writer.string(), &observed);
- if (Test::HasFatalFailure()) {
- return;
- }
+ ASSERT_NO_FATAL_FAILURE(GetMiscInfoStream(file_writer.string(), &observed));
MINIDUMP_MISC_INFO_4 expected = {};
expected.Flags1 =
« no previous file with comments | « minidump/minidump_memory_writer_test.cc ('k') | minidump/minidump_module_writer_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698