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

Unified Diff: tools/json_schema_compiler/test/idl_schemas_unittest.cc

Issue 2036013002: Remove ListValue::Append(new {Fundamental,String}Value(...)) pattern in //tools (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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
Index: tools/json_schema_compiler/test/idl_schemas_unittest.cc
diff --git a/tools/json_schema_compiler/test/idl_schemas_unittest.cc b/tools/json_schema_compiler/test/idl_schemas_unittest.cc
index 2599d9e846ce36d04dfac6bed39956da875e6f6c..d0c13346f837ffe95c474186296178d44f86a200 100644
--- a/tools/json_schema_compiler/test/idl_schemas_unittest.cc
+++ b/tools/json_schema_compiler/test/idl_schemas_unittest.cc
@@ -37,7 +37,7 @@ TEST(IdlCompiler, Basics) {
// Test Function2, which takes an integer parameter.
base::ListValue list;
- list.Append(new base::FundamentalValue(5));
+ list.AppendInteger(5);
std::unique_ptr<Function2::Params> f2_params =
Function2::Params::Create(list);
EXPECT_EQ(5, f2_params->x);
@@ -84,19 +84,19 @@ TEST(IdlCompiler, OptionalArguments) {
std::unique_ptr<Function7::Params> f7_params =
Function7::Params::Create(list);
EXPECT_EQ(NULL, f7_params->arg.get());
- list.Append(new base::FundamentalValue(7));
+ list.AppendInteger(7);
f7_params = Function7::Params::Create(list);
EXPECT_EQ(7, *(f7_params->arg));
// Similar to above, but a function with one required and one optional
// argument.
list.Clear();
- list.Append(new base::FundamentalValue(8));
+ list.AppendInteger(8);
std::unique_ptr<Function8::Params> f8_params =
Function8::Params::Create(list);
EXPECT_EQ(8, f8_params->arg1);
EXPECT_EQ(NULL, f8_params->arg2.get());
- list.Append(new base::StringValue("foo"));
+ list.AppendString("foo");
f8_params = Function8::Params::Create(list);
EXPECT_EQ(8, f8_params->arg1);
EXPECT_EQ("foo", *(f8_params->arg2));
@@ -126,7 +126,7 @@ TEST(IdlCompiler, ArrayTypes) {
// Tests of a function that takes an integer and an array of integers. First
// use an empty array.
base::ListValue list;
- list.Append(new base::FundamentalValue(33));
+ list.AppendInteger(33);
list.Append(new base::ListValue);
std::unique_ptr<Function10::Params> f10_params =
Function10::Params::Create(list);
@@ -136,10 +136,10 @@ TEST(IdlCompiler, ArrayTypes) {
// Same function, but this time with 2 values in the array.
list.Clear();
- list.Append(new base::FundamentalValue(33));
+ list.AppendInteger(33);
base::ListValue* sublist = new base::ListValue;
- sublist->Append(new base::FundamentalValue(34));
- sublist->Append(new base::FundamentalValue(35));
+ sublist->AppendInteger(34);
+ sublist->AppendInteger(35);
list.Append(sublist);
f10_params = Function10::Params::Create(list);
ASSERT_TRUE(f10_params != NULL);
« no previous file with comments | « tools/json_schema_compiler/test/functions_on_types_unittest.cc ('k') | tools/json_schema_compiler/test/objects_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698