diff options
author | Craig Tiller <ctiller@google.com> | 2017-11-10 15:26:57 -0800 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2017-11-10 15:26:57 -0800 |
commit | be98d248419fbb22db47e8d66b884676fdaf9238 (patch) | |
tree | 5debce1183ece30043e5f583fd704e97420eba04 /test/core/surface | |
parent | 6d0ec6b382550e196ebbcd61437c3669aa505ef4 (diff) |
clang-format after nullptr changes
Diffstat (limited to 'test/core/surface')
-rw-r--r-- | test/core/surface/alarm_test.cc | 12 | ||||
-rw-r--r-- | test/core/surface/completion_queue_test.cc | 31 | ||||
-rw-r--r-- | test/core/surface/completion_queue_threading_test.cc | 8 | ||||
-rw-r--r-- | test/core/surface/concurrent_connectivity_test.cc | 12 | ||||
-rw-r--r-- | test/core/surface/lame_client_test.cc | 7 | ||||
-rw-r--r-- | test/core/surface/num_external_connectivity_watchers_test.cc | 20 | ||||
-rw-r--r-- | test/core/surface/secure_channel_create_test.cc | 6 | ||||
-rw-r--r-- | test/core/surface/sequential_connectivity_test.cc | 10 | ||||
-rw-r--r-- | test/core/surface/server_test.cc | 12 |
9 files changed, 68 insertions, 50 deletions
diff --git a/test/core/surface/alarm_test.cc b/test/core/surface/alarm_test.cc index 6865d2add9..8950603b41 100644 --- a/test/core/surface/alarm_test.cc +++ b/test/core/surface/alarm_test.cc @@ -34,7 +34,8 @@ static void* create_test_tag(void) { static void shutdown_and_destroy(grpc_completion_queue* cc) { grpc_event ev; grpc_completion_queue_shutdown(cc); - ev = grpc_completion_queue_next(cc, gpr_inf_past(GPR_CLOCK_REALTIME), nullptr); + ev = + grpc_completion_queue_next(cc, gpr_inf_past(GPR_CLOCK_REALTIME), nullptr); GPR_ASSERT(ev.type == GRPC_QUEUE_SHUTDOWN); grpc_completion_queue_destroy(cc); } @@ -49,7 +50,8 @@ static void test_alarm(void) { grpc_event ev; void* tag = create_test_tag(); grpc_alarm* alarm = grpc_alarm_create(nullptr); - grpc_alarm_set(alarm, cc, grpc_timeout_seconds_to_deadline(1), tag, nullptr); + grpc_alarm_set(alarm, cc, grpc_timeout_seconds_to_deadline(1), tag, + nullptr); ev = grpc_completion_queue_next(cc, grpc_timeout_seconds_to_deadline(2), nullptr); @@ -63,7 +65,8 @@ static void test_alarm(void) { grpc_event ev; void* tag = create_test_tag(); grpc_alarm* alarm = grpc_alarm_create(nullptr); - grpc_alarm_set(alarm, cc, grpc_timeout_seconds_to_deadline(2), tag, nullptr); + grpc_alarm_set(alarm, cc, grpc_timeout_seconds_to_deadline(2), tag, + nullptr); grpc_alarm_cancel(alarm, nullptr); ev = grpc_completion_queue_next(cc, grpc_timeout_seconds_to_deadline(1), @@ -78,7 +81,8 @@ static void test_alarm(void) { grpc_event ev; void* tag = create_test_tag(); grpc_alarm* alarm = grpc_alarm_create(nullptr); - grpc_alarm_set(alarm, cc, grpc_timeout_seconds_to_deadline(2), tag, nullptr); + grpc_alarm_set(alarm, cc, grpc_timeout_seconds_to_deadline(2), tag, + nullptr); grpc_alarm_destroy(alarm, nullptr); ev = grpc_completion_queue_next(cc, grpc_timeout_seconds_to_deadline(1), diff --git a/test/core/surface/completion_queue_test.cc b/test/core/surface/completion_queue_test.cc index e70fe5fec1..c6e13d2386 100644 --- a/test/core/surface/completion_queue_test.cc +++ b/test/core/surface/completion_queue_test.cc @@ -44,8 +44,8 @@ static void shutdown_and_destroy(grpc_completion_queue* cc) { break; } case GRPC_CQ_PLUCK: { - ev = grpc_completion_queue_pluck(cc, create_test_tag(), - gpr_inf_past(GPR_CLOCK_REALTIME), nullptr); + ev = grpc_completion_queue_pluck( + cc, create_test_tag(), gpr_inf_past(GPR_CLOCK_REALTIME), nullptr); break; } default: { @@ -114,7 +114,8 @@ static void test_wait_empty(void) { attr.cq_polling_type = polling_types[i]; cc = grpc_completion_queue_create( grpc_completion_queue_factory_lookup(&attr), &attr, nullptr); - event = grpc_completion_queue_next(cc, gpr_now(GPR_CLOCK_REALTIME), nullptr); + event = + grpc_completion_queue_next(cc, gpr_now(GPR_CLOCK_REALTIME), nullptr); GPR_ASSERT(event.type == GRPC_QUEUE_TIMEOUT); shutdown_and_destroy(cc); } @@ -148,7 +149,8 @@ static void test_cq_end_op(void) { grpc_cq_end_op(&exec_ctx, cc, tag, GRPC_ERROR_NONE, do_nothing_end_completion, nullptr, &completion); - ev = grpc_completion_queue_next(cc, gpr_inf_past(GPR_CLOCK_REALTIME), nullptr); + ev = grpc_completion_queue_next(cc, gpr_inf_past(GPR_CLOCK_REALTIME), + nullptr); GPR_ASSERT(ev.type == GRPC_OP_COMPLETE); GPR_ASSERT(ev.tag == tag); GPR_ASSERT(ev.success); @@ -186,7 +188,8 @@ static void test_cq_tls_cache_full(void) { grpc_cq_end_op(&exec_ctx, cc, tag, GRPC_ERROR_NONE, do_nothing_end_completion, nullptr, &completion); - ev = grpc_completion_queue_next(cc, gpr_inf_past(GPR_CLOCK_REALTIME), nullptr); + ev = grpc_completion_queue_next(cc, gpr_inf_past(GPR_CLOCK_REALTIME), + nullptr); GPR_ASSERT(ev.type == GRPC_QUEUE_TIMEOUT); GPR_ASSERT( @@ -194,7 +197,8 @@ static void test_cq_tls_cache_full(void) { GPR_ASSERT(res_tag == tag); GPR_ASSERT(ok); - ev = grpc_completion_queue_next(cc, gpr_inf_past(GPR_CLOCK_REALTIME), nullptr); + ev = grpc_completion_queue_next(cc, gpr_inf_past(GPR_CLOCK_REALTIME), + nullptr); GPR_ASSERT(ev.type == GRPC_QUEUE_TIMEOUT); shutdown_and_destroy(cc); @@ -247,8 +251,8 @@ static void test_shutdown_then_next_polling(void) { cc = grpc_completion_queue_create( grpc_completion_queue_factory_lookup(&attr), &attr, nullptr); grpc_completion_queue_shutdown(cc); - event = - grpc_completion_queue_next(cc, gpr_inf_past(GPR_CLOCK_REALTIME), nullptr); + event = grpc_completion_queue_next(cc, gpr_inf_past(GPR_CLOCK_REALTIME), + nullptr); GPR_ASSERT(event.type == GRPC_QUEUE_SHUTDOWN); grpc_completion_queue_destroy(cc); } @@ -313,8 +317,8 @@ static void test_pluck(void) { } for (i = 0; i < GPR_ARRAY_SIZE(tags); i++) { - ev = grpc_completion_queue_pluck(cc, tags[i], - gpr_inf_past(GPR_CLOCK_REALTIME), nullptr); + ev = grpc_completion_queue_pluck( + cc, tags[i], gpr_inf_past(GPR_CLOCK_REALTIME), nullptr); GPR_ASSERT(ev.tag == tags[i]); } @@ -326,7 +330,8 @@ static void test_pluck(void) { for (i = 0; i < GPR_ARRAY_SIZE(tags); i++) { ev = grpc_completion_queue_pluck(cc, tags[GPR_ARRAY_SIZE(tags) - i - 1], - gpr_inf_past(GPR_CLOCK_REALTIME), nullptr); + gpr_inf_past(GPR_CLOCK_REALTIME), + nullptr); GPR_ASSERT(ev.tag == tags[GPR_ARRAY_SIZE(tags) - i - 1]); } @@ -351,8 +356,8 @@ static void test_pluck_after_shutdown(void) { cc = grpc_completion_queue_create( grpc_completion_queue_factory_lookup(&attr), &attr, nullptr); grpc_completion_queue_shutdown(cc); - ev = grpc_completion_queue_pluck(cc, nullptr, - gpr_inf_future(GPR_CLOCK_REALTIME), nullptr); + ev = grpc_completion_queue_pluck( + cc, nullptr, gpr_inf_future(GPR_CLOCK_REALTIME), nullptr); GPR_ASSERT(ev.type == GRPC_QUEUE_SHUTDOWN); grpc_completion_queue_destroy(cc); } diff --git a/test/core/surface/completion_queue_threading_test.cc b/test/core/surface/completion_queue_threading_test.cc index 457f96e95c..af54e00c4a 100644 --- a/test/core/surface/completion_queue_threading_test.cc +++ b/test/core/surface/completion_queue_threading_test.cc @@ -45,8 +45,8 @@ static void shutdown_and_destroy(grpc_completion_queue* cc) { break; } case GRPC_CQ_PLUCK: { - ev = grpc_completion_queue_pluck(cc, create_test_tag(), - gpr_inf_past(GPR_CLOCK_REALTIME), nullptr); + ev = grpc_completion_queue_pluck( + cc, create_test_tag(), gpr_inf_past(GPR_CLOCK_REALTIME), nullptr); break; } default: { @@ -191,8 +191,8 @@ static void consumer_thread(void* arg) { gpr_log(GPR_INFO, "consumer %d phase 2", opt->id); for (;;) { - ev = grpc_completion_queue_next(opt->cc, - gpr_inf_future(GPR_CLOCK_MONOTONIC), nullptr); + ev = grpc_completion_queue_next( + opt->cc, gpr_inf_future(GPR_CLOCK_MONOTONIC), nullptr); switch (ev.type) { case GRPC_OP_COMPLETE: GPR_ASSERT(ev.success); diff --git a/test/core/surface/concurrent_connectivity_test.cc b/test/core/surface/concurrent_connectivity_test.cc index d1f5bf1072..8fa15ab331 100644 --- a/test/core/surface/concurrent_connectivity_test.cc +++ b/test/core/surface/concurrent_connectivity_test.cc @@ -60,14 +60,16 @@ static int detag(void* p) { return (int)(uintptr_t)p; } void create_loop_destroy(void* addr) { for (int i = 0; i < NUM_OUTER_LOOPS; ++i) { grpc_completion_queue* cq = grpc_completion_queue_create_for_next(nullptr); - grpc_channel* chan = grpc_insecure_channel_create((char*)addr, nullptr, nullptr); + grpc_channel* chan = + grpc_insecure_channel_create((char*)addr, nullptr, nullptr); for (int j = 0; j < NUM_INNER_LOOPS; ++j) { gpr_timespec later_time = grpc_timeout_milliseconds_to_deadline(DELAY_MILLIS); grpc_connectivity_state state = grpc_channel_check_connectivity_state(chan, 1); - grpc_channel_watch_connectivity_state(chan, state, later_time, cq, nullptr); + grpc_channel_watch_connectivity_state(chan, state, later_time, cq, + nullptr); gpr_timespec poll_time = grpc_timeout_milliseconds_to_deadline(POLL_MILLIS); GPR_ASSERT(grpc_completion_queue_next(cq, poll_time, nullptr).type == @@ -239,7 +241,8 @@ int run_concurrent_connectivity_test() { void watches_with_short_timeouts(void* addr) { for (int i = 0; i < NUM_OUTER_LOOPS_SHORT_TIMEOUTS; ++i) { grpc_completion_queue* cq = grpc_completion_queue_create_for_next(nullptr); - grpc_channel* chan = grpc_insecure_channel_create((char*)addr, nullptr, nullptr); + grpc_channel* chan = + grpc_insecure_channel_create((char*)addr, nullptr, nullptr); for (int j = 0; j < NUM_INNER_LOOPS_SHORT_TIMEOUTS; ++j) { gpr_timespec later_time = @@ -247,7 +250,8 @@ void watches_with_short_timeouts(void* addr) { grpc_connectivity_state state = grpc_channel_check_connectivity_state(chan, 0); GPR_ASSERT(state == GRPC_CHANNEL_IDLE); - grpc_channel_watch_connectivity_state(chan, state, later_time, cq, nullptr); + grpc_channel_watch_connectivity_state(chan, state, later_time, cq, + nullptr); gpr_timespec poll_time = grpc_timeout_milliseconds_to_deadline(POLL_MILLIS_SHORT_TIMEOUTS); grpc_event ev = grpc_completion_queue_next(cq, poll_time, nullptr); diff --git a/test/core/surface/lame_client_test.cc b/test/core/surface/lame_client_test.cc index 71ec0cb6d6..f3df7f35a7 100644 --- a/test/core/surface/lame_client_test.cc +++ b/test/core/surface/lame_client_test.cc @@ -96,9 +96,10 @@ int main(int argc, char** argv) { cq = grpc_completion_queue_create_for_next(nullptr); grpc_slice host = grpc_slice_from_static_string("anywhere"); - call = grpc_channel_create_call(chan, nullptr, GRPC_PROPAGATE_DEFAULTS, cq, - grpc_slice_from_static_string("/Foo"), &host, - grpc_timeout_seconds_to_deadline(100), nullptr); + call = + grpc_channel_create_call(chan, nullptr, GRPC_PROPAGATE_DEFAULTS, cq, + grpc_slice_from_static_string("/Foo"), &host, + grpc_timeout_seconds_to_deadline(100), nullptr); GPR_ASSERT(call); cqv = cq_verifier_create(cq); diff --git a/test/core/surface/num_external_connectivity_watchers_test.cc b/test/core/surface/num_external_connectivity_watchers_test.cc index b08e28c0fc..f78d333673 100644 --- a/test/core/surface/num_external_connectivity_watchers_test.cc +++ b/test/core/surface/num_external_connectivity_watchers_test.cc @@ -50,8 +50,8 @@ static void channel_idle_start_watch(grpc_channel* channel, static void channel_idle_poll_for_timeout(grpc_channel* channel, grpc_completion_queue* cq) { - grpc_event ev = - grpc_completion_queue_next(cq, gpr_inf_future(GPR_CLOCK_REALTIME), nullptr); + grpc_event ev = grpc_completion_queue_next( + cq, gpr_inf_future(GPR_CLOCK_REALTIME), nullptr); /* expect watch_connectivity_state to end with a timeout */ GPR_ASSERT(ev.type == GRPC_OP_COMPLETE); @@ -105,9 +105,9 @@ static void run_timeouts_test(const test_fixture* fixture) { grpc_channel_destroy(channel); grpc_completion_queue_shutdown(cq); - GPR_ASSERT( - grpc_completion_queue_next(cq, gpr_inf_future(GPR_CLOCK_REALTIME), nullptr) - .type == GRPC_QUEUE_SHUTDOWN); + GPR_ASSERT(grpc_completion_queue_next(cq, gpr_inf_future(GPR_CLOCK_REALTIME), + nullptr) + .type == GRPC_QUEUE_SHUTDOWN); grpc_completion_queue_destroy(cq); grpc_shutdown(); @@ -141,16 +141,16 @@ static void run_channel_shutdown_before_timeout_test( connect_deadline, cq, (void*)1); grpc_channel_destroy(channel); - grpc_event ev = - grpc_completion_queue_next(cq, gpr_inf_future(GPR_CLOCK_REALTIME), nullptr); + grpc_event ev = grpc_completion_queue_next( + cq, gpr_inf_future(GPR_CLOCK_REALTIME), nullptr); GPR_ASSERT(ev.type == GRPC_OP_COMPLETE); /* expect success with a state transition to CHANNEL_SHUTDOWN */ GPR_ASSERT(ev.success == true); grpc_completion_queue_shutdown(cq); - GPR_ASSERT( - grpc_completion_queue_next(cq, gpr_inf_future(GPR_CLOCK_REALTIME), nullptr) - .type == GRPC_QUEUE_SHUTDOWN); + GPR_ASSERT(grpc_completion_queue_next(cq, gpr_inf_future(GPR_CLOCK_REALTIME), + nullptr) + .type == GRPC_QUEUE_SHUTDOWN); grpc_completion_queue_destroy(cq); grpc_shutdown(); diff --git a/test/core/surface/secure_channel_create_test.cc b/test/core/surface/secure_channel_create_test.cc index dcd1f2ef10..c31c61430c 100644 --- a/test/core/surface/secure_channel_create_test.cc +++ b/test/core/surface/secure_channel_create_test.cc @@ -51,7 +51,8 @@ void test_security_connector_already_in_arg(void) { grpc_channel_args args; args.num_args = 1; args.args = &arg; - grpc_channel* chan = grpc_secure_channel_create(nullptr, nullptr, &args, nullptr); + grpc_channel* chan = + grpc_secure_channel_create(nullptr, nullptr, &args, nullptr); grpc_channel_element* elem = grpc_channel_stack_element(grpc_channel_get_channel_stack(chan), 0); GPR_ASSERT(0 == strcmp(elem->filter->name, "lame-client")); @@ -61,7 +62,8 @@ void test_security_connector_already_in_arg(void) { } void test_null_creds(void) { - grpc_channel* chan = grpc_secure_channel_create(nullptr, nullptr, nullptr, nullptr); + grpc_channel* chan = + grpc_secure_channel_create(nullptr, nullptr, nullptr, nullptr); grpc_channel_element* elem = grpc_channel_stack_element(grpc_channel_get_channel_stack(chan), 0); GPR_ASSERT(0 == strcmp(elem->filter->name, "lame-client")); diff --git a/test/core/surface/sequential_connectivity_test.cc b/test/core/surface/sequential_connectivity_test.cc index 5bf3b12c73..015db92cb0 100644 --- a/test/core/surface/sequential_connectivity_test.cc +++ b/test/core/surface/sequential_connectivity_test.cc @@ -104,9 +104,9 @@ static void run_test(const test_fixture* fixture) { gpr_inf_future(GPR_CLOCK_REALTIME), nullptr) .type != GRPC_QUEUE_SHUTDOWN) ; - while ( - grpc_completion_queue_next(cq, gpr_inf_future(GPR_CLOCK_REALTIME), nullptr) - .type != GRPC_QUEUE_SHUTDOWN) + while (grpc_completion_queue_next(cq, gpr_inf_future(GPR_CLOCK_REALTIME), + nullptr) + .type != GRPC_QUEUE_SHUTDOWN) ; for (size_t i = 0; i < NUM_CONNECTIONS; i++) { @@ -138,8 +138,8 @@ static const test_fixture insecure_test = { static void secure_test_add_port(grpc_server* server, const char* addr) { grpc_ssl_pem_key_cert_pair pem_cert_key_pair = {test_server1_key, test_server1_cert}; - grpc_server_credentials* ssl_creds = - grpc_ssl_server_credentials_create(nullptr, &pem_cert_key_pair, 1, 0, nullptr); + grpc_server_credentials* ssl_creds = grpc_ssl_server_credentials_create( + nullptr, &pem_cert_key_pair, 1, 0, nullptr); grpc_server_add_secure_http2_port(server, addr, ssl_creds); grpc_server_credentials_release(ssl_creds); } diff --git a/test/core/surface/server_test.cc b/test/core/surface/server_test.cc index 1998cab3e3..969b8cb11b 100644 --- a/test/core/surface/server_test.cc +++ b/test/core/surface/server_test.cc @@ -31,8 +31,8 @@ void test_register_method_fail(void) { grpc_server* server = grpc_server_create(nullptr, nullptr); void* method; void* method_old; - method = - grpc_server_register_method(server, nullptr, nullptr, GRPC_SRM_PAYLOAD_NONE, 0); + method = grpc_server_register_method(server, nullptr, nullptr, + GRPC_SRM_PAYLOAD_NONE, 0); GPR_ASSERT(method == nullptr); method_old = grpc_server_register_method(server, "m", "h", GRPC_SRM_PAYLOAD_NONE, 0); @@ -58,10 +58,12 @@ void test_request_call_on_no_server_cq(void) { grpc_completion_queue* cc = grpc_completion_queue_create_for_next(nullptr); grpc_server* server = grpc_server_create(nullptr, nullptr); GPR_ASSERT(GRPC_CALL_ERROR_NOT_SERVER_COMPLETION_QUEUE == - grpc_server_request_call(server, nullptr, nullptr, nullptr, cc, cc, nullptr)); + grpc_server_request_call(server, nullptr, nullptr, nullptr, cc, cc, + nullptr)); GPR_ASSERT(GRPC_CALL_ERROR_NOT_SERVER_COMPLETION_QUEUE == - grpc_server_request_registered_call(server, nullptr, nullptr, nullptr, nullptr, - nullptr, cc, cc, nullptr)); + grpc_server_request_registered_call(server, nullptr, nullptr, + nullptr, nullptr, nullptr, cc, + cc, nullptr)); grpc_completion_queue_destroy(cc); grpc_server_destroy(server); } |