aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core/json/json_test.c
diff options
context:
space:
mode:
authorGravatar Nicolas "Pixel" Noble <pixel@nobis-crew.org>2016-04-05 00:30:40 +0200
committerGravatar Nicolas "Pixel" Noble <pixel@nobis-crew.org>2016-04-05 00:30:40 +0200
commit6415043781e0b73008b3db539f18354fe776241a (patch)
tree78fc8db5eb33ac5cdea96b0a743a57c02e9b0109 /test/core/json/json_test.c
parent1bb17d31cd00d70048c51c99ed5a827ea10389e6 (diff)
parent1b7c0a2c5cf27d7a77d9c3476fe6406a98ca3d76 (diff)
Merge branch 'master' of https://github.com/grpc/grpc into gpr_malloc_is_all
Diffstat (limited to 'test/core/json/json_test.c')
-rw-r--r--test/core/json/json_test.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/test/core/json/json_test.c b/test/core/json/json_test.c
index 2a007627f3..ac1abbd8f3 100644
--- a/test/core/json/json_test.c
+++ b/test/core/json/json_test.c
@@ -1,6 +1,6 @@
/*
*
- * Copyright 2015-2016, Google Inc.
+ * Copyright 2015, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -64,6 +64,7 @@ static testing_pair testing_pairs[] = {
/* Testing UTF-8 character "𝄞", U+11D1E. */
{"\"\xf0\x9d\x84\x9e\"", "\"\\ud834\\udd1e\""},
{"\"\\ud834\\udd1e\"", "\"\\ud834\\udd1e\""},
+ {"{\"\\ud834\\udd1e\":0}", "{\"\\ud834\\udd1e\":0}"},
/* Testing nested empty containers. */
{
" [ [ ] , { } , [ ] ] ", "[[],{},[]]",
@@ -85,20 +86,33 @@ static testing_pair testing_pairs[] = {
/* Testing plain invalid things, exercising the state machine. */
{"\\", NULL},
{"nu ll", NULL},
+ {"{\"foo\": bar}", NULL},
+ {"{\"foo\": bar\"x\"}", NULL},
{"fals", NULL},
+ {"0,0 ", NULL},
+ {"\"foo\",[]", NULL},
/* Testing unterminated string. */
{"\"\\x", NULL},
/* Testing invalid UTF-16 number. */
{"\"\\u123x", NULL},
+ {"{\"\\u123x", NULL},
/* Testing imbalanced surrogate pairs. */
{"\"\\ud834f", NULL},
+ {"{\"\\ud834f\":0}", NULL},
{"\"\\ud834\\n", NULL},
+ {"{\"\\ud834\\n\":0}", NULL},
{"\"\\udd1ef", NULL},
+ {"{\"\\udd1ef\":0}", NULL},
{"\"\\ud834\\ud834\"", NULL},
+ {"{\"\\ud834\\ud834\"\":0}", NULL},
{"\"\\ud834\\u1234\"", NULL},
+ {"{\"\\ud834\\u1234\"\":0}", NULL},
{"\"\\ud834]\"", NULL},
+ {"{\"\\ud834]\"\":0}", NULL},
{"\"\\ud834 \"", NULL},
+ {"{\"\\ud834 \"\":0}", NULL},
{"\"\\ud834\\\\\"", NULL},
+ {"{\"\\ud834\\\\\"\":0}", NULL},
/* Testing embedded invalid whitechars. */
{"\"\n\"", NULL},
{"\"\t\"", NULL},