aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/google/protobuf/util
diff options
context:
space:
mode:
authorGravatar Feng Xiao <xfxyjwf@gmail.com>2016-09-23 23:51:07 +0000
committerGravatar Bo Yang <teboring@google.com>2016-10-10 11:44:21 -0700
commit39685f67d7223ce608240d75fd2c9d95e079a576 (patch)
tree74b9716fb149b9a9e36fbcfd11378cfcb68fe064 /src/google/protobuf/util
parent2937c67429377e6c004387ec7abf8480ce668c0e (diff)
Fix VS test failures.
Diffstat (limited to 'src/google/protobuf/util')
-rw-r--r--src/google/protobuf/util/internal/json_stream_parser_test.cc22
1 files changed, 16 insertions, 6 deletions
diff --git a/src/google/protobuf/util/internal/json_stream_parser_test.cc b/src/google/protobuf/util/internal/json_stream_parser_test.cc
index d162667a..945fc6ca 100644
--- a/src/google/protobuf/util/internal/json_stream_parser_test.cc
+++ b/src/google/protobuf/util/internal/json_stream_parser_test.cc
@@ -315,18 +315,28 @@ TEST_F(JsonStreamParserTest, ObjectKeyTypes) {
}
}
-// - array containing array, object, values (true, false, null, num, string)
-TEST_F(JsonStreamParserTest, ArrayValues) {
+// - array containing primitive values (true, false, null, num, string)
+TEST_F(JsonStreamParserTest, ArrayPrimitiveValues) {
StringPiece str =
- "[true, false, null, 'a', \"an\", [22, -127, 45.3, "
- "-1056.4, 11779497823553162765], {'key': true}]";
+ "[true, false, null, 'one', \"two\"]";
for (int i = 0; i <= str.length(); ++i) {
ow_.StartList("")
->RenderBool("", true)
->RenderBool("", false)
->RenderNull("")
- ->RenderString("", "a")
- ->RenderString("", "an")
+ ->RenderString("", "one")
+ ->RenderString("", "two")
+ ->EndList();
+ DoTest(str, i);
+ }
+}
+
+// - array containing array, object
+TEST_F(JsonStreamParserTest, ArrayComplexValues) {
+ StringPiece str =
+ "[[22, -127, 45.3, -1056.4, 11779497823553162765], {'key': true}]";
+ for (int i = 0; i <= str.length(); ++i) {
+ ow_.StartList("")
->StartList("")
->RenderUint64("", 22)
->RenderInt64("", -127)