aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core/iomgr/fd_posix_test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'test/core/iomgr/fd_posix_test.cc')
-rw-r--r--test/core/iomgr/fd_posix_test.cc45
1 files changed, 23 insertions, 22 deletions
diff --git a/test/core/iomgr/fd_posix_test.cc b/test/core/iomgr/fd_posix_test.cc
index c70187ce91..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, NULL, NULL, 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, NULL, NULL, 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, NULL)));
+ GPR_ASSERT(GRPC_LOG_IF_ERROR(
+ "pollset_kick", grpc_pollset_kick(exec_ctx, g_pollset, nullptr)));
gpr_mu_unlock(g_mu);
}
@@ -250,7 +250,7 @@ static void server_wait_and_shutdown(server* sv) {
gpr_mu_lock(g_mu);
while (!sv->done) {
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
- grpc_pollset_worker* worker = NULL;
+ grpc_pollset_worker* worker = nullptr;
GPR_ASSERT(GRPC_LOG_IF_ERROR(
"pollset_work", grpc_pollset_work(&exec_ctx, g_pollset, &worker,
GRPC_MILLIS_INF_FUTURE)));
@@ -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, NULL, NULL, 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, NULL)));
+ 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. */
@@ -366,7 +366,7 @@ static void client_start(grpc_exec_ctx* exec_ctx, client* cl, int port) {
static void client_wait_and_shutdown(client* cl) {
gpr_mu_lock(g_mu);
while (!cl->done) {
- grpc_pollset_worker* worker = NULL;
+ grpc_pollset_worker* worker = nullptr;
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
GPR_ASSERT(GRPC_LOG_IF_ERROR(
"pollset_work", grpc_pollset_work(&exec_ctx, g_pollset, &worker,
@@ -402,7 +402,7 @@ typedef struct fd_change_data {
grpc_iomgr_cb_func cb_that_ran;
} fd_change_data;
-void init_change_data(fd_change_data* fdc) { fdc->cb_that_ran = NULL; }
+void init_change_data(fd_change_data* fdc) { fdc->cb_that_ran = nullptr; }
void destroy_change_data(fd_change_data* fdc) {}
@@ -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, NULL)));
+ 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, NULL)));
+ GPR_ASSERT(GRPC_LOG_IF_ERROR(
+ "pollset_kick", grpc_pollset_kick(exec_ctx, g_pollset, nullptr)));
gpr_mu_unlock(g_mu);
}
@@ -470,8 +470,8 @@ static void test_grpc_fd_change(void) {
/* And now wait for it to run. */
gpr_mu_lock(g_mu);
- while (a.cb_that_ran == NULL) {
- grpc_pollset_worker* worker = NULL;
+ while (a.cb_that_ran == nullptr) {
+ grpc_pollset_worker* worker = nullptr;
GPR_ASSERT(GRPC_LOG_IF_ERROR(
"pollset_work", grpc_pollset_work(&exec_ctx, g_pollset, &worker,
GRPC_MILLIS_INF_FUTURE)));
@@ -494,8 +494,8 @@ static void test_grpc_fd_change(void) {
GPR_ASSERT(result == 1);
gpr_mu_lock(g_mu);
- while (b.cb_that_ran == NULL) {
- grpc_pollset_worker* worker = NULL;
+ while (b.cb_that_ran == nullptr) {
+ grpc_pollset_worker* worker = nullptr;
GPR_ASSERT(GRPC_LOG_IF_ERROR(
"pollset_work", grpc_pollset_work(&exec_ctx, g_pollset, &worker,
GRPC_MILLIS_INF_FUTURE)));
@@ -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, NULL, NULL, 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);