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

Unified Diff: minidump/minidump_context_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 | « no previous file | minidump/minidump_crashpad_info_writer_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: minidump/minidump_context_writer_test.cc
diff --git a/minidump/minidump_context_writer_test.cc b/minidump/minidump_context_writer_test.cc
index 01a1d25474d4defba42e412a54fa3d123a88a654..9c66996bcb7a12b9e70fb9eb557078831b4eb4ba 100644
--- a/minidump/minidump_context_writer_test.cc
+++ b/minidump/minidump_context_writer_test.cc
@@ -22,14 +22,14 @@
#include "minidump/test/minidump_writable_test_util.h"
#include "snapshot/cpu_context.h"
#include "snapshot/test/test_cpu_context.h"
-#include "util/file/string_file_writer.h"
+#include "util/file/string_file.h"
namespace crashpad {
namespace test {
namespace {
TEST(MinidumpContextWriter, MinidumpContextX86Writer) {
- StringFileWriter file_writer;
+ StringFile string_file;
{
// Make sure that a context writer that’s untouched writes a zeroed-out
@@ -38,11 +38,11 @@ TEST(MinidumpContextWriter, MinidumpContextX86Writer) {
MinidumpContextX86Writer context_writer;
- EXPECT_TRUE(context_writer.WriteEverything(&file_writer));
- ASSERT_EQ(sizeof(MinidumpContextX86), file_writer.string().size());
+ EXPECT_TRUE(context_writer.WriteEverything(&string_file));
+ ASSERT_EQ(sizeof(MinidumpContextX86), string_file.string().size());
const MinidumpContextX86* observed =
- MinidumpWritableAtRVA<MinidumpContextX86>(file_writer.string(), 0);
+ MinidumpWritableAtRVA<MinidumpContextX86>(string_file.string(), 0);
ASSERT_TRUE(observed);
ExpectMinidumpContextX86(0, observed, false);
@@ -51,17 +51,17 @@ TEST(MinidumpContextWriter, MinidumpContextX86Writer) {
{
SCOPED_TRACE("nonzero");
- file_writer.Reset();
+ string_file.Reset();
const uint32_t kSeed = 0x8086;
MinidumpContextX86Writer context_writer;
InitializeMinidumpContextX86(context_writer.context(), kSeed);
- EXPECT_TRUE(context_writer.WriteEverything(&file_writer));
- ASSERT_EQ(sizeof(MinidumpContextX86), file_writer.string().size());
+ EXPECT_TRUE(context_writer.WriteEverything(&string_file));
+ ASSERT_EQ(sizeof(MinidumpContextX86), string_file.string().size());
const MinidumpContextX86* observed =
- MinidumpWritableAtRVA<MinidumpContextX86>(file_writer.string(), 0);
+ MinidumpWritableAtRVA<MinidumpContextX86>(string_file.string(), 0);
ASSERT_TRUE(observed);
ExpectMinidumpContextX86(kSeed, observed, false);
@@ -69,7 +69,7 @@ TEST(MinidumpContextWriter, MinidumpContextX86Writer) {
}
TEST(MinidumpContextWriter, MinidumpContextAMD64Writer) {
- StringFileWriter file_writer;
+ StringFile string_file;
{
// Make sure that a context writer that’s untouched writes a zeroed-out
@@ -78,11 +78,11 @@ TEST(MinidumpContextWriter, MinidumpContextAMD64Writer) {
MinidumpContextAMD64Writer context_writer;
- EXPECT_TRUE(context_writer.WriteEverything(&file_writer));
- ASSERT_EQ(sizeof(MinidumpContextAMD64), file_writer.string().size());
+ EXPECT_TRUE(context_writer.WriteEverything(&string_file));
+ ASSERT_EQ(sizeof(MinidumpContextAMD64), string_file.string().size());
const MinidumpContextAMD64* observed =
- MinidumpWritableAtRVA<MinidumpContextAMD64>(file_writer.string(), 0);
+ MinidumpWritableAtRVA<MinidumpContextAMD64>(string_file.string(), 0);
ASSERT_TRUE(observed);
ExpectMinidumpContextAMD64(0, observed, false);
@@ -91,17 +91,17 @@ TEST(MinidumpContextWriter, MinidumpContextAMD64Writer) {
{
SCOPED_TRACE("nonzero");
- file_writer.Reset();
+ string_file.Reset();
const uint32_t kSeed = 0x808664;
MinidumpContextAMD64Writer context_writer;
InitializeMinidumpContextAMD64(context_writer.context(), kSeed);
- EXPECT_TRUE(context_writer.WriteEverything(&file_writer));
- ASSERT_EQ(sizeof(MinidumpContextAMD64), file_writer.string().size());
+ EXPECT_TRUE(context_writer.WriteEverything(&string_file));
+ ASSERT_EQ(sizeof(MinidumpContextAMD64), string_file.string().size());
const MinidumpContextAMD64* observed =
- MinidumpWritableAtRVA<MinidumpContextAMD64>(file_writer.string(), 0);
+ MinidumpWritableAtRVA<MinidumpContextAMD64>(string_file.string(), 0);
ASSERT_TRUE(observed);
ExpectMinidumpContextAMD64(kSeed, observed, false);
@@ -120,11 +120,11 @@ TEST(MinidumpContextWriter, CreateFromSnapshot_X86) {
MinidumpContextWriter::CreateFromSnapshot(&context_snapshot);
ASSERT_TRUE(context_writer);
- StringFileWriter file_writer;
- ASSERT_TRUE(context_writer->WriteEverything(&file_writer));
+ StringFile string_file;
+ ASSERT_TRUE(context_writer->WriteEverything(&string_file));
const MinidumpContextX86* observed =
- MinidumpWritableAtRVA<MinidumpContextX86>(file_writer.string(), 0);
+ MinidumpWritableAtRVA<MinidumpContextX86>(string_file.string(), 0);
ASSERT_TRUE(observed);
ExpectMinidumpContextX86(kSeed, observed, true);
@@ -142,11 +142,11 @@ TEST(MinidumpContextWriter, CreateFromSnapshot_AMD64) {
MinidumpContextWriter::CreateFromSnapshot(&context_snapshot);
ASSERT_TRUE(context_writer);
- StringFileWriter file_writer;
- ASSERT_TRUE(context_writer->WriteEverything(&file_writer));
+ StringFile string_file;
+ ASSERT_TRUE(context_writer->WriteEverything(&string_file));
const MinidumpContextAMD64* observed =
- MinidumpWritableAtRVA<MinidumpContextAMD64>(file_writer.string(), 0);
+ MinidumpWritableAtRVA<MinidumpContextAMD64>(string_file.string(), 0);
ASSERT_TRUE(observed);
ExpectMinidumpContextAMD64(kSeed, observed, true);
« no previous file with comments | « no previous file | minidump/minidump_crashpad_info_writer_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698