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

Unified Diff: minidump/minidump_thread_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_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 fb2baff95060c7ffadd1617e5480ce9c3128bfae..74fc7fe8d993f2e0821fa4c0c54709964460f27e 100644
--- a/minidump/minidump_thread_writer_test.cc
+++ b/minidump/minidump_thread_writer_test.cc
@@ -23,6 +23,7 @@
#include "minidump/test/minidump_context_test_util.h"
#include "minidump/test/minidump_memory_writer_test_util.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"
namespace crashpad {
@@ -51,19 +52,18 @@ void GetThreadListStream(const std::string& file_contents,
ASSERT_TRUE(directory);
ASSERT_EQ(kMinidumpStreamTypeThreadList, directory[0].StreamType);
- ASSERT_GE(directory[0].Location.DataSize, sizeof(MINIDUMP_THREAD_LIST));
- ASSERT_EQ(kThreadListStreamOffset, directory[0].Location.Rva);
+ EXPECT_EQ(kThreadListStreamOffset, directory[0].Location.Rva);
- *thread_list = reinterpret_cast<const MINIDUMP_THREAD_LIST*>(
- &file_contents[kThreadListStreamOffset]);
-
- ASSERT_EQ(sizeof(MINIDUMP_THREAD_LIST) +
- (*thread_list)->NumberOfThreads * sizeof(MINIDUMP_THREAD),
- directory[0].Location.DataSize);
+ *thread_list = MinidumpWritableAtLocationDescriptor<MINIDUMP_THREAD_LIST>(
+ file_contents, directory[0].Location);
+ ASSERT_TRUE(thread_list);
if (memory_list) {
- *memory_list = reinterpret_cast<const MINIDUMP_MEMORY_LIST*>(
- &file_contents[directory[1].Location.Rva]);
+ ASSERT_EQ(kMinidumpStreamTypeMemoryList, directory[1].StreamType);
+
+ *memory_list = MinidumpWritableAtLocationDescriptor<MINIDUMP_MEMORY_LIST>(
+ file_contents, directory[1].Location);
+ ASSERT_TRUE(*memory_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