diff options
Diffstat (limited to 'test/core/json/json_test.c')
-rw-r--r-- | test/core/json/json_test.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/test/core/json/json_test.c b/test/core/json/json_test.c index bbc6f7a4e6..9e4d351dd7 100644 --- a/test/core/json/json_test.c +++ b/test/core/json/json_test.c @@ -28,8 +28,8 @@ #include "test/core/util/test_config.h" typedef struct testing_pair { - const char *input; - const char *output; + const char* input; + const char* output; } testing_pair; static testing_pair testing_pairs[] = { @@ -52,7 +52,8 @@ static testing_pair testing_pairs[] = { {"{\"\\ud834\\udd1e\":0}", "{\"\\ud834\\udd1e\":0}"}, /* Testing nested empty containers. */ { - " [ [ ] , { } , [ ] ] ", "[[],{},[]]", + " [ [ ] , { } , [ ] ] ", + "[[],{},[]]", }, /* Testing escapes and control chars in key strings. */ {" { \"\\u007f\x7f\\n\\r\\\"\\f\\b\\\\a , b\": 1, \"\": 0 } ", @@ -139,16 +140,16 @@ static void test_pairs() { unsigned i; for (i = 0; i < GPR_ARRAY_SIZE(testing_pairs); i++) { - testing_pair *pair = testing_pairs + i; - char *scratchpad = gpr_strdup(pair->input); - grpc_json *json; + testing_pair* pair = testing_pairs + i; + char* scratchpad = gpr_strdup(pair->input); + grpc_json* json; gpr_log(GPR_INFO, "parsing string %i - should %s", i, pair->output ? "succeed" : "fail"); json = grpc_json_parse_string(scratchpad); if (pair->output) { - char *output; + char* output; GPR_ASSERT(json); output = grpc_json_dump_to_string(json, 0); @@ -168,9 +169,9 @@ static void test_pairs() { } static void test_atypical() { - char *scratchpad = gpr_strdup("[[],[],[]]"); - grpc_json *json = grpc_json_parse_string(scratchpad); - grpc_json *brother; + char* scratchpad = gpr_strdup("[[],[],[]]"); + grpc_json* json = grpc_json_parse_string(scratchpad); + grpc_json* brother; GPR_ASSERT(json); GPR_ASSERT(json->child); @@ -182,7 +183,7 @@ static void test_atypical() { gpr_free(scratchpad); } -int main(int argc, char **argv) { +int main(int argc, char** argv) { grpc_test_init(argc, argv); test_pairs(); test_atypical(); |