Commit df6088a7 authored by mike07026's avatar mike07026 Committed by GitHub

detect invaild JSON encoding in bytes field

parent 5a17660c
...@@ -133,29 +133,29 @@ TEST_F(JsonUtilTest, TestDefaultValues) { ...@@ -133,29 +133,29 @@ TEST_F(JsonUtilTest, TestDefaultValues) {
m.set_string_value("i am a test string value"); m.set_string_value("i am a test string value");
m.set_bytes_value("i am a test bytes value"); m.set_bytes_value("i am a test bytes value");
EXPECT_EQ( EXPECT_EQ(
"{\"boolValue\":false," "{\"boolValue\":false,"
"\"int32Value\":0," "\"int32Value\":0,"
"\"int64Value\":\"0\"," "\"int64Value\":\"0\","
"\"uint32Value\":0," "\"uint32Value\":0,"
"\"uint64Value\":\"0\"," "\"uint64Value\":\"0\","
"\"floatValue\":0," "\"floatValue\":0,"
"\"doubleValue\":0," "\"doubleValue\":0,"
"\"stringValue\":\"i am a test string value\"," "\"stringValue\":\"i am a test string value\","
"\"bytesValue\":\"aSBhbSBhIHRlc3QgYnl0ZXMgdmFsdWU=\"," "\"bytesValue\":\"aSBhbSBhIHRlc3QgYnl0ZXMgdmFsdWU=\","
"\"enumValue\":\"FOO\"," "\"enumValue\":\"FOO\","
"\"repeatedBoolValue\":[]," "\"repeatedBoolValue\":[],"
"\"repeatedInt32Value\":[]," "\"repeatedInt32Value\":[],"
"\"repeatedInt64Value\":[]," "\"repeatedInt64Value\":[],"
"\"repeatedUint32Value\":[]," "\"repeatedUint32Value\":[],"
"\"repeatedUint64Value\":[]," "\"repeatedUint64Value\":[],"
"\"repeatedFloatValue\":[]," "\"repeatedFloatValue\":[],"
"\"repeatedDoubleValue\":[]," "\"repeatedDoubleValue\":[],"
"\"repeatedStringValue\":[]," "\"repeatedStringValue\":[],"
"\"repeatedBytesValue\":[]," "\"repeatedBytesValue\":[],"
"\"repeatedEnumValue\":[]," "\"repeatedEnumValue\":[],"
"\"repeatedMessageValue\":[]" "\"repeatedMessageValue\":[]"
"}", "}",
ToJson(m, options)); ToJson(m, options));
} }
TEST_F(JsonUtilTest, ParseMessage) { TEST_F(JsonUtilTest, ParseMessage) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment