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

Unified Diff: minidump/minidump_crashpad_info_writer_test.cc

Issue 670853002: minidump: Migrate the rest of the tests to MinidumpWritableAtLocationDescriptor<>() (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: Address review feedback 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_context_writer_test.cc ('k') | minidump/minidump_exception_writer_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: minidump/minidump_crashpad_info_writer_test.cc
diff --git a/minidump/minidump_crashpad_info_writer_test.cc b/minidump/minidump_crashpad_info_writer_test.cc
index 3cbbfb6b6196197a631694b23d4f420afbc51c8d..b59301be728eac967ee57fc5ef4db6eaaaafc61f 100644
--- a/minidump/minidump_crashpad_info_writer_test.cc
+++ b/minidump/minidump_crashpad_info_writer_test.cc
@@ -22,6 +22,7 @@
#include "minidump/minidump_simple_string_dictionary_writer.h"
#include "minidump/test/minidump_file_writer_test_util.h"
#include "minidump/test/minidump_string_writer_test_util.h"
+#include "minidump/test/minidump_writable_test_util.h"
#include "util/file/string_file_writer.h"
namespace crashpad {
@@ -55,20 +56,19 @@ void GetCrashpadInfoStream(
ASSERT_TRUE(directory);
ASSERT_EQ(kMinidumpStreamTypeCrashpadInfo, directory[0].StreamType);
- ASSERT_EQ(sizeof(MinidumpCrashpadInfo), directory[0].Location.DataSize);
- ASSERT_EQ(kCrashpadInfoStreamOffset, directory[0].Location.Rva);
+ EXPECT_EQ(kCrashpadInfoStreamOffset, directory[0].Location.Rva);
- *crashpad_info = reinterpret_cast<const MinidumpCrashpadInfo*>(
- &file_contents[kCrashpadInfoStreamOffset]);
+ *crashpad_info = MinidumpWritableAtLocationDescriptor<MinidumpCrashpadInfo>(
+ file_contents, directory[0].Location);
+ ASSERT_TRUE(*crashpad_info);
if (simple_annotations) {
- ASSERT_GE((*crashpad_info)->simple_annotations.DataSize,
- sizeof(MinidumpSimpleStringDictionary));
- ASSERT_EQ(kSimpleAnnotationsOffset,
+ EXPECT_EQ(kSimpleAnnotationsOffset,
(*crashpad_info)->simple_annotations.Rva);
*simple_annotations =
- reinterpret_cast<const MinidumpSimpleStringDictionary*>(
- &file_contents[kSimpleAnnotationsOffset]);
+ MinidumpWritableAtLocationDescriptor<MinidumpSimpleStringDictionary>(
+ file_contents, (*crashpad_info)->simple_annotations);
+ ASSERT_TRUE(*simple_annotations);
} else {
ASSERT_EQ(0u, (*crashpad_info)->simple_annotations.DataSize);
ASSERT_EQ(0u, (*crashpad_info)->simple_annotations.Rva);
« no previous file with comments | « minidump/minidump_context_writer_test.cc ('k') | minidump/minidump_exception_writer_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698