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/iomgr | |
parent | 6d0ec6b382550e196ebbcd61437c3669aa505ef4 (diff) |
clang-format after nullptr changes
Diffstat (limited to 'test/core/iomgr')
-rw-r--r-- | test/core/iomgr/endpoint_tests.cc | 4 | ||||
-rw-r--r-- | test/core/iomgr/fd_posix_test.cc | 31 | ||||
-rw-r--r-- | test/core/iomgr/resource_quota_test.cc | 17 | ||||
-rw-r--r-- | test/core/iomgr/tcp_client_posix_test.cc | 12 | ||||
-rw-r--r-- | test/core/iomgr/tcp_posix_test.cc | 12 | ||||
-rw-r--r-- | test/core/iomgr/tcp_server_posix_test.cc | 4 | ||||
-rw-r--r-- | test/core/iomgr/udp_server_test.cc | 8 |
7 files changed, 46 insertions, 42 deletions
diff --git a/test/core/iomgr/endpoint_tests.cc b/test/core/iomgr/endpoint_tests.cc index 83aa23a60f..026e34105d 100644 --- a/test/core/iomgr/endpoint_tests.cc +++ b/test/core/iomgr/endpoint_tests.cc @@ -258,8 +258,8 @@ static void inc_on_failure(grpc_exec_ctx* exec_ctx, void* arg, grpc_error* error) { gpr_mu_lock(g_mu); *(int*)arg += (error != GRPC_ERROR_NONE); - GPR_ASSERT( - GRPC_LOG_IF_ERROR("kick", grpc_pollset_kick(exec_ctx, g_pollset, nullptr))); + GPR_ASSERT(GRPC_LOG_IF_ERROR( + "kick", grpc_pollset_kick(exec_ctx, g_pollset, nullptr))); gpr_mu_unlock(g_mu); } diff --git a/test/core/iomgr/fd_posix_test.cc b/test/core/iomgr/fd_posix_test.cc index 240588bf52..a03d841ecd 100644 --- a/test/core/iomgr/fd_posix_test.cc +++ b/test/core/iomgr/fd_posix_test.cc @@ -115,8 +115,8 @@ static void session_shutdown_cb(grpc_exec_ctx* exec_ctx, void* arg, /*session */ bool success) { session* se = static_cast<session*>(arg); server* sv = se->sv; - grpc_fd_orphan(exec_ctx, se->em_fd, nullptr, nullptr, false /* already_closed */, - "a"); + grpc_fd_orphan(exec_ctx, se->em_fd, nullptr, nullptr, + false /* already_closed */, "a"); gpr_free(se); /* Start to shutdown listen fd. */ grpc_fd_shutdown(exec_ctx, sv->em_fd, @@ -173,13 +173,13 @@ static void listen_shutdown_cb(grpc_exec_ctx* exec_ctx, void* arg /*server */, int success) { server* sv = static_cast<server*>(arg); - grpc_fd_orphan(exec_ctx, sv->em_fd, nullptr, nullptr, false /* already_closed */, - "b"); + grpc_fd_orphan(exec_ctx, sv->em_fd, nullptr, nullptr, + false /* already_closed */, "b"); gpr_mu_lock(g_mu); sv->done = 1; - GPR_ASSERT(GRPC_LOG_IF_ERROR("pollset_kick", - grpc_pollset_kick(exec_ctx, g_pollset, nullptr))); + GPR_ASSERT(GRPC_LOG_IF_ERROR( + "pollset_kick", grpc_pollset_kick(exec_ctx, g_pollset, nullptr))); gpr_mu_unlock(g_mu); } @@ -292,11 +292,11 @@ static void client_init(client* cl) { static void client_session_shutdown_cb(grpc_exec_ctx* exec_ctx, void* arg /*client */, int success) { client* cl = static_cast<client*>(arg); - grpc_fd_orphan(exec_ctx, cl->em_fd, nullptr, nullptr, false /* already_closed */, - "c"); + grpc_fd_orphan(exec_ctx, cl->em_fd, nullptr, nullptr, + false /* already_closed */, "c"); cl->done = 1; - GPR_ASSERT(GRPC_LOG_IF_ERROR("pollset_kick", - grpc_pollset_kick(exec_ctx, g_pollset, nullptr))); + GPR_ASSERT(GRPC_LOG_IF_ERROR( + "pollset_kick", grpc_pollset_kick(exec_ctx, g_pollset, nullptr))); } /* Write as much as possible, then register notify_on_write. */ @@ -413,8 +413,8 @@ static void first_read_callback(grpc_exec_ctx* exec_ctx, gpr_mu_lock(g_mu); fdc->cb_that_ran = first_read_callback; - GPR_ASSERT(GRPC_LOG_IF_ERROR("pollset_kick", - grpc_pollset_kick(exec_ctx, g_pollset, nullptr))); + GPR_ASSERT(GRPC_LOG_IF_ERROR( + "pollset_kick", grpc_pollset_kick(exec_ctx, g_pollset, nullptr))); gpr_mu_unlock(g_mu); } @@ -425,8 +425,8 @@ static void second_read_callback(grpc_exec_ctx* exec_ctx, gpr_mu_lock(g_mu); fdc->cb_that_ran = second_read_callback; - GPR_ASSERT(GRPC_LOG_IF_ERROR("pollset_kick", - grpc_pollset_kick(exec_ctx, g_pollset, nullptr))); + GPR_ASSERT(GRPC_LOG_IF_ERROR( + "pollset_kick", grpc_pollset_kick(exec_ctx, g_pollset, nullptr))); gpr_mu_unlock(g_mu); } @@ -507,7 +507,8 @@ static void test_grpc_fd_change(void) { GPR_ASSERT(b.cb_that_ran == second_read_callback); gpr_mu_unlock(g_mu); - grpc_fd_orphan(&exec_ctx, em_fd, nullptr, nullptr, false /* already_closed */, "d"); + grpc_fd_orphan(&exec_ctx, em_fd, nullptr, nullptr, false /* already_closed */, + "d"); grpc_exec_ctx_finish(&exec_ctx); destroy_change_data(&a); destroy_change_data(&b); diff --git a/test/core/iomgr/resource_quota_test.cc b/test/core/iomgr/resource_quota_test.cc index a0ce4018dc..6851702e67 100644 --- a/test/core/iomgr/resource_quota_test.cc +++ b/test/core/iomgr/resource_quota_test.cc @@ -189,7 +189,8 @@ static void test_async_alloc_blocked_by_size(void) { &ev, grpc_timeout_milliseconds_to_deadline(100)) == nullptr); } grpc_resource_quota_resize(q, 1024); - GPR_ASSERT(gpr_event_wait(&ev, grpc_timeout_seconds_to_deadline(5)) != nullptr); + GPR_ASSERT(gpr_event_wait(&ev, grpc_timeout_seconds_to_deadline(5)) != + nullptr); ; { grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; @@ -638,8 +639,8 @@ test_resource_user_stays_allocated_and_reclaimers_unrun_until_memory_released( grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; grpc_resource_user_alloc(&exec_ctx, usr, 1024, set_event(&allocated)); grpc_exec_ctx_finish(&exec_ctx); - GPR_ASSERT(gpr_event_wait(&allocated, - grpc_timeout_seconds_to_deadline(5)) != nullptr); + GPR_ASSERT(gpr_event_wait(&allocated, grpc_timeout_seconds_to_deadline( + 5)) != nullptr); GPR_ASSERT(gpr_event_wait(&reclaimer_cancelled, grpc_timeout_milliseconds_to_deadline(100)) == nullptr); @@ -657,7 +658,8 @@ test_resource_user_stays_allocated_and_reclaimers_unrun_until_memory_released( grpc_resource_user_free(&exec_ctx, usr, 1024); grpc_exec_ctx_finish(&exec_ctx); GPR_ASSERT(gpr_event_wait(&reclaimer_cancelled, - grpc_timeout_seconds_to_deadline(5)) != nullptr); + grpc_timeout_seconds_to_deadline(5)) != + nullptr); } } grpc_resource_quota_unref(q); @@ -697,10 +699,11 @@ static void test_reclaimers_can_be_posted_repeatedly(void) { grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; grpc_resource_user_alloc(&exec_ctx, usr, 1024, set_event(&allocated)); grpc_exec_ctx_finish(&exec_ctx); - GPR_ASSERT(gpr_event_wait(&allocated, - grpc_timeout_seconds_to_deadline(5)) != nullptr); + GPR_ASSERT(gpr_event_wait(&allocated, grpc_timeout_seconds_to_deadline( + 5)) != nullptr); GPR_ASSERT(gpr_event_wait(&reclaimer_done, - grpc_timeout_seconds_to_deadline(5)) != nullptr); + grpc_timeout_seconds_to_deadline(5)) != + nullptr); } } { diff --git a/test/core/iomgr/tcp_client_posix_test.cc b/test/core/iomgr/tcp_client_posix_test.cc index c87c146c34..9fb1a2d770 100644 --- a/test/core/iomgr/tcp_client_posix_test.cc +++ b/test/core/iomgr/tcp_client_posix_test.cc @@ -54,8 +54,8 @@ static void finish_connection() { gpr_mu_lock(g_mu); g_connections_complete++; grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - GPR_ASSERT(GRPC_LOG_IF_ERROR("pollset_kick", - grpc_pollset_kick(&exec_ctx, g_pollset, nullptr))); + GPR_ASSERT(GRPC_LOG_IF_ERROR( + "pollset_kick", grpc_pollset_kick(&exec_ctx, g_pollset, nullptr))); grpc_exec_ctx_finish(&exec_ctx); gpr_mu_unlock(g_mu); } @@ -108,8 +108,8 @@ void test_succeeds(void) { GPR_ASSERT(getsockname(svr_fd, (struct sockaddr*)addr, (socklen_t*)&resolved_addr.len) == 0); GRPC_CLOSURE_INIT(&done, must_succeed, nullptr, grpc_schedule_on_exec_ctx); - grpc_tcp_client_connect(&exec_ctx, &done, &g_connecting, g_pollset_set, nullptr, - &resolved_addr, GRPC_MILLIS_INF_FUTURE); + grpc_tcp_client_connect(&exec_ctx, &done, &g_connecting, g_pollset_set, + nullptr, &resolved_addr, GRPC_MILLIS_INF_FUTURE); /* await the connection */ do { @@ -157,8 +157,8 @@ void test_fails(void) { /* connect to a broken address */ GRPC_CLOSURE_INIT(&done, must_fail, nullptr, grpc_schedule_on_exec_ctx); - grpc_tcp_client_connect(&exec_ctx, &done, &g_connecting, g_pollset_set, nullptr, - &resolved_addr, GRPC_MILLIS_INF_FUTURE); + grpc_tcp_client_connect(&exec_ctx, &done, &g_connecting, g_pollset_set, + nullptr, &resolved_addr, GRPC_MILLIS_INF_FUTURE); gpr_mu_lock(g_mu); diff --git a/test/core/iomgr/tcp_posix_test.cc b/test/core/iomgr/tcp_posix_test.cc index 98b3d1594d..7986dc2b19 100644 --- a/test/core/iomgr/tcp_posix_test.cc +++ b/test/core/iomgr/tcp_posix_test.cc @@ -147,8 +147,8 @@ static void read_cb(grpc_exec_ctx* exec_ctx, void* user_data, gpr_log(GPR_INFO, "Read %" PRIuPTR " bytes of %" PRIuPTR, read_bytes, state->target_read_bytes); if (state->read_bytes >= state->target_read_bytes) { - GPR_ASSERT(GRPC_LOG_IF_ERROR("kick", - grpc_pollset_kick(exec_ctx, g_pollset, nullptr))); + GPR_ASSERT(GRPC_LOG_IF_ERROR( + "kick", grpc_pollset_kick(exec_ctx, g_pollset, nullptr))); gpr_mu_unlock(g_mu); } else { grpc_endpoint_read(exec_ctx, state->ep, &state->incoming, &state->read_cb); @@ -297,8 +297,8 @@ static void write_done(grpc_exec_ctx* exec_ctx, gpr_mu_lock(g_mu); gpr_log(GPR_INFO, "Signalling write done"); state->write_done = 1; - GPR_ASSERT(GRPC_LOG_IF_ERROR("pollset_kick", - grpc_pollset_kick(exec_ctx, g_pollset, nullptr))); + GPR_ASSERT(GRPC_LOG_IF_ERROR( + "pollset_kick", grpc_pollset_kick(exec_ctx, g_pollset, nullptr))); gpr_mu_unlock(g_mu); } @@ -408,8 +408,8 @@ static void write_test(size_t num_bytes, size_t slice_size) { void on_fd_released(grpc_exec_ctx* exec_ctx, void* arg, grpc_error* errors) { int* done = (int*)arg; *done = 1; - GPR_ASSERT(GRPC_LOG_IF_ERROR("pollset_kick", - grpc_pollset_kick(exec_ctx, g_pollset, nullptr))); + GPR_ASSERT(GRPC_LOG_IF_ERROR( + "pollset_kick", grpc_pollset_kick(exec_ctx, g_pollset, nullptr))); } /* Do a read_test, then release fd and try to read/write again. Verify that diff --git a/test/core/iomgr/tcp_server_posix_test.cc b/test/core/iomgr/tcp_server_posix_test.cc index 2651d29f99..48d8d425a5 100644 --- a/test/core/iomgr/tcp_server_posix_test.cc +++ b/test/core/iomgr/tcp_server_posix_test.cc @@ -159,8 +159,8 @@ static void on_connect(grpc_exec_ctx* exec_ctx, void* arg, grpc_endpoint* tcp, gpr_mu_lock(g_mu); g_result = temp_result; g_nconnects++; - GPR_ASSERT(GRPC_LOG_IF_ERROR("pollset_kick", - grpc_pollset_kick(exec_ctx, g_pollset, nullptr))); + GPR_ASSERT(GRPC_LOG_IF_ERROR( + "pollset_kick", grpc_pollset_kick(exec_ctx, g_pollset, nullptr))); gpr_mu_unlock(g_mu); } diff --git a/test/core/iomgr/udp_server_test.cc b/test/core/iomgr/udp_server_test.cc index 08871695a7..803f017106 100644 --- a/test/core/iomgr/udp_server_test.cc +++ b/test/core/iomgr/udp_server_test.cc @@ -61,8 +61,8 @@ static void on_read(grpc_exec_ctx* exec_ctx, grpc_fd* emfd, void* user_data) { g_number_of_reads++; g_number_of_bytes_read += (int)byte_count; - GPR_ASSERT(GRPC_LOG_IF_ERROR("pollset_kick", - grpc_pollset_kick(exec_ctx, g_pollset, nullptr))); + GPR_ASSERT(GRPC_LOG_IF_ERROR( + "pollset_kick", grpc_pollset_kick(exec_ctx, g_pollset, nullptr))); gpr_mu_unlock(g_mu); } @@ -70,8 +70,8 @@ static void on_write(grpc_exec_ctx* exec_ctx, grpc_fd* emfd, void* user_data) { gpr_mu_lock(g_mu); g_number_of_writes++; - GPR_ASSERT(GRPC_LOG_IF_ERROR("pollset_kick", - grpc_pollset_kick(exec_ctx, g_pollset, nullptr))); + GPR_ASSERT(GRPC_LOG_IF_ERROR( + "pollset_kick", grpc_pollset_kick(exec_ctx, g_pollset, nullptr))); gpr_mu_unlock(g_mu); } |