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

Unified Diff: minidump/minidump_memory_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_file_writer_test.cc ('k') | minidump/minidump_misc_info_writer_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: minidump/minidump_memory_writer_test.cc
diff --git a/minidump/minidump_memory_writer_test.cc b/minidump/minidump_memory_writer_test.cc
index 66a3fc6106e58dc46960f8b1ce62cac712588f85..8060db7d0c1705bfdf487eb7f2d5ecb4d328d277 100644
--- a/minidump/minidump_memory_writer_test.cc
+++ b/minidump/minidump_memory_writer_test.cc
@@ -24,6 +24,7 @@
#include "minidump/minidump_stream_writer.h"
#include "minidump/test/minidump_file_writer_test_util.h"
#include "minidump/test/minidump_memory_writer_test_util.h"
+#include "minidump/test/minidump_writable_test_util.h"
#include "util/file/string_file_writer.h"
namespace crashpad {
@@ -63,17 +64,11 @@ void GetMemoryListStream(const std::string& file_contents,
ASSERT_EQ(kMinidumpStreamTypeMemoryList,
directory[directory_index].StreamType);
- ASSERT_GE(directory[directory_index].Location.DataSize,
- sizeof(MINIDUMP_MEMORY_LIST));
- ASSERT_EQ(kMemoryListStreamOffset, directory[directory_index].Location.Rva);
+ EXPECT_EQ(kMemoryListStreamOffset, directory[directory_index].Location.Rva);
- *memory_list = reinterpret_cast<const MINIDUMP_MEMORY_LIST*>(
- &file_contents[kMemoryListStreamOffset]);
-
- ASSERT_EQ(sizeof(MINIDUMP_MEMORY_LIST) +
- (*memory_list)->NumberOfMemoryRanges *
- sizeof(MINIDUMP_MEMORY_DESCRIPTOR),
- directory[directory_index].Location.DataSize);
+ *memory_list = MinidumpWritableAtLocationDescriptor<MINIDUMP_MEMORY_LIST>(
+ file_contents, directory[directory_index].Location);
+ ASSERT_TRUE(memory_list);
}
TEST(MinidumpMemoryWriter, EmptyMemoryList) {
« no previous file with comments | « minidump/minidump_file_writer_test.cc ('k') | minidump/minidump_misc_info_writer_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698