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

Unified Diff: base/values_unittest.cc

Issue 21030009: Make element removal methods in DictionaryValue and ListValue take scoped_ptr's as outparams. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync Created 7 years, 4 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 | « base/values.cc ('k') | chrome/browser/chromeos/extensions/external_cache.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/values_unittest.cc
diff --git a/base/values_unittest.cc b/base/values_unittest.cc
index 8776c104cc1a401ccfa50195d296577005977673..733c485d2b1aca599dcb917edf179728bef6bbc9 100644
--- a/base/values_unittest.cc
+++ b/base/values_unittest.cc
@@ -203,7 +203,7 @@ TEST(ValuesTest, ListDeletion) {
TEST(ValuesTest, ListRemoval) {
bool deletion_flag = true;
- Value* removed_item = NULL;
+ scoped_ptr<Value> removed_item;
{
ListValue list;
@@ -218,8 +218,7 @@ TEST(ValuesTest, ListRemoval) {
EXPECT_EQ(0U, list.GetSize());
}
EXPECT_FALSE(deletion_flag);
- delete removed_item;
- removed_item = NULL;
+ removed_item.reset();
EXPECT_TRUE(deletion_flag);
{
@@ -275,7 +274,7 @@ TEST(ValuesTest, DictionaryDeletion) {
TEST(ValuesTest, DictionaryRemoval) {
std::string key = "test";
bool deletion_flag = true;
- Value* removed_item = NULL;
+ scoped_ptr<Value> removed_item;
{
DictionaryValue dict;
@@ -288,8 +287,7 @@ TEST(ValuesTest, DictionaryRemoval) {
ASSERT_TRUE(removed_item);
}
EXPECT_FALSE(deletion_flag);
- delete removed_item;
- removed_item = NULL;
+ removed_item.reset();
EXPECT_TRUE(deletion_flag);
{
« no previous file with comments | « base/values.cc ('k') | chrome/browser/chromeos/extensions/external_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698