aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core/json
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2015-09-10 16:00:22 -0700
committerGravatar Craig Tiller <ctiller@google.com>2015-09-10 16:00:22 -0700
commit6a6b36c50300bcc33d761598591c4d1bd4f1f6aa (patch)
treefa6b9eeb5d9281258b42603465fab6fdbb101512 /test/core/json
parent2ed498151da3b68107312b6397dbff4b4f60e475 (diff)
Enable -Wconversion
Diffstat (limited to 'test/core/json')
-rw-r--r--test/core/json/json_rewrite.c6
-rw-r--r--test/core/json/json_rewrite_test.c3
2 files changed, 6 insertions, 3 deletions
diff --git a/test/core/json/json_rewrite.c b/test/core/json/json_rewrite.c
index 561bf487b9..82cc4090f3 100644
--- a/test/core/json/json_rewrite.c
+++ b/test/core/json/json_rewrite.c
@@ -34,8 +34,9 @@
#include <stdio.h>
#include <stdlib.h>
-#include <grpc/support/cmdline.h>
#include <grpc/support/alloc.h>
+#include <grpc/support/cmdline.h>
+#include <grpc/support/log.h>
#include "src/core/json/json_reader.h"
#include "src/core/json/json_writer.h"
@@ -96,7 +97,8 @@ static void json_reader_string_clear(void* userdata) {
static void json_reader_string_add_char(void* userdata, gpr_uint32 c) {
json_reader_userdata* state = userdata;
check_string(state, 1);
- state->scratchpad[state->string_len++] = c;
+ GPR_ASSERT(c < 256);
+ state->scratchpad[state->string_len++] = (char)c;
}
static void json_reader_string_add_utf32(void* userdata, gpr_uint32 c) {
diff --git a/test/core/json/json_rewrite_test.c b/test/core/json/json_rewrite_test.c
index 7cf184950e..d26ef53b2d 100644
--- a/test/core/json/json_rewrite_test.c
+++ b/test/core/json/json_rewrite_test.c
@@ -108,7 +108,8 @@ static void json_reader_string_clear(void* userdata) {
static void json_reader_string_add_char(void* userdata, gpr_uint32 c) {
json_reader_userdata* state = userdata;
check_string(state, 1);
- state->scratchpad[state->string_len++] = c;
+ GPR_ASSERT(c <= 256);
+ state->scratchpad[state->string_len++] = (char)c;
}
static void json_reader_string_add_utf32(void* userdata, gpr_uint32 c) {