diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/core/channel/channel_tracer_test.cc | 15 | ||||
-rw-r--r-- | test/core/util/channel_tracing_utils.cc | 13 |
2 files changed, 15 insertions, 13 deletions
diff --git a/test/core/channel/channel_tracer_test.cc b/test/core/channel/channel_tracer_test.cc index 47bb4302de..4f1ce160a1 100644 --- a/test/core/channel/channel_tracer_test.cc +++ b/test/core/channel/channel_tracer_test.cc @@ -30,9 +30,10 @@ #include "test/core/util/test_config.h" static void add_simple_trace(grpc_channel_tracer* tracer) { - grpc_channel_tracer_add_trace( - tracer, grpc_slice_from_static_string("simple trace"), - GRPC_ERROR_CREATE_FROM_STATIC_STRING("Error"), GRPC_CHANNEL_READY, NULL); + grpc_channel_tracer_add_trace(tracer, + grpc_slice_from_static_string("simple trace"), + GRPC_ERROR_CREATE_FROM_STATIC_STRING("Error"), + GRPC_CHANNEL_READY, nullptr); } // checks for the existence of all the required members of the tracer. @@ -66,10 +67,10 @@ static void test_basic_channel_tracing(size_t max_nodes) { tracer, grpc_slice_from_static_string("trace three"), grpc_error_set_int(GRPC_ERROR_CREATE_FROM_STATIC_STRING("Error"), GRPC_ERROR_INT_HTTP2_ERROR, 2), - GRPC_CHANNEL_IDLE, NULL); - grpc_channel_tracer_add_trace(tracer, - grpc_slice_from_static_string("trace four"), - GRPC_ERROR_NONE, GRPC_CHANNEL_SHUTDOWN, NULL); + GRPC_CHANNEL_IDLE, nullptr); + grpc_channel_tracer_add_trace( + tracer, grpc_slice_from_static_string("trace four"), GRPC_ERROR_NONE, + GRPC_CHANNEL_SHUTDOWN, nullptr); validate_tracer(tracer, 4, max_nodes); add_simple_trace(tracer); add_simple_trace(tracer); diff --git a/test/core/util/channel_tracing_utils.cc b/test/core/util/channel_tracing_utils.cc index 805726ff16..5644d1811d 100644 --- a/test/core/util/channel_tracing_utils.cc +++ b/test/core/util/channel_tracing_utils.cc @@ -25,11 +25,12 @@ #include "src/core/lib/json/json.h" static grpc_json* get_json_child(grpc_json* parent, const char* key) { - GPR_ASSERT(parent != NULL); - for (grpc_json* child = parent->child; child != NULL; child = child->next) { - if (child->key != NULL && strcmp(child->key, key) == 0) return child; + GPR_ASSERT(parent != nullptr); + for (grpc_json* child = parent->child; child != nullptr; + child = child->next) { + if (child->key != nullptr && strcmp(child->key, key) == 0) return child; } - return NULL; + return nullptr; } void validate_json_array_size(grpc_json* json, const char* key, @@ -38,7 +39,7 @@ void validate_json_array_size(grpc_json* json, const char* key, GPR_ASSERT(arr); GPR_ASSERT(arr->type == GRPC_JSON_ARRAY); size_t count = 0; - for (grpc_json* child = arr->child; child != NULL; child = child->next) { + for (grpc_json* child = arr->child; child != nullptr; child = child->next) { ++count; } GPR_ASSERT(count == expected_size); @@ -54,7 +55,7 @@ void validate_channel_data(grpc_json* json, size_t num_nodes_logged_expected, grpc_json* start_time = get_json_child(channel_data, "startTime"); GPR_ASSERT(start_time); size_t num_nodes_logged = - (size_t)strtol(num_nodes_logged_json->value, NULL, 0); + (size_t)strtol(num_nodes_logged_json->value, nullptr, 0); GPR_ASSERT(num_nodes_logged == num_nodes_logged_expected); validate_json_array_size(channel_data, "nodes", actual_num_nodes_expected); } |