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

Unified Diff: minidump/minidump_memory_writer_test.cc

Issue 643683003: minidump: Use variable names in tests that match parallel array indices (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: Rebase 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 | « no previous file | minidump/minidump_module_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 5d75a7c1e2520775612d2393d54119aade070b48..e028727e61c38a8beec3b083f6619e828ba986ce 100644
--- a/minidump/minidump_memory_writer_test.cc
+++ b/minidump/minidump_memory_writer_test.cc
@@ -134,17 +134,17 @@ TEST(MinidumpMemoryWriter, TwoMemoryRegions) {
MinidumpFileWriter minidump_file_writer;
MinidumpMemoryListWriter memory_list_writer;
- const uint64_t kBaseAddress1 = 0xc0ffee;
- const uint64_t kSize1 = 0x0100;
- const uint8_t kValue1 = '6';
- const uint64_t kBaseAddress2 = 0xfac00fac;
- const uint64_t kSize2 = 0x0200;
- const uint8_t kValue2 = '!';
-
+ const uint64_t kBaseAddress0 = 0xc0ffee;
+ const uint64_t kSize0 = 0x0100;
+ const uint8_t kValue0 = '6';
+ const uint64_t kBaseAddress1 = 0xfac00fac;
+ const uint64_t kSize1 = 0x0200;
+ const uint8_t kValue1 = '!';
+
+ TestMinidumpMemoryWriter memory_writer_0(kBaseAddress0, kSize0, kValue0);
+ memory_list_writer.AddMemory(&memory_writer_0);
TestMinidumpMemoryWriter memory_writer_1(kBaseAddress1, kSize1, kValue1);
memory_list_writer.AddMemory(&memory_writer_1);
- TestMinidumpMemoryWriter memory_writer_2(kBaseAddress2, kSize2, kValue2);
- memory_list_writer.AddMemory(&memory_writer_2);
minidump_file_writer.AddStream(&memory_list_writer);
@@ -162,8 +162,8 @@ TEST(MinidumpMemoryWriter, TwoMemoryRegions) {
{
SCOPED_TRACE("region 0");
- expected.StartOfMemoryRange = kBaseAddress1;
- expected.Memory.DataSize = kSize1;
+ expected.StartOfMemoryRange = kBaseAddress0;
+ expected.Memory.DataSize = kSize0;
expected.Memory.Rva =
sizeof(MINIDUMP_HEADER) + sizeof(MINIDUMP_DIRECTORY) +
sizeof(MINIDUMP_MEMORY_LIST) +
@@ -171,21 +171,21 @@ TEST(MinidumpMemoryWriter, TwoMemoryRegions) {
ExpectMinidumpMemoryDescriptorAndContents(&expected,
&memory_list->MemoryRanges[0],
file_writer.string(),
- kValue1,
+ kValue0,
false);
}
{
SCOPED_TRACE("region 1");
- expected.StartOfMemoryRange = kBaseAddress2;
- expected.Memory.DataSize = kSize2;
+ expected.StartOfMemoryRange = kBaseAddress1;
+ expected.Memory.DataSize = kSize1;
expected.Memory.Rva = memory_list->MemoryRanges[0].Memory.Rva +
memory_list->MemoryRanges[0].Memory.DataSize;
ExpectMinidumpMemoryDescriptorAndContents(&expected,
&memory_list->MemoryRanges[1],
file_writer.string(),
- kValue2,
+ kValue1,
true);
}
}
@@ -234,21 +234,21 @@ TEST(MinidumpMemoryWriter, ExtraMemory) {
// memory writer a child of the memory list writer.
MinidumpFileWriter minidump_file_writer;
- const uint64_t kBaseAddress1 = 0x1000;
- const uint64_t kSize1 = 0x0400;
- const uint8_t kValue1 = '1';
- TestMemoryStream test_memory_stream(kBaseAddress1, kSize1, kValue1);
+ const uint64_t kBaseAddress0 = 0x1000;
+ const uint64_t kSize0 = 0x0400;
+ const uint8_t kValue0 = '1';
+ TestMemoryStream test_memory_stream(kBaseAddress0, kSize0, kValue0);
MinidumpMemoryListWriter memory_list_writer;
memory_list_writer.AddExtraMemory(test_memory_stream.memory());
minidump_file_writer.AddStream(&test_memory_stream);
- const uint64_t kBaseAddress2 = 0x2000;
- const uint64_t kSize2 = 0x0400;
- const uint8_t kValue2 = 'm';
+ const uint64_t kBaseAddress1 = 0x2000;
+ const uint64_t kSize1 = 0x0400;
+ const uint8_t kValue1 = 'm';
- TestMinidumpMemoryWriter memory_writer(kBaseAddress2, kSize2, kValue2);
+ TestMinidumpMemoryWriter memory_writer(kBaseAddress1, kSize1, kValue1);
memory_list_writer.AddMemory(&memory_writer);
minidump_file_writer.AddStream(&memory_list_writer);
@@ -267,8 +267,8 @@ TEST(MinidumpMemoryWriter, ExtraMemory) {
{
SCOPED_TRACE("region 0");
- expected.StartOfMemoryRange = kBaseAddress1;
- expected.Memory.DataSize = kSize1;
+ expected.StartOfMemoryRange = kBaseAddress0;
+ expected.Memory.DataSize = kSize0;
expected.Memory.Rva =
sizeof(MINIDUMP_HEADER) + 2 * sizeof(MINIDUMP_DIRECTORY) +
sizeof(MINIDUMP_MEMORY_LIST) +
@@ -276,21 +276,21 @@ TEST(MinidumpMemoryWriter, ExtraMemory) {
ExpectMinidumpMemoryDescriptorAndContents(&expected,
&memory_list->MemoryRanges[0],
file_writer.string(),
- kValue1,
+ kValue0,
false);
}
{
SCOPED_TRACE("region 1");
- expected.StartOfMemoryRange = kBaseAddress2;
- expected.Memory.DataSize = kSize2;
+ expected.StartOfMemoryRange = kBaseAddress1;
+ expected.Memory.DataSize = kSize1;
expected.Memory.Rva = memory_list->MemoryRanges[0].Memory.Rva +
memory_list->MemoryRanges[0].Memory.DataSize;
ExpectMinidumpMemoryDescriptorAndContents(&expected,
&memory_list->MemoryRanges[1],
file_writer.string(),
- kValue2,
+ kValue1,
true);
}
}
« no previous file with comments | « no previous file | minidump/minidump_module_writer_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698