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

Unified Diff: minidump/minidump_thread_writer_test.cc

Issue 664283002: Refactor minidump test utilities for MinidumpWritable, … (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') | minidump/test/minidump_file_writer_test_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: minidump/minidump_thread_writer_test.cc
diff --git a/minidump/minidump_thread_writer_test.cc b/minidump/minidump_thread_writer_test.cc
index 15f1a07cb212b57aa110d57414796e3d19912551..fb2baff95060c7ffadd1617e5480ce9c3128bfae 100644
--- a/minidump/minidump_thread_writer_test.cc
+++ b/minidump/minidump_thread_writer_test.cc
@@ -44,14 +44,11 @@ void GetThreadListStream(const std::string& file_contents,
ASSERT_GE(file_contents.size(), kThreadsOffset);
+ const MINIDUMP_DIRECTORY* directory;
const MINIDUMP_HEADER* header =
- reinterpret_cast<const MINIDUMP_HEADER*>(&file_contents[0]);
-
+ MinidumpHeaderAtStart(file_contents, &directory);
ASSERT_NO_FATAL_FAILURE(VerifyMinidumpHeader(header, kExpectedStreams, 0));
-
- const MINIDUMP_DIRECTORY* directory =
- reinterpret_cast<const MINIDUMP_DIRECTORY*>(
- &file_contents[kDirectoryOffset]);
+ ASSERT_TRUE(directory);
ASSERT_EQ(kMinidumpStreamTypeThreadList, directory[0].StreamType);
ASSERT_GE(directory[0].Location.DataSize, sizeof(MINIDUMP_THREAD_LIST));
« no previous file with comments | « minidump/minidump_system_info_writer_test.cc ('k') | minidump/test/minidump_file_writer_test_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698