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

Unified Diff: minidump/minidump_system_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_simple_string_dictionary_writer_test.cc ('k') | minidump/minidump_thread_writer_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: minidump/minidump_system_info_writer_test.cc
diff --git a/minidump/minidump_system_info_writer_test.cc b/minidump/minidump_system_info_writer_test.cc
index 28c91df3ac17e3bd7e59b60997b480f2b59eba13..da7895bd6daa53d43851d72b83016d44830807ef 100644
--- a/minidump/minidump_system_info_writer_test.cc
+++ b/minidump/minidump_system_info_writer_test.cc
@@ -23,6 +23,7 @@
#include "minidump/minidump_file_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 {
@@ -56,17 +57,17 @@ void GetSystemInfoStream(const std::string& file_contents,
ASSERT_TRUE(directory);
ASSERT_EQ(kMinidumpStreamTypeSystemInfo, directory[0].StreamType);
- ASSERT_EQ(sizeof(MINIDUMP_SYSTEM_INFO), directory[0].Location.DataSize);
- ASSERT_EQ(kSystemInfoStreamOffset, directory[0].Location.Rva);
+ EXPECT_EQ(kSystemInfoStreamOffset, directory[0].Location.Rva);
- *system_info = reinterpret_cast<const MINIDUMP_SYSTEM_INFO*>(
- &file_contents[kSystemInfoStreamOffset]);
+ *system_info = MinidumpWritableAtLocationDescriptor<MINIDUMP_SYSTEM_INFO>(
+ file_contents, directory[0].Location);
+ ASSERT_TRUE(system_info);
- ASSERT_EQ(kCSDVersionOffset, (*system_info)->CSDVersionRva);
+ EXPECT_EQ(kCSDVersionOffset, (*system_info)->CSDVersionRva);
*csd_version =
MinidumpStringAtRVA(file_contents, (*system_info)->CSDVersionRva);
- ASSERT_EQ(kCSDVersionBytes, (*csd_version)->Length);
+ EXPECT_EQ(kCSDVersionBytes, (*csd_version)->Length);
}
TEST(MinidumpSystemInfoWriter, Empty) {
« no previous file with comments | « minidump/minidump_simple_string_dictionary_writer_test.cc ('k') | minidump/minidump_thread_writer_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698