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

Unified Diff: base/json/json_value_converter_unittest.cc

Issue 8952029: Returns a bool for JSONValueConverter::Convert() (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 12 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
« base/json/json_value_converter.h ('K') | « base/json/json_value_converter.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/json/json_value_converter_unittest.cc
diff --git a/base/json/json_value_converter_unittest.cc b/base/json/json_value_converter_unittest.cc
index d1a8ee723f99bf3cce68b24470a7aa6b7e122e15..0d65227d254f426075d66cbd4979c572720673b5 100644
--- a/base/json/json_value_converter_unittest.cc
+++ b/base/json/json_value_converter_unittest.cc
@@ -62,7 +62,8 @@ TEST(JSONValueConverterTest, ParseSimpleMessage) {
scoped_ptr<Value> value(base::JSONReader::Read(normal_data, false));
SimpleMessage message;
base::JSONValueConverter<SimpleMessage> converter;
- converter.Convert(*value.get(), &message);
+ EXPECT_TRUE(converter.Convert(*value.get(), &message));
+
EXPECT_EQ(1, message.foo);
EXPECT_EQ("bar", message.bar);
EXPECT_TRUE(message.baz);
@@ -95,7 +96,8 @@ TEST(JSONValueConverterTest, ParseNestedMessage) {
scoped_ptr<Value> value(base::JSONReader::Read(normal_data, false));
NestedMessage message;
base::JSONValueConverter<NestedMessage> converter;
- converter.Convert(*value.get(), &message);
+ EXPECT_TRUE(converter.Convert(*value.get(), &message));
+
EXPECT_EQ(1.0, message.foo);
EXPECT_EQ(1, message.child.foo);
EXPECT_EQ("bar", message.child.bar);
« base/json/json_value_converter.h ('K') | « base/json/json_value_converter.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698