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

Unified Diff: minidump/minidump_misc_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_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 5960685bb360c29fa99813a73e8e2052226d33d0..a342f27e685330f2e39803fc92b6fd6525e4fe18 100644
--- a/minidump/minidump_misc_info_writer_test.cc
+++ b/minidump/minidump_misc_info_writer_test.cc
@@ -25,6 +25,7 @@
#include "gtest/gtest.h"
#include "minidump/minidump_file_writer.h"
#include "minidump/test/minidump_file_writer_test_util.h"
+#include "minidump/test/minidump_writable_test_util.h"
#include "util/file/string_file_writer.h"
#include "util/stdlib/strlcpy.h"
@@ -49,13 +50,11 @@ void GetMiscInfoStream(const std::string& file_contents, const T** misc_info) {
ASSERT_TRUE(directory);
ASSERT_EQ(kMinidumpStreamTypeMiscInfo, directory[0].StreamType);
- ASSERT_EQ(kMiscInfoStreamSize, directory[0].Location.DataSize);
- ASSERT_EQ(kMiscInfoStreamOffset, directory[0].Location.Rva);
+ EXPECT_EQ(kMiscInfoStreamOffset, directory[0].Location.Rva);
- *misc_info =
- reinterpret_cast<const T*>(&file_contents[kMiscInfoStreamOffset]);
-
- ASSERT_EQ(kMiscInfoStreamSize, (*misc_info)->SizeOfInfo);
+ *misc_info = MinidumpWritableAtLocationDescriptor<T>(file_contents,
+ directory[0].Location);
+ ASSERT_TRUE(misc_info);
}
void ExpectNULPaddedString16Equal(const char16* expected,
« 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