Lines Matching refs:json
49 std::string json = "{\"" + json_key + "\": \"test\"}"; in TestParseOkWithUnknownKey() local
50 auto object = JsonStringToMessage<T>(json); in TestParseOkWithUnknownKey()
55 ASSERT_FALSE(AllFieldsAreKnown(*object, json, &error)) in TestParseOkWithUnknownKey()
63 std::string json = in TEST_F() local
70 auto object = JsonStringToMessage<WithJsonName>(json); in TEST_F()
79 EXPECT_TRUE(AllFieldsAreKnown(*object, json, &error)) << error; in TEST_F()
102 std::string json = in TEST_F() local
109 auto object = JsonStringToMessage<NoJsonName>(json); in TEST_F()
118 EXPECT_TRUE(AllFieldsAreKnown(*object, json, &error)) << error; in TEST_F()
147 ErrorOr<Parent> TestEmbeddedError(const std::string& json, const std::string& unknown_key) { in TestEmbeddedError() argument
148 auto object = JsonStringToMessage<Parent>(json); in TestEmbeddedError()
151 EXPECT_FALSE(AllFieldsAreKnown(*object, json, &error)) in TestEmbeddedError()
160 std::string json = in TEST_F() local
167 auto object = JsonStringToMessage<Parent>(json); in TEST_F()
178 EXPECT_TRUE(AllFieldsAreKnown(*object, json, &error)) << error; in TEST_F()
230 bool EqReformattedJson(const std::string& json, std::string* error) { in EqReformattedJson() argument
231 return android::jsonpb::EqReformattedJson(json, &scalar_, error); in EqReformattedJson()
239 std::string json = in TEST_F() local
249 auto formatted = FormatJson(json, &scalar_); in TEST_F()
251 EXPECT_TRUE(IsJsonEq(json, *formatted)); in TEST_F()
253 EXPECT_TRUE(EqReformattedJson(json, &error_)) << error_; in TEST_F()
261 std::string json; in TEST_P() local
263 std::tie(json, message) = GetParam(); in TEST_P()
264 auto formatted = FormatJson(json, &scalar_); in TEST_P()
266 EXPECT_FALSE(IsJsonEq(json, *formatted)) << message; in TEST_P()
267 EXPECT_FALSE(EqReformattedJson(json, &error_)) << "EqReformattedJson should return false"; in TEST_P()