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

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

Issue 9491002: json_schema_compiler: any, additionalProperties, functions on types (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: add any in arrays to util.h Created 8 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 | « tools/json_schema_compiler/test/arrays.json ('k') | tools/json_schema_compiler/test/functionsOnTypes.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/json_schema_compiler/test/arrays_unittest.cc
diff --git a/tools/json_schema_compiler/test/arrays_unittest.cc b/tools/json_schema_compiler/test/arrays_unittest.cc
index 405fbb11eefb4f0c743d68aa62bac55316951fc1..5676e25783ae966c20a803a851019bf5d2dd0385 100644
--- a/tools/json_schema_compiler/test/arrays_unittest.cc
+++ b/tools/json_schema_compiler/test/arrays_unittest.cc
@@ -93,6 +93,22 @@ TEST(JsonSchemaCompilerArrayTest, IntegerArrayParamsCreate) {
EXPECT_EQ(8, params->nums[2]);
}
+TEST(JsonSchemaCompilerArrayTest, AnyArrayParamsCreate) {
+ scoped_ptr<ListValue> params_value(new ListValue());
+ scoped_ptr<ListValue> any_array(new ListValue());
+ any_array->Append(Value::CreateIntegerValue(1));
+ any_array->Append(Value::CreateStringValue("test"));
+ any_array->Append(CreateItemValue(2));
+ params_value->Append(any_array.release());
+ scoped_ptr<AnyArray::Params> params(
+ AnyArray::Params::Create(*params_value));
+ EXPECT_TRUE(params.get());
+ EXPECT_EQ((size_t) 3, params->anys.size());
+ int int_temp = 0;
+ EXPECT_TRUE(params->anys[0]->value().GetAsInteger(&int_temp));
+ EXPECT_EQ(1, int_temp);
+}
+
TEST(JsonSchemaCompilerArrayTest, RefArrayParamsCreate) {
scoped_ptr<ListValue> params_value(new ListValue());
scoped_ptr<ListValue> item_array(new ListValue());
« no previous file with comments | « tools/json_schema_compiler/test/arrays.json ('k') | tools/json_schema_compiler/test/functionsOnTypes.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698