| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "tools/json_schema_compiler/test/choices.h" | 5 #include "tools/json_schema_compiler/test/choices.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/strings/string_piece.h" | 9 #include "base/strings/string_piece.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 scoped_ptr<NestedChoice> obj = NestedChoice::FromValue(*value); | 274 scoped_ptr<NestedChoice> obj = NestedChoice::FromValue(*value); |
| 275 | 275 |
| 276 ASSERT_TRUE(obj); | 276 ASSERT_TRUE(obj); |
| 277 EXPECT_FALSE(obj->as_integer); | 277 EXPECT_FALSE(obj->as_integer); |
| 278 EXPECT_FALSE(obj->as_choice1); | 278 EXPECT_FALSE(obj->as_choice1); |
| 279 ASSERT_TRUE(obj->as_choice2); | 279 ASSERT_TRUE(obj->as_choice2); |
| 280 EXPECT_FALSE(obj->as_choice2->as_double); | 280 EXPECT_FALSE(obj->as_choice2->as_double); |
| 281 EXPECT_FALSE(obj->as_choice2->as_choice_type); | 281 EXPECT_FALSE(obj->as_choice2->as_choice_type); |
| 282 ASSERT_TRUE(obj->as_choice2->as_choice_types); | 282 ASSERT_TRUE(obj->as_choice2->as_choice_types); |
| 283 { | 283 { |
| 284 std::vector<linked_ptr<ChoiceType> >* choice_types = | 284 std::vector<ChoiceType>* choice_types = |
| 285 obj->as_choice2->as_choice_types.get(); | 285 obj->as_choice2->as_choice_types.get(); |
| 286 // Bleh too much effort to test everything. | 286 // Bleh too much effort to test everything. |
| 287 ASSERT_EQ(2u, choice_types->size()); | 287 ASSERT_EQ(2u, choice_types->size()); |
| 288 } | 288 } |
| 289 | 289 |
| 290 EXPECT_TRUE(base::Value::Equals(value.get(), obj->ToValue().get())); | 290 EXPECT_TRUE(base::Value::Equals(value.get(), obj->ToValue().get())); |
| 291 } | 291 } |
| 292 } | 292 } |
| 293 | 293 |
| 294 } // namespace | 294 } // namespace |
| OLD | NEW |