aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core/surface/completion_queue_threading_test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'test/core/surface/completion_queue_threading_test.cc')
-rw-r--r--test/core/surface/completion_queue_threading_test.cc20
1 files changed, 10 insertions, 10 deletions
diff --git a/test/core/surface/completion_queue_threading_test.cc b/test/core/surface/completion_queue_threading_test.cc
index 043c5c1617..457f96e95c 100644
--- a/test/core/surface/completion_queue_threading_test.cc
+++ b/test/core/surface/completion_queue_threading_test.cc
@@ -41,12 +41,12 @@ static void shutdown_and_destroy(grpc_completion_queue* cc) {
switch (grpc_get_cq_completion_type(cc)) {
case GRPC_CQ_NEXT: {
ev = grpc_completion_queue_next(cc, gpr_inf_past(GPR_CLOCK_REALTIME),
- NULL);
+ nullptr);
break;
}
case GRPC_CQ_PLUCK: {
ev = grpc_completion_queue_pluck(cc, create_test_tag(),
- gpr_inf_past(GPR_CLOCK_REALTIME), NULL);
+ gpr_inf_past(GPR_CLOCK_REALTIME), nullptr);
break;
}
default: {
@@ -70,7 +70,7 @@ struct thread_state {
static void pluck_one(void* arg) {
struct thread_state* state = static_cast<struct thread_state*>(arg);
grpc_completion_queue_pluck(state->cc, state->tag,
- gpr_inf_future(GPR_CLOCK_REALTIME), NULL);
+ gpr_inf_future(GPR_CLOCK_REALTIME), nullptr);
}
static void test_too_many_plucks(void) {
@@ -86,7 +86,7 @@ static void test_too_many_plucks(void) {
LOG_TEST("test_too_many_plucks");
- cc = grpc_completion_queue_create_for_pluck(NULL);
+ cc = grpc_completion_queue_create_for_pluck(nullptr);
gpr_thd_options_set_joinable(&thread_options);
for (i = 0; i < GPR_ARRAY_SIZE(tags); i++) {
@@ -103,13 +103,13 @@ static void test_too_many_plucks(void) {
gpr_sleep_until(grpc_timeout_milliseconds_to_deadline(1000));
ev = grpc_completion_queue_pluck(cc, create_test_tag(),
- gpr_inf_future(GPR_CLOCK_REALTIME), NULL);
+ gpr_inf_future(GPR_CLOCK_REALTIME), nullptr);
GPR_ASSERT(ev.type == GRPC_QUEUE_TIMEOUT);
for (i = 0; i < GPR_ARRAY_SIZE(tags); i++) {
GPR_ASSERT(grpc_cq_begin_op(cc, tags[i]));
grpc_cq_end_op(&exec_ctx, cc, tags[i], GRPC_ERROR_NONE,
- do_nothing_end_completion, NULL, &completions[i]);
+ do_nothing_end_completion, nullptr, &completions[i]);
}
for (i = 0; i < GPR_ARRAY_SIZE(tags); i++) {
@@ -163,7 +163,7 @@ static void producer_thread(void* arg) {
gpr_log(GPR_INFO, "producer %d phase 2", opt->id);
for (i = 0; i < TEST_THREAD_EVENTS; i++) {
grpc_cq_end_op(&exec_ctx, opt->cc, (void*)(intptr_t)1, GRPC_ERROR_NONE,
- free_completion, NULL,
+ free_completion, nullptr,
static_cast<grpc_cq_completion*>(
gpr_malloc(sizeof(grpc_cq_completion))));
opt->events_triggered++;
@@ -192,7 +192,7 @@ 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), NULL);
+ gpr_inf_future(GPR_CLOCK_MONOTONIC), nullptr);
switch (ev.type) {
case GRPC_OP_COMPLETE:
GPR_ASSERT(ev.success);
@@ -214,7 +214,7 @@ static void test_threading(size_t producers, size_t consumers) {
gpr_malloc((producers + consumers) * sizeof(test_thread_options)));
gpr_event phase1 = GPR_EVENT_INIT;
gpr_event phase2 = GPR_EVENT_INIT;
- grpc_completion_queue* cc = grpc_completion_queue_create_for_next(NULL);
+ grpc_completion_queue* cc = grpc_completion_queue_create_for_next(nullptr);
size_t i;
size_t total_consumed = 0;
static int optid = 101;
@@ -235,7 +235,7 @@ static void test_threading(size_t producers, size_t consumers) {
options[i].id = optid++;
GPR_ASSERT(gpr_thd_new(&id,
i < producers ? producer_thread : consumer_thread,
- options + i, NULL));
+ options + i, nullptr));
gpr_event_wait(&options[i].on_started, ten_seconds_time());
}