aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core/json
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2017-11-10 14:14:17 -0800
committerGravatar Craig Tiller <ctiller@google.com>2017-11-10 14:14:17 -0800
commit4ac2b8e585cbf7064f9bdde4eabaf8ff42801142 (patch)
tree5379629b43d287972916a87637a26251c1b0de5f /test/core/json
parente77b3c36d1b3e2033abd19d553748b678c22253f (diff)
Enable clang-tidy as a sanity check, fix up all known failures
Diffstat (limited to 'test/core/json')
-rw-r--r--test/core/json/json_rewrite.cc8
-rw-r--r--test/core/json/json_rewrite_test.cc4
-rw-r--r--test/core/json/json_stream_error_test.cc6
-rw-r--r--test/core/json/json_test.cc104
4 files changed, 61 insertions, 61 deletions
diff --git a/test/core/json/json_rewrite.cc b/test/core/json/json_rewrite.cc
index 98e76e9772..6891a57f9f 100644
--- a/test/core/json/json_rewrite.cc
+++ b/test/core/json/json_rewrite.cc
@@ -205,8 +205,8 @@ int rewrite(FILE* in, FILE* out, int indent) {
reader_user.writer = &writer;
reader_user.in = in;
- reader_user.top = NULL;
- reader_user.scratchpad = NULL;
+ reader_user.top = nullptr;
+ reader_user.scratchpad = nullptr;
reader_user.string_len = 0;
reader_user.free_space = 0;
reader_user.allocated = 0;
@@ -232,8 +232,8 @@ int main(int argc, char** argv) {
int indent = 2;
gpr_cmdline* cl;
- cl = gpr_cmdline_create(NULL);
- gpr_cmdline_add_int(cl, "indent", NULL, &indent);
+ cl = gpr_cmdline_create(nullptr);
+ gpr_cmdline_add_int(cl, "indent", nullptr, &indent);
gpr_cmdline_parse(cl, argc, argv);
gpr_cmdline_destroy(cl);
diff --git a/test/core/json/json_rewrite_test.cc b/test/core/json/json_rewrite_test.cc
index 47b4f01e8b..3104afc442 100644
--- a/test/core/json/json_rewrite_test.cc
+++ b/test/core/json/json_rewrite_test.cc
@@ -226,8 +226,8 @@ int rewrite_and_compare(FILE* in, FILE* cmp, int indent) {
reader_user.writer = &writer;
reader_user.in = in;
- reader_user.top = NULL;
- reader_user.scratchpad = NULL;
+ reader_user.top = nullptr;
+ reader_user.scratchpad = nullptr;
reader_user.string_len = 0;
reader_user.free_space = 0;
reader_user.allocated = 0;
diff --git a/test/core/json/json_stream_error_test.cc b/test/core/json/json_stream_error_test.cc
index 975ccd2b42..70b00c77f9 100644
--- a/test/core/json/json_stream_error_test.cc
+++ b/test/core/json/json_stream_error_test.cc
@@ -37,13 +37,13 @@ static void string_clear(void* userdata) {
static uint32_t read_char(void* userdata) { return GRPC_JSON_READ_CHAR_ERROR; }
static grpc_json_reader_vtable reader_vtable = {
- string_clear, NULL, NULL, read_char, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL};
+ string_clear, nullptr, nullptr, read_char, nullptr, nullptr,
+ nullptr, nullptr, nullptr, nullptr, nullptr, nullptr};
static void read_error() {
grpc_json_reader reader;
grpc_json_reader_status status;
- grpc_json_reader_init(&reader, &reader_vtable, NULL);
+ grpc_json_reader_init(&reader, &reader_vtable, nullptr);
status = grpc_json_reader_run(&reader);
GPR_ASSERT(status == GRPC_JSON_READ_ERROR);
diff --git a/test/core/json/json_test.cc b/test/core/json/json_test.cc
index 9e4d351dd7..18b9c55ee7 100644
--- a/test/core/json/json_test.cc
+++ b/test/core/json/json_test.cc
@@ -70,70 +70,70 @@ static testing_pair testing_pairs[] = {
/* Testing invalid parsing. */
/* 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},
+ {"\\", nullptr},
+ {"nu ll", nullptr},
+ {"{\"foo\": bar}", nullptr},
+ {"{\"foo\": bar\"x\"}", nullptr},
+ {"fals", nullptr},
+ {"0,0 ", nullptr},
+ {"\"foo\",[]", nullptr},
/* Testing unterminated string. */
- {"\"\\x", NULL},
+ {"\"\\x", nullptr},
/* Testing invalid UTF-16 number. */
- {"\"\\u123x", NULL},
- {"{\"\\u123x", NULL},
+ {"\"\\u123x", nullptr},
+ {"{\"\\u123x", nullptr},
/* 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},
+ {"\"\\ud834f", nullptr},
+ {"{\"\\ud834f\":0}", nullptr},
+ {"\"\\ud834\\n", nullptr},
+ {"{\"\\ud834\\n\":0}", nullptr},
+ {"\"\\udd1ef", nullptr},
+ {"{\"\\udd1ef\":0}", nullptr},
+ {"\"\\ud834\\ud834\"", nullptr},
+ {"{\"\\ud834\\ud834\"\":0}", nullptr},
+ {"\"\\ud834\\u1234\"", nullptr},
+ {"{\"\\ud834\\u1234\"\":0}", nullptr},
+ {"\"\\ud834]\"", nullptr},
+ {"{\"\\ud834]\"\":0}", nullptr},
+ {"\"\\ud834 \"", nullptr},
+ {"{\"\\ud834 \"\":0}", nullptr},
+ {"\"\\ud834\\\\\"", nullptr},
+ {"{\"\\ud834\\\\\"\":0}", nullptr},
/* Testing embedded invalid whitechars. */
- {"\"\n\"", NULL},
- {"\"\t\"", NULL},
+ {"\"\n\"", nullptr},
+ {"\"\t\"", nullptr},
/* Testing empty json data. */
- {"", NULL},
+ {"", nullptr},
/* Testing extra characters after end of parsing. */
- {"{},", NULL},
+ {"{},", nullptr},
/* Testing imbalanced containers. */
- {"{}}", NULL},
- {"[]]", NULL},
- {"{{}", NULL},
- {"[[]", NULL},
- {"[}", NULL},
- {"{]", NULL},
+ {"{}}", nullptr},
+ {"[]]", nullptr},
+ {"{{}", nullptr},
+ {"[[]", nullptr},
+ {"[}", nullptr},
+ {"{]", nullptr},
/* Testing bad containers. */
- {"{x}", NULL},
- {"{x=0,y}", NULL},
+ {"{x}", nullptr},
+ {"{x=0,y}", nullptr},
/* Testing trailing comma. */
- {"{,}", NULL},
- {"[1,2,3,4,]", NULL},
- {"{\"a\": 1, }", NULL},
+ {"{,}", nullptr},
+ {"[1,2,3,4,]", nullptr},
+ {"{\"a\": 1, }", nullptr},
/* Testing after-ending characters. */
- {"{}x", NULL},
+ {"{}x", nullptr},
/* Testing having a key syntax in an array. */
- {"[\"x\":0]", NULL},
+ {"[\"x\":0]", nullptr},
/* Testing invalid numbers. */
- {"1.", NULL},
- {"1e", NULL},
- {".12", NULL},
- {"1.x", NULL},
- {"1.12x", NULL},
- {"1ex", NULL},
- {"1e12x", NULL},
- {".12x", NULL},
- {"000", NULL},
+ {"1.", nullptr},
+ {"1e", nullptr},
+ {".12", nullptr},
+ {"1.x", nullptr},
+ {"1.12x", nullptr},
+ {"1ex", nullptr},
+ {"1e12x", nullptr},
+ {".12x", nullptr},
+ {"000", nullptr},
};
static void test_pairs() {