diff options
author | Craig Tiller <ctiller@google.com> | 2017-11-10 14:14:17 -0800 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2017-11-10 14:14:17 -0800 |
commit | 4ac2b8e585cbf7064f9bdde4eabaf8ff42801142 (patch) | |
tree | 5379629b43d287972916a87637a26251c1b0de5f /test/core/transport | |
parent | e77b3c36d1b3e2033abd19d553748b678c22253f (diff) |
Enable clang-tidy as a sanity check, fix up all known failures
Diffstat (limited to 'test/core/transport')
-rw-r--r-- | test/core/transport/byte_stream_test.cc | 10 | ||||
-rw-r--r-- | test/core/transport/chttp2/hpack_encoder_test.cc | 14 | ||||
-rw-r--r-- | test/core/transport/chttp2/hpack_parser_test.cc | 2 | ||||
-rw-r--r-- | test/core/transport/chttp2/stream_map_test.cc | 26 | ||||
-rw-r--r-- | test/core/transport/connectivity_state_test.cc | 2 | ||||
-rw-r--r-- | test/core/transport/stream_owned_slice_test.cc | 2 |
6 files changed, 28 insertions, 28 deletions
diff --git a/test/core/transport/byte_stream_test.cc b/test/core/transport/byte_stream_test.cc index e62a697284..0e34fd7651 100644 --- a/test/core/transport/byte_stream_test.cc +++ b/test/core/transport/byte_stream_test.cc @@ -53,7 +53,7 @@ static void test_slice_buffer_stream_basic(void) { grpc_slice_buffer_stream_init(&stream, &buffer, 0); GPR_ASSERT(stream.base.length == 6); grpc_closure closure; - GRPC_CLOSURE_INIT(&closure, not_called_closure, NULL, + GRPC_CLOSURE_INIT(&closure, not_called_closure, nullptr, grpc_schedule_on_exec_ctx); // Read each slice. Note that next() always returns synchronously. for (size_t i = 0; i < GPR_ARRAY_SIZE(input); ++i) { @@ -89,7 +89,7 @@ static void test_slice_buffer_stream_shutdown(void) { grpc_slice_buffer_stream_init(&stream, &buffer, 0); GPR_ASSERT(stream.base.length == 6); grpc_closure closure; - GRPC_CLOSURE_INIT(&closure, not_called_closure, NULL, + GRPC_CLOSURE_INIT(&closure, not_called_closure, nullptr, grpc_schedule_on_exec_ctx); // Read the first slice. GPR_ASSERT( @@ -142,7 +142,7 @@ static void test_caching_byte_stream_basic(void) { grpc_caching_byte_stream stream; grpc_caching_byte_stream_init(&stream, &cache); grpc_closure closure; - GRPC_CLOSURE_INIT(&closure, not_called_closure, NULL, + GRPC_CLOSURE_INIT(&closure, not_called_closure, nullptr, grpc_schedule_on_exec_ctx); // Read each slice. Note that next() always returns synchronously, // because the underlying byte stream always does. @@ -183,7 +183,7 @@ static void test_caching_byte_stream_reset(void) { grpc_caching_byte_stream stream; grpc_caching_byte_stream_init(&stream, &cache); grpc_closure closure; - GRPC_CLOSURE_INIT(&closure, not_called_closure, NULL, + GRPC_CLOSURE_INIT(&closure, not_called_closure, nullptr, grpc_schedule_on_exec_ctx); // Read one slice. GPR_ASSERT( @@ -234,7 +234,7 @@ static void test_caching_byte_stream_shared_cache(void) { grpc_caching_byte_stream stream2; grpc_caching_byte_stream_init(&stream2, &cache); grpc_closure closure; - GRPC_CLOSURE_INIT(&closure, not_called_closure, NULL, + GRPC_CLOSURE_INIT(&closure, not_called_closure, nullptr, grpc_schedule_on_exec_ctx); // Read one slice from stream1. GPR_ASSERT( diff --git a/test/core/transport/chttp2/hpack_encoder_test.cc b/test/core/transport/chttp2/hpack_encoder_test.cc index a7e44abc2b..2d18b72504 100644 --- a/test/core/transport/chttp2/hpack_encoder_test.cc +++ b/test/core/transport/chttp2/hpack_encoder_test.cc @@ -39,7 +39,7 @@ grpc_chttp2_hpack_compressor g_compressor; int g_failure = 0; -void** to_delete = NULL; +void** to_delete = nullptr; size_t num_to_delete = 0; size_t cap_to_delete = 0; @@ -80,8 +80,8 @@ static void verify(grpc_exec_ctx* exec_ctx, const verify_params params, exec_ctx, grpc_slice_intern(grpc_slice_from_static_string(key)), value_slice); } - e[0].prev = NULL; - e[nheaders - 1].next = NULL; + e[0].prev = nullptr; + e[nheaders - 1].next = nullptr; va_end(l); b.list.head = &e[0]; @@ -106,7 +106,7 @@ static void verify(grpc_exec_ctx* exec_ctx, const verify_params params, 16384, /* max_frame_size */ &stats /* stats */ }; - grpc_chttp2_encode_header(exec_ctx, &g_compressor, NULL, 0, &b, &hopt, + grpc_chttp2_encode_header(exec_ctx, &g_compressor, nullptr, 0, &b, &hopt, &output); merged = grpc_slice_merge(output.slices, output.count); grpc_slice_buffer_destroy_internal(exec_ctx, &output); @@ -220,8 +220,8 @@ static void verify_table_size_change_match_elem_size(grpc_exec_ctx* exec_ctx, grpc_metadata_batch b; grpc_metadata_batch_init(&b); e[0].md = elem; - e[0].prev = NULL; - e[0].next = NULL; + e[0].prev = nullptr; + e[0].next = nullptr; b.list.head = &e[0]; b.list.tail = &e[0]; b.list.count = 1; @@ -235,7 +235,7 @@ static void verify_table_size_change_match_elem_size(grpc_exec_ctx* exec_ctx, use_true_binary, /* use_true_binary_metadata */ 16384, /* max_frame_size */ &stats /* stats */}; - grpc_chttp2_encode_header(exec_ctx, &g_compressor, NULL, 0, &b, &hopt, + grpc_chttp2_encode_header(exec_ctx, &g_compressor, nullptr, 0, &b, &hopt, &output); grpc_slice_buffer_destroy_internal(exec_ctx, &output); grpc_metadata_batch_destroy(exec_ctx, &b); diff --git a/test/core/transport/chttp2/hpack_parser_test.cc b/test/core/transport/chttp2/hpack_parser_test.cc index 434b46eb2e..82fb20aced 100644 --- a/test/core/transport/chttp2/hpack_parser_test.cc +++ b/test/core/transport/chttp2/hpack_parser_test.cc @@ -73,7 +73,7 @@ static void test_vector(grpc_chttp2_hpack_parser* parser, } gpr_free(slices); - GPR_ASSERT(NULL == va_arg(chk.args, char*)); + GPR_ASSERT(nullptr == va_arg(chk.args, char*)); va_end(chk.args); } diff --git a/test/core/transport/chttp2/stream_map_test.cc b/test/core/transport/chttp2/stream_map_test.cc index 23a7b3f4c2..9b21cb2364 100644 --- a/test/core/transport/chttp2/stream_map_test.cc +++ b/test/core/transport/chttp2/stream_map_test.cc @@ -39,7 +39,7 @@ static void test_empty_find(void) { LOG_TEST("test_empty_find"); grpc_chttp2_stream_map_init(&map, 8); - GPR_ASSERT(NULL == grpc_chttp2_stream_map_find(&map, 39128)); + GPR_ASSERT(nullptr == grpc_chttp2_stream_map_find(&map, 39128)); grpc_chttp2_stream_map_destroy(&map); } @@ -56,13 +56,13 @@ static void test_double_deletion(void) { GPR_ASSERT(1 == grpc_chttp2_stream_map_size(&map)); GPR_ASSERT((void*)1 == grpc_chttp2_stream_map_delete(&map, 1)); GPR_ASSERT(0 == grpc_chttp2_stream_map_size(&map)); - GPR_ASSERT(NULL == grpc_chttp2_stream_map_find(&map, 1)); - GPR_ASSERT(NULL == grpc_chttp2_stream_map_delete(&map, 1)); - GPR_ASSERT(NULL == grpc_chttp2_stream_map_find(&map, 1)); - GPR_ASSERT(NULL == grpc_chttp2_stream_map_delete(&map, 1)); - GPR_ASSERT(NULL == grpc_chttp2_stream_map_find(&map, 1)); - GPR_ASSERT(NULL == grpc_chttp2_stream_map_delete(&map, 1)); - GPR_ASSERT(NULL == grpc_chttp2_stream_map_find(&map, 1)); + GPR_ASSERT(nullptr == grpc_chttp2_stream_map_find(&map, 1)); + GPR_ASSERT(nullptr == grpc_chttp2_stream_map_delete(&map, 1)); + GPR_ASSERT(nullptr == grpc_chttp2_stream_map_find(&map, 1)); + GPR_ASSERT(nullptr == grpc_chttp2_stream_map_delete(&map, 1)); + GPR_ASSERT(nullptr == grpc_chttp2_stream_map_find(&map, 1)); + GPR_ASSERT(nullptr == grpc_chttp2_stream_map_delete(&map, 1)); + GPR_ASSERT(nullptr == grpc_chttp2_stream_map_find(&map, 1)); grpc_chttp2_stream_map_destroy(&map); } @@ -81,8 +81,8 @@ static void test_basic_add_find(uint32_t n) { grpc_chttp2_stream_map_add(&map, i, (void*)(uintptr_t)i); } GPR_ASSERT(n == grpc_chttp2_stream_map_size(&map)); - GPR_ASSERT(NULL == grpc_chttp2_stream_map_find(&map, 0)); - GPR_ASSERT(NULL == grpc_chttp2_stream_map_find(&map, n + 1)); + GPR_ASSERT(nullptr == grpc_chttp2_stream_map_find(&map, 0)); + GPR_ASSERT(nullptr == grpc_chttp2_stream_map_find(&map, n + 1)); for (i = 1; i <= n; i++) { got = (uintptr_t)grpc_chttp2_stream_map_find(&map, i); GPR_ASSERT(i == got); @@ -103,14 +103,14 @@ static void check_delete_evens(grpc_chttp2_stream_map* map, uint32_t n) { uint32_t i; size_t got; - GPR_ASSERT(NULL == grpc_chttp2_stream_map_find(map, 0)); - GPR_ASSERT(NULL == grpc_chttp2_stream_map_find(map, n + 1)); + GPR_ASSERT(nullptr == grpc_chttp2_stream_map_find(map, 0)); + GPR_ASSERT(nullptr == grpc_chttp2_stream_map_find(map, n + 1)); for (i = 1; i <= n; i++) { if (i & 1) { got = (uintptr_t)grpc_chttp2_stream_map_find(map, i); GPR_ASSERT(i == got); } else { - GPR_ASSERT(NULL == grpc_chttp2_stream_map_find(map, i)); + GPR_ASSERT(nullptr == grpc_chttp2_stream_map_find(map, i)); } } diff --git a/test/core/transport/connectivity_state_test.cc b/test/core/transport/connectivity_state_test.cc index 8cd7b30b66..7a22ec848d 100644 --- a/test/core/transport/connectivity_state_test.cc +++ b/test/core/transport/connectivity_state_test.cc @@ -84,7 +84,7 @@ static void test_subscribe_then_unsubscribe(void) { grpc_exec_ctx_flush(&exec_ctx); GPR_ASSERT(state == GRPC_CHANNEL_IDLE); GPR_ASSERT(g_counter == 0); - grpc_connectivity_state_notify_on_state_change(&exec_ctx, &tracker, NULL, + grpc_connectivity_state_notify_on_state_change(&exec_ctx, &tracker, nullptr, closure); grpc_exec_ctx_flush(&exec_ctx); GPR_ASSERT(state == GRPC_CHANNEL_IDLE); diff --git a/test/core/transport/stream_owned_slice_test.cc b/test/core/transport/stream_owned_slice_test.cc index 0b592a0496..e82df2117d 100644 --- a/test/core/transport/stream_owned_slice_test.cc +++ b/test/core/transport/stream_owned_slice_test.cc @@ -29,7 +29,7 @@ int main(int argc, char** argv) { uint8_t buffer[] = "abc123"; grpc_stream_refcount r; - GRPC_STREAM_REF_INIT(&r, 1, do_nothing, NULL, "test"); + GRPC_STREAM_REF_INIT(&r, 1, do_nothing, nullptr, "test"); GPR_ASSERT(r.refs.count == 1); grpc_slice slice = grpc_slice_from_stream_owned_buffer(&r, buffer, sizeof(buffer)); |