From 8c593e2e1c4a657191db162a62c66025d67a3f0a Mon Sep 17 00:00:00 2001 From: "Nicolas \"Pixel\" Noble" Date: Fri, 11 Dec 2015 02:20:06 +0100 Subject: [PATCH] Improving test coverage for json.c (-->100%) --- test/core/json/json_test.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/core/json/json_test.c b/test/core/json/json_test.c index 15019913da3..f16494edf61 100644 --- a/test/core/json/json_test.c +++ b/test/core/json/json_test.c @@ -160,7 +160,7 @@ static void test_pairs() { } static void test_atypical() { - char *scratchpad = gpr_strdup("[[],[]]"); + char *scratchpad = gpr_strdup("[[],[],[]]"); grpc_json *json = grpc_json_parse_string(scratchpad); grpc_json *brother; @@ -168,7 +168,8 @@ static void test_atypical() { GPR_ASSERT(json->child); brother = json->child->next; grpc_json_destroy(json->child); - json->child = brother; + GPR_ASSERT(json->child == brother); + grpc_json_destroy(json->child->next); grpc_json_destroy(json); gpr_free(scratchpad); }