diff options
Diffstat (limited to 'test/core/end2end/tests/resource_quota_server.cc')
-rw-r--r-- | test/core/end2end/tests/resource_quota_server.cc | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/test/core/end2end/tests/resource_quota_server.cc b/test/core/end2end/tests/resource_quota_server.cc index dd00c9843f..0ee014f97d 100644 --- a/test/core/end2end/tests/resource_quota_server.cc +++ b/test/core/end2end/tests/resource_quota_server.cc @@ -53,7 +53,7 @@ static gpr_timespec five_seconds_from_now(void) { static void drain_cq(grpc_completion_queue* cq) { grpc_event ev; do { - ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL); + ev = grpc_completion_queue_next(cq, five_seconds_from_now(), nullptr); } while (ev.type != GRPC_QUEUE_SHUTDOWN); } @@ -62,16 +62,16 @@ static void shutdown_server(grpc_end2end_test_fixture* f) { grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), grpc_timeout_seconds_to_deadline(5), - NULL) + nullptr) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); - f->server = NULL; + f->server = nullptr; } static void shutdown_client(grpc_end2end_test_fixture* f) { if (!f->client) return; grpc_channel_destroy(f->client); - f->client = NULL; + f->client = nullptr; } static void end_test(grpc_end2end_test_fixture* f) { @@ -124,7 +124,7 @@ void resource_quota_server(grpc_end2end_test_config config) { grpc_channel_args args = {1, &arg}; grpc_end2end_test_fixture f = - begin_test(config, "resource_quota_server", NULL, &args); + begin_test(config, "resource_quota_server", nullptr, &args); /* Create large request and response bodies. These are big enough to require * multiple round trips to deliver to the peer, and their exact contents of @@ -170,7 +170,7 @@ void resource_quota_server(grpc_end2end_test_config config) { grpc_metadata_array_init(&request_metadata_recv[i]); grpc_call_details_init(&call_details[i]); request_payload[i] = grpc_raw_byte_buffer_create(&request_payload_slice, 1); - request_payload_recv[i] = NULL; + request_payload_recv[i] = nullptr; was_cancelled[i] = 0; } @@ -185,32 +185,32 @@ void resource_quota_server(grpc_end2end_test_config config) { for (int i = 0; i < NUM_CALLS; i++) { client_calls[i] = grpc_channel_create_call( - f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq, + f.client, nullptr, GRPC_PROPAGATE_DEFAULTS, f.cq, grpc_slice_from_static_string("/foo"), get_host_override_slice("foo.test.google.fr", config), - n_seconds_from_now(60), NULL); + n_seconds_from_now(60), nullptr); memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_SEND_INITIAL_METADATA; op->data.send_initial_metadata.count = 0; op->flags = GRPC_INITIAL_METADATA_WAIT_FOR_READY; - op->reserved = NULL; + op->reserved = nullptr; op++; op->op = GRPC_OP_SEND_MESSAGE; op->data.send_message.send_message = request_payload[i]; op->flags = 0; - op->reserved = NULL; + op->reserved = nullptr; op++; op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT; op->flags = 0; - op->reserved = NULL; + op->reserved = nullptr; op++; op->op = GRPC_OP_RECV_INITIAL_METADATA; op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv[i]; op->flags = 0; - op->reserved = NULL; + op->reserved = nullptr; op++; op->op = GRPC_OP_RECV_STATUS_ON_CLIENT; op->data.recv_status_on_client.trailing_metadata = @@ -218,10 +218,10 @@ void resource_quota_server(grpc_end2end_test_config config) { op->data.recv_status_on_client.status = &status[i]; op->data.recv_status_on_client.status_details = &details[i]; op->flags = 0; - op->reserved = NULL; + op->reserved = nullptr; op++; error = grpc_call_start_batch(client_calls[i], ops, (size_t)(op - ops), - tag(CLIENT_BASE_TAG + i), NULL); + tag(CLIENT_BASE_TAG + i), nullptr); GPR_ASSERT(GRPC_CALL_OK == error); pending_client_calls++; @@ -231,7 +231,7 @@ void resource_quota_server(grpc_end2end_test_config config) { pending_server_end_calls > 0) { grpc_event ev = - grpc_completion_queue_next(f.cq, n_seconds_from_now(60), NULL); + grpc_completion_queue_next(f.cq, n_seconds_from_now(60), nullptr); GPR_ASSERT(ev.type == GRPC_OP_COMPLETE); int ev_tag = (int)(intptr_t)ev.tag; @@ -278,16 +278,16 @@ void resource_quota_server(grpc_end2end_test_config config) { op->op = GRPC_OP_SEND_INITIAL_METADATA; op->data.send_initial_metadata.count = 0; op->flags = 0; - op->reserved = NULL; + op->reserved = nullptr; op++; op->op = GRPC_OP_RECV_MESSAGE; op->data.recv_message.recv_message = &request_payload_recv[call_id]; op->flags = 0; - op->reserved = NULL; + op->reserved = nullptr; op++; error = grpc_call_start_batch(server_calls[call_id], ops, (size_t)(op - ops), - tag(SERVER_RECV_BASE_TAG + call_id), NULL); + tag(SERVER_RECV_BASE_TAG + call_id), nullptr); GPR_ASSERT(GRPC_CALL_OK == error); GPR_ASSERT(pending_server_start_calls > 0); @@ -303,12 +303,12 @@ void resource_quota_server(grpc_end2end_test_config config) { GPR_ASSERT(call_id < NUM_CALLS); if (ev.success) { - if (request_payload_recv[call_id] != NULL) { + if (request_payload_recv[call_id] != nullptr) { grpc_byte_buffer_destroy(request_payload_recv[call_id]); - request_payload_recv[call_id] = NULL; + request_payload_recv[call_id] = nullptr; } } else { - GPR_ASSERT(request_payload_recv[call_id] == NULL); + GPR_ASSERT(request_payload_recv[call_id] == nullptr); } memset(ops, 0, sizeof(ops)); @@ -316,7 +316,7 @@ void resource_quota_server(grpc_end2end_test_config config) { op->op = GRPC_OP_RECV_CLOSE_ON_SERVER; op->data.recv_close_on_server.cancelled = &was_cancelled[call_id]; op->flags = 0; - op->reserved = NULL; + op->reserved = nullptr; op++; op->op = GRPC_OP_SEND_STATUS_FROM_SERVER; op->data.send_status_from_server.trailing_metadata_count = 0; @@ -324,11 +324,11 @@ void resource_quota_server(grpc_end2end_test_config config) { grpc_slice status_details = grpc_slice_from_static_string("xyz"); op->data.send_status_from_server.status_details = &status_details; op->flags = 0; - op->reserved = NULL; + op->reserved = nullptr; op++; error = grpc_call_start_batch(server_calls[call_id], ops, (size_t)(op - ops), - tag(SERVER_END_BASE_TAG + call_id), NULL); + tag(SERVER_END_BASE_TAG + call_id), nullptr); GPR_ASSERT(GRPC_CALL_OK == error); GPR_ASSERT(pending_server_recv_calls > 0); |