From df6088a7e82b3615054d0ec6af3ff3e3e793d6cd Mon Sep 17 00:00:00 2001 From: mike07026 <121458737@qq.com> Date: Thu, 1 Sep 2016 20:08:45 +0800 Subject: detect invaild JSON encoding in bytes field --- src/google/protobuf/util/json_util_test.cc | 46 +++++++++++++++--------------- 1 file changed, 23 insertions(+), 23 deletions(-) (limited to 'src/google/protobuf/util/json_util_test.cc') diff --git a/src/google/protobuf/util/json_util_test.cc b/src/google/protobuf/util/json_util_test.cc index 7d394240..24ff5fd6 100644 --- a/src/google/protobuf/util/json_util_test.cc +++ b/src/google/protobuf/util/json_util_test.cc @@ -133,29 +133,29 @@ TEST_F(JsonUtilTest, TestDefaultValues) { m.set_string_value("i am a test string value"); m.set_bytes_value("i am a test bytes value"); EXPECT_EQ( - "{\"boolValue\":false," - "\"int32Value\":0," - "\"int64Value\":\"0\"," - "\"uint32Value\":0," - "\"uint64Value\":\"0\"," - "\"floatValue\":0," - "\"doubleValue\":0," - "\"stringValue\":\"i am a test string value\"," - "\"bytesValue\":\"aSBhbSBhIHRlc3QgYnl0ZXMgdmFsdWU=\"," - "\"enumValue\":\"FOO\"," - "\"repeatedBoolValue\":[]," - "\"repeatedInt32Value\":[]," - "\"repeatedInt64Value\":[]," - "\"repeatedUint32Value\":[]," - "\"repeatedUint64Value\":[]," - "\"repeatedFloatValue\":[]," - "\"repeatedDoubleValue\":[]," - "\"repeatedStringValue\":[]," - "\"repeatedBytesValue\":[]," - "\"repeatedEnumValue\":[]," - "\"repeatedMessageValue\":[]" - "}", - ToJson(m, options)); + "{\"boolValue\":false," + "\"int32Value\":0," + "\"int64Value\":\"0\"," + "\"uint32Value\":0," + "\"uint64Value\":\"0\"," + "\"floatValue\":0," + "\"doubleValue\":0," + "\"stringValue\":\"i am a test string value\"," + "\"bytesValue\":\"aSBhbSBhIHRlc3QgYnl0ZXMgdmFsdWU=\"," + "\"enumValue\":\"FOO\"," + "\"repeatedBoolValue\":[]," + "\"repeatedInt32Value\":[]," + "\"repeatedInt64Value\":[]," + "\"repeatedUint32Value\":[]," + "\"repeatedUint64Value\":[]," + "\"repeatedFloatValue\":[]," + "\"repeatedDoubleValue\":[]," + "\"repeatedStringValue\":[]," + "\"repeatedBytesValue\":[]," + "\"repeatedEnumValue\":[]," + "\"repeatedMessageValue\":[]" + "}", + ToJson(m, options)); } TEST_F(JsonUtilTest, ParseMessage) { -- cgit v1.2.3