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

Unified Diff: minidump/minidump_simple_string_dictionary_writer_test.cc

Issue 674153002: minidump: Change the ownership model (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.cc ('k') | minidump/minidump_stream_writer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: minidump/minidump_simple_string_dictionary_writer_test.cc
diff --git a/minidump/minidump_simple_string_dictionary_writer_test.cc b/minidump/minidump_simple_string_dictionary_writer_test.cc
index 7ab62a8708082a4f8ec55d4e9b9fa1f192b4601a..62b1479f88f1a45453b463e132fc63b32636db40 100644
--- a/minidump/minidump_simple_string_dictionary_writer_test.cc
+++ b/minidump/minidump_simple_string_dictionary_writer_test.cc
@@ -57,8 +57,9 @@ TEST(MinidumpSimpleStringDictionaryWriter, EmptyKeyValue) {
StringFileWriter file_writer;
MinidumpSimpleStringDictionaryWriter dictionary_writer;
- MinidumpSimpleStringDictionaryEntryWriter entry_writer;
- dictionary_writer.AddEntry(&entry_writer);
+ auto entry_writer =
+ make_scoped_ptr(new MinidumpSimpleStringDictionaryEntryWriter());
+ dictionary_writer.AddEntry(entry_writer.Pass());
EXPECT_TRUE(dictionary_writer.WriteEverything(&file_writer));
ASSERT_EQ(sizeof(MinidumpSimpleStringDictionary) +
@@ -87,9 +88,10 @@ TEST(MinidumpSimpleStringDictionaryWriter, OneKeyValue) {
char kValue[] = "value";
MinidumpSimpleStringDictionaryWriter dictionary_writer;
- MinidumpSimpleStringDictionaryEntryWriter entry_writer;
- entry_writer.SetKeyValue(kKey, kValue);
- dictionary_writer.AddEntry(&entry_writer);
+ auto entry_writer =
+ make_scoped_ptr(new MinidumpSimpleStringDictionaryEntryWriter());
+ entry_writer->SetKeyValue(kKey, kValue);
+ dictionary_writer.AddEntry(entry_writer.Pass());
EXPECT_TRUE(dictionary_writer.WriteEverything(&file_writer));
ASSERT_EQ(sizeof(MinidumpSimpleStringDictionary) +
@@ -122,15 +124,18 @@ TEST(MinidumpSimpleStringDictionaryWriter, ThreeKeysValues) {
char kValue2[] = "val2";
MinidumpSimpleStringDictionaryWriter dictionary_writer;
- MinidumpSimpleStringDictionaryEntryWriter entry_writer_0;
- entry_writer_0.SetKeyValue(kKey0, kValue0);
- dictionary_writer.AddEntry(&entry_writer_0);
- MinidumpSimpleStringDictionaryEntryWriter entry_writer_1;
- entry_writer_1.SetKeyValue(kKey1, kValue1);
- dictionary_writer.AddEntry(&entry_writer_1);
- MinidumpSimpleStringDictionaryEntryWriter entry_writer_2;
- entry_writer_2.SetKeyValue(kKey2, kValue2);
- dictionary_writer.AddEntry(&entry_writer_2);
+ auto entry_writer_0 =
+ make_scoped_ptr(new MinidumpSimpleStringDictionaryEntryWriter());
+ entry_writer_0->SetKeyValue(kKey0, kValue0);
+ dictionary_writer.AddEntry(entry_writer_0.Pass());
+ auto entry_writer_1 =
+ make_scoped_ptr(new MinidumpSimpleStringDictionaryEntryWriter());
+ entry_writer_1->SetKeyValue(kKey1, kValue1);
+ dictionary_writer.AddEntry(entry_writer_1.Pass());
+ auto entry_writer_2 =
+ make_scoped_ptr(new MinidumpSimpleStringDictionaryEntryWriter());
+ entry_writer_2->SetKeyValue(kKey2, kValue2);
+ dictionary_writer.AddEntry(entry_writer_2.Pass());
EXPECT_TRUE(dictionary_writer.WriteEverything(&file_writer));
ASSERT_EQ(sizeof(MinidumpSimpleStringDictionary) +
@@ -185,12 +190,14 @@ TEST(MinidumpSimpleStringDictionaryWriter, DuplicateKeyValue) {
char kValue1[] = "value";
MinidumpSimpleStringDictionaryWriter dictionary_writer;
- MinidumpSimpleStringDictionaryEntryWriter entry_writer_0;
- entry_writer_0.SetKeyValue(kKey, kValue0);
- dictionary_writer.AddEntry(&entry_writer_0);
- MinidumpSimpleStringDictionaryEntryWriter entry_writer_1;
- entry_writer_1.SetKeyValue(kKey, kValue1);
- dictionary_writer.AddEntry(&entry_writer_1);
+ auto entry_writer_0 =
+ make_scoped_ptr(new MinidumpSimpleStringDictionaryEntryWriter());
+ entry_writer_0->SetKeyValue(kKey, kValue0);
+ dictionary_writer.AddEntry(entry_writer_0.Pass());
+ auto entry_writer_1 =
+ make_scoped_ptr(new MinidumpSimpleStringDictionaryEntryWriter());
+ entry_writer_1->SetKeyValue(kKey, kValue1);
+ dictionary_writer.AddEntry(entry_writer_1.Pass());
EXPECT_TRUE(dictionary_writer.WriteEverything(&file_writer));
ASSERT_EQ(sizeof(MinidumpSimpleStringDictionary) +
« no previous file with comments | « minidump/minidump_simple_string_dictionary_writer.cc ('k') | minidump/minidump_stream_writer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698