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

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

Issue 10701012: JSON Schema Compiler: Added event compilation. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Synced. Created 8 years, 5 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/choices.json ('k') | tools/json_schema_compiler/test/crossref_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/json_schema_compiler/test/choices_unittest.cc
diff --git a/tools/json_schema_compiler/test/choices_unittest.cc b/tools/json_schema_compiler/test/choices_unittest.cc
index dcdfd77c060a7a69521fe2f3b90ffc231d6f0129..ce5a0ee17ad3ba4adfb3458c8a48574a79827ff5 100644
--- a/tools/json_schema_compiler/test/choices_unittest.cc
+++ b/tools/json_schema_compiler/test/choices_unittest.cc
@@ -116,20 +116,20 @@ TEST(JsonSchemaCompilerChoicesTest, ReturnChoices) {
std::vector<int> integers;
integers.push_back(1);
integers.push_back(2);
- scoped_ptr<Value> array_result(ReturnChoices::Result::Create(integers));
- ListValue* list = NULL;
- EXPECT_TRUE(array_result->GetAsList(&list));
- EXPECT_EQ((size_t) 2, list->GetSize());
- int temp;
- EXPECT_TRUE(list->GetInteger(0, &temp));
- EXPECT_EQ(1, temp);
- EXPECT_TRUE(list->GetInteger(1, &temp));
- EXPECT_EQ(2, temp);
+ scoped_ptr<ListValue> array_results =
+ ReturnChoices::Results::Create(integers);
+
+ ListValue expected;
+ ListValue* expected_argument = new ListValue();
+ expected_argument->Append(Value::CreateIntegerValue(1));
+ expected_argument->Append(Value::CreateIntegerValue(2));
+ expected.Append(expected_argument);
+ EXPECT_TRUE(array_results->Equals(&expected));
}
{
- scoped_ptr<Value> single_result(ReturnChoices::Result::Create(5));
- int temp;
- EXPECT_TRUE(single_result->GetAsInteger(&temp));
- EXPECT_EQ(5, temp);
+ scoped_ptr<ListValue> integer_results = ReturnChoices::Results::Create(5);
+ ListValue expected;
+ expected.Append(Value::CreateIntegerValue(5));
+ EXPECT_TRUE(integer_results->Equals(&expected));
}
}
« no previous file with comments | « tools/json_schema_compiler/test/choices.json ('k') | tools/json_schema_compiler/test/crossref_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698