From bc745a5f4e30590cdcba1c600b51e4e9d38ad360 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Mon, 15 Jun 2015 18:29:23 -0700 Subject: [PATCH 1/2] fix json_rewrite_test CRLF handling --- test/core/json/json_rewrite_test.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/core/json/json_rewrite_test.c b/test/core/json/json_rewrite_test.c index ec6deebe76c..fa46830d5ba 100644 --- a/test/core/json/json_rewrite_test.c +++ b/test/core/json/json_rewrite_test.c @@ -64,6 +64,11 @@ typedef struct json_reader_userdata { static void json_writer_output_char(void* userdata, char c) { json_writer_userdata* state = userdata; int cmp = fgetc(state->cmp); + + /* treat CRLF as LF */ + if (cmp == '\r' && c == '\n') { + cmp = fgetc(state->cmp); + } GPR_ASSERT(cmp == c); } From d1eb527f78bbe962b02871e54c917b6c4dc984e2 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Tue, 16 Jun 2015 13:15:27 -0700 Subject: [PATCH 2/2] fix indentation --- test/core/json/json_rewrite_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/core/json/json_rewrite_test.c b/test/core/json/json_rewrite_test.c index fa46830d5ba..f5859322ea1 100644 --- a/test/core/json/json_rewrite_test.c +++ b/test/core/json/json_rewrite_test.c @@ -67,7 +67,7 @@ static void json_writer_output_char(void* userdata, char c) { /* treat CRLF as LF */ if (cmp == '\r' && c == '\n') { - cmp = fgetc(state->cmp); + cmp = fgetc(state->cmp); } GPR_ASSERT(cmp == c); }