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

Unified Diff: minidump/minidump_module_writer_test.cc

Issue 936153002: Add FileReaderInterface. Move StringFileWriter to StringFile and (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: Remove unused #include Created 5 years, 10 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_module_crashpad_info_writer_test.cc ('k') | minidump/minidump_rva_list_writer_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: minidump/minidump_module_writer_test.cc
diff --git a/minidump/minidump_module_writer_test.cc b/minidump/minidump_module_writer_test.cc
index dd104a5aa866fa6420772e9eb447e91ba5283cc2..6024c2ca65bc0238d1009c3d978d4b222507959b 100644
--- a/minidump/minidump_module_writer_test.cc
+++ b/minidump/minidump_module_writer_test.cc
@@ -30,7 +30,7 @@
#include "minidump/test/minidump_string_writer_test_util.h"
#include "minidump/test/minidump_writable_test_util.h"
#include "snapshot/test/test_module_snapshot.h"
-#include "util/file/string_file_writer.h"
+#include "util/file/string_file.h"
#include "util/misc/uuid.h"
#include "util/stdlib/pointer_container.h"
@@ -68,16 +68,16 @@ TEST(MinidumpModuleWriter, EmptyModuleList) {
minidump_file_writer.AddStream(module_list_writer.Pass());
- StringFileWriter file_writer;
- ASSERT_TRUE(minidump_file_writer.WriteEverything(&file_writer));
+ StringFile string_file;
+ ASSERT_TRUE(minidump_file_writer.WriteEverything(&string_file));
ASSERT_EQ(sizeof(MINIDUMP_HEADER) + sizeof(MINIDUMP_DIRECTORY) +
sizeof(MINIDUMP_MODULE_LIST),
- file_writer.string().size());
+ string_file.string().size());
const MINIDUMP_MODULE_LIST* module_list = nullptr;
ASSERT_NO_FATAL_FAILURE(
- GetModuleListStream(file_writer.string(), &module_list));
+ GetModuleListStream(string_file.string(), &module_list));
EXPECT_EQ(0u, module_list->NumberOfModules);
}
@@ -282,23 +282,23 @@ TEST(MinidumpModuleWriter, EmptyModule) {
module_list_writer->AddModule(module_writer.Pass());
minidump_file_writer.AddStream(module_list_writer.Pass());
- StringFileWriter file_writer;
- ASSERT_TRUE(minidump_file_writer.WriteEverything(&file_writer));
+ StringFile string_file;
+ ASSERT_TRUE(minidump_file_writer.WriteEverything(&string_file));
- ASSERT_GT(file_writer.string().size(),
+ ASSERT_GT(string_file.string().size(),
sizeof(MINIDUMP_HEADER) + sizeof(MINIDUMP_DIRECTORY) +
sizeof(MINIDUMP_MODULE_LIST) + 1 * sizeof(MINIDUMP_MODULE));
const MINIDUMP_MODULE_LIST* module_list = nullptr;
ASSERT_NO_FATAL_FAILURE(
- GetModuleListStream(file_writer.string(), &module_list));
+ GetModuleListStream(string_file.string(), &module_list));
EXPECT_EQ(1u, module_list->NumberOfModules);
MINIDUMP_MODULE expected = {};
ASSERT_NO_FATAL_FAILURE(ExpectModule(&expected,
&module_list->Modules[0],
- file_writer.string(),
+ string_file.string(),
kModuleName,
nullptr,
nullptr,
@@ -373,16 +373,16 @@ TEST(MinidumpModuleWriter, OneModule) {
module_list_writer->AddModule(module_writer.Pass());
minidump_file_writer.AddStream(module_list_writer.Pass());
- StringFileWriter file_writer;
- ASSERT_TRUE(minidump_file_writer.WriteEverything(&file_writer));
+ StringFile string_file;
+ ASSERT_TRUE(minidump_file_writer.WriteEverything(&string_file));
- ASSERT_GT(file_writer.string().size(),
+ ASSERT_GT(string_file.string().size(),
sizeof(MINIDUMP_HEADER) + sizeof(MINIDUMP_DIRECTORY) +
sizeof(MINIDUMP_MODULE_LIST) + 1 * sizeof(MINIDUMP_MODULE));
const MINIDUMP_MODULE_LIST* module_list = nullptr;
ASSERT_NO_FATAL_FAILURE(
- GetModuleListStream(file_writer.string(), &module_list));
+ GetModuleListStream(string_file.string(), &module_list));
EXPECT_EQ(1u, module_list->NumberOfModules);
@@ -403,7 +403,7 @@ TEST(MinidumpModuleWriter, OneModule) {
ASSERT_NO_FATAL_FAILURE(ExpectModule(&expected,
&module_list->Modules[0],
- file_writer.string(),
+ string_file.string(),
kModuleName,
kPDBName,
&pdb_uuid,
@@ -448,16 +448,16 @@ TEST(MinidumpModuleWriter, OneModule_CodeViewUsesPDB20_MiscUsesUTF16) {
module_list_writer->AddModule(module_writer.Pass());
minidump_file_writer.AddStream(module_list_writer.Pass());
- StringFileWriter file_writer;
- ASSERT_TRUE(minidump_file_writer.WriteEverything(&file_writer));
+ StringFile string_file;
+ ASSERT_TRUE(minidump_file_writer.WriteEverything(&string_file));
- ASSERT_GT(file_writer.string().size(),
+ ASSERT_GT(string_file.string().size(),
sizeof(MINIDUMP_HEADER) + sizeof(MINIDUMP_DIRECTORY) +
sizeof(MINIDUMP_MODULE_LIST) + 1 * sizeof(MINIDUMP_MODULE));
const MINIDUMP_MODULE_LIST* module_list = nullptr;
ASSERT_NO_FATAL_FAILURE(
- GetModuleListStream(file_writer.string(), &module_list));
+ GetModuleListStream(string_file.string(), &module_list));
EXPECT_EQ(1u, module_list->NumberOfModules);
@@ -465,7 +465,7 @@ TEST(MinidumpModuleWriter, OneModule_CodeViewUsesPDB20_MiscUsesUTF16) {
ASSERT_NO_FATAL_FAILURE(ExpectModule(&expected,
&module_list->Modules[0],
- file_writer.string(),
+ string_file.string(),
kModuleName,
kPDBName,
nullptr,
@@ -540,16 +540,16 @@ TEST(MinidumpModuleWriter, ThreeModules) {
minidump_file_writer.AddStream(module_list_writer.Pass());
- StringFileWriter file_writer;
- ASSERT_TRUE(minidump_file_writer.WriteEverything(&file_writer));
+ StringFile string_file;
+ ASSERT_TRUE(minidump_file_writer.WriteEverything(&string_file));
- ASSERT_GT(file_writer.string().size(),
+ ASSERT_GT(string_file.string().size(),
sizeof(MINIDUMP_HEADER) + sizeof(MINIDUMP_DIRECTORY) +
sizeof(MINIDUMP_MODULE_LIST) + 1 * sizeof(MINIDUMP_MODULE));
const MINIDUMP_MODULE_LIST* module_list = nullptr;
ASSERT_NO_FATAL_FAILURE(
- GetModuleListStream(file_writer.string(), &module_list));
+ GetModuleListStream(string_file.string(), &module_list));
EXPECT_EQ(3u, module_list->NumberOfModules);
@@ -563,7 +563,7 @@ TEST(MinidumpModuleWriter, ThreeModules) {
ASSERT_NO_FATAL_FAILURE(ExpectModule(&expected,
&module_list->Modules[0],
- file_writer.string(),
+ string_file.string(),
kModuleName0,
kPDBName0,
&pdb_uuid_0,
@@ -582,7 +582,7 @@ TEST(MinidumpModuleWriter, ThreeModules) {
ASSERT_NO_FATAL_FAILURE(ExpectModule(&expected,
&module_list->Modules[1],
- file_writer.string(),
+ string_file.string(),
kModuleName1,
nullptr,
nullptr,
@@ -601,7 +601,7 @@ TEST(MinidumpModuleWriter, ThreeModules) {
ASSERT_NO_FATAL_FAILURE(ExpectModule(&expected,
&module_list->Modules[2],
- file_writer.string(),
+ string_file.string(),
kModuleName2,
kPDBName2,
nullptr,
@@ -720,12 +720,12 @@ TEST(MinidumpModuleWriter, InitializeFromSnapshot) {
MinidumpFileWriter minidump_file_writer;
minidump_file_writer.AddStream(module_list_writer.Pass());
- StringFileWriter file_writer;
- ASSERT_TRUE(minidump_file_writer.WriteEverything(&file_writer));
+ StringFile string_file;
+ ASSERT_TRUE(minidump_file_writer.WriteEverything(&string_file));
const MINIDUMP_MODULE_LIST* module_list = nullptr;
ASSERT_NO_FATAL_FAILURE(
- GetModuleListStream(file_writer.string(), &module_list));
+ GetModuleListStream(string_file.string(), &module_list));
ASSERT_EQ(3u, module_list->NumberOfModules);
@@ -733,7 +733,7 @@ TEST(MinidumpModuleWriter, InitializeFromSnapshot) {
SCOPED_TRACE(base::StringPrintf("index %" PRIuS, index));
ASSERT_NO_FATAL_FAILURE(ExpectModule(&expect_modules[index],
&module_list->Modules[index],
- file_writer.string(),
+ string_file.string(),
module_paths[index],
module_names[index],
&uuids[index],
@@ -752,8 +752,8 @@ TEST(MinidumpModuleWriterDeathTest, NoModuleName) {
module_list_writer->AddModule(module_writer.Pass());
minidump_file_writer.AddStream(module_list_writer.Pass());
- StringFileWriter file_writer;
- ASSERT_DEATH(minidump_file_writer.WriteEverything(&file_writer), "name_");
+ StringFile string_file;
+ ASSERT_DEATH(minidump_file_writer.WriteEverything(&string_file), "name_");
}
} // namespace
« no previous file with comments | « minidump/minidump_module_crashpad_info_writer_test.cc ('k') | minidump/minidump_rva_list_writer_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698