diff options
Diffstat (limited to 'test/core/end2end/tests')
52 files changed, 418 insertions, 239 deletions
diff --git a/test/core/end2end/tests/authority_not_supported.cc b/test/core/end2end/tests/authority_not_supported.cc index f2852f772e..01a95e4e10 100644 --- a/test/core/end2end/tests/authority_not_supported.cc +++ b/test/core/end2end/tests/authority_not_supported.cc @@ -154,7 +154,8 @@ static void test_with_authority_header(grpc_end2end_test_config config) { op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), nullptr); + error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), tag(1), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(1), 1); diff --git a/test/core/end2end/tests/bad_hostname.cc b/test/core/end2end/tests/bad_hostname.cc index 63bfd76120..b6f06a20d6 100644 --- a/test/core/end2end/tests/bad_hostname.cc +++ b/test/core/end2end/tests/bad_hostname.cc @@ -133,7 +133,8 @@ static void simple_request_body(grpc_end2end_test_fixture f) { op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), nullptr); + error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), tag(1), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(1), 1); diff --git a/test/core/end2end/tests/bad_ping.cc b/test/core/end2end/tests/bad_ping.cc index 672c2f4c6e..ddab3faa27 100644 --- a/test/core/end2end/tests/bad_ping.cc +++ b/test/core/end2end/tests/bad_ping.cc @@ -144,7 +144,8 @@ static void test_bad_ping(grpc_end2end_test_config config) { op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), nullptr); + error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), tag(1), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); error = @@ -188,7 +189,8 @@ static void test_bad_ping(grpc_end2end_test_config config) { op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), nullptr); + error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), tag(102), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(102), 1); diff --git a/test/core/end2end/tests/binary_metadata.cc b/test/core/end2end/tests/binary_metadata.cc index 8a0d667428..e66b4da6cc 100644 --- a/test/core/end2end/tests/binary_metadata.cc +++ b/test/core/end2end/tests/binary_metadata.cc @@ -182,7 +182,8 @@ static void test_request_response_with_metadata_and_payload( op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), nullptr); + error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), tag(1), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); error = @@ -205,7 +206,8 @@ static void test_request_response_with_metadata_and_payload( op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), nullptr); + error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), tag(102), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(102), 1); @@ -246,7 +248,8 @@ static void test_request_response_with_metadata_and_payload( op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(103), nullptr); + error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), tag(103), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(103), 1); diff --git a/test/core/end2end/tests/call_creds.cc b/test/core/end2end/tests/call_creds.cc index 968dab1995..e9cbaa3088 100644 --- a/test/core/end2end/tests/call_creds.cc +++ b/test/core/end2end/tests/call_creds.cc @@ -219,7 +219,8 @@ static void request_response_with_payload_and_call_creds( op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), nullptr); + error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), tag(1), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); error = @@ -253,7 +254,8 @@ static void request_response_with_payload_and_call_creds( op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), nullptr); + error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), tag(102), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(102), 1); @@ -279,7 +281,8 @@ static void request_response_with_payload_and_call_creds( op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(103), nullptr); + error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), tag(103), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(103), 1); @@ -443,7 +446,8 @@ static void test_request_with_server_rejecting_client_creds( op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), nullptr); + error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), tag(1), + nullptr); GPR_ASSERT(error == GRPC_CALL_OK); CQ_EXPECT_COMPLETION(cqv, tag(1), 1); diff --git a/test/core/end2end/tests/cancel_after_accept.cc b/test/core/end2end/tests/cancel_after_accept.cc index 11bf4e79b7..ee1a0bbccc 100644 --- a/test/core/end2end/tests/cancel_after_accept.cc +++ b/test/core/end2end/tests/cancel_after_accept.cc @@ -186,7 +186,8 @@ static void test_cancel_after_accept(grpc_end2end_test_config config, op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), nullptr); + error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), tag(1), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); error = grpc_server_request_call(f.server, &s, &call_details, @@ -217,7 +218,8 @@ static void test_cancel_after_accept(grpc_end2end_test_config config, op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(3), nullptr); + error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), tag(3), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); GPR_ASSERT(GRPC_CALL_OK == mode.initiate_cancel(c, nullptr)); diff --git a/test/core/end2end/tests/cancel_after_client_done.cc b/test/core/end2end/tests/cancel_after_client_done.cc index b0702b7f44..31c3ea6f74 100644 --- a/test/core/end2end/tests/cancel_after_client_done.cc +++ b/test/core/end2end/tests/cancel_after_client_done.cc @@ -164,7 +164,8 @@ static void test_cancel_after_accept_and_writes_closed( op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), nullptr); + error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), tag(1), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); error = grpc_server_request_call(f.server, &s, &call_details, @@ -195,7 +196,8 @@ static void test_cancel_after_accept_and_writes_closed( op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(3), nullptr); + error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), tag(3), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); GPR_ASSERT(GRPC_CALL_OK == mode.initiate_cancel(c, nullptr)); diff --git a/test/core/end2end/tests/cancel_after_round_trip.cc b/test/core/end2end/tests/cancel_after_round_trip.cc index 63e6505f0e..bf3be1c8b7 100644 --- a/test/core/end2end/tests/cancel_after_round_trip.cc +++ b/test/core/end2end/tests/cancel_after_round_trip.cc @@ -181,7 +181,8 @@ static void test_cancel_after_round_trip(grpc_end2end_test_config config, op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), nullptr); + error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), tag(1), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); error = @@ -208,7 +209,8 @@ static void test_cancel_after_round_trip(grpc_end2end_test_config config, op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), nullptr); + error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), tag(102), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(102), 1); @@ -234,7 +236,8 @@ static void test_cancel_after_round_trip(grpc_end2end_test_config config, op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(2), nullptr); + error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), tag(2), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); GPR_ASSERT(GRPC_CALL_OK == mode.initiate_cancel(c, nullptr)); @@ -251,7 +254,8 @@ static void test_cancel_after_round_trip(grpc_end2end_test_config config, op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(103), nullptr); + error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), tag(103), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(2), 1); diff --git a/test/core/end2end/tests/compressed_payload.cc b/test/core/end2end/tests/compressed_payload.cc index 63bf472906..85cfe16508 100644 --- a/test/core/end2end/tests/compressed_payload.cc +++ b/test/core/end2end/tests/compressed_payload.cc @@ -187,7 +187,8 @@ static void request_for_disabled_algorithm( op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), nullptr); + error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), tag(1), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(101), true); @@ -205,7 +206,8 @@ static void request_for_disabled_algorithm( op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), nullptr); + error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), tag(102), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(102), false); @@ -216,7 +218,8 @@ static void request_for_disabled_algorithm( op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(103), nullptr); + error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), tag(103), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(103), true); @@ -338,7 +341,8 @@ static void request_with_payload_template( op->flags = client_send_flags_bitmask; op->reserved = nullptr; op++; - error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(2), nullptr); + error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), tag(2), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(2), true); } @@ -367,7 +371,8 @@ static void request_with_payload_template( op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), nullptr); + error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), tag(1), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); error = @@ -403,7 +408,8 @@ static void request_with_payload_template( op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(101), nullptr); + error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), tag(101), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); for (int i = 0; i < 2; i++) { @@ -418,8 +424,8 @@ static void request_with_payload_template( op->flags = client_send_flags_bitmask; op->reserved = nullptr; op++; - error = - grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(2), nullptr); + error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), + tag(2), nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(2), 1); } @@ -431,8 +437,8 @@ static void request_with_payload_template( op->flags = 0; op->reserved = nullptr; op++; - error = - grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), nullptr); + error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), + tag(102), nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(102), 1); @@ -450,8 +456,8 @@ static void request_with_payload_template( op->flags = 0; op->reserved = nullptr; op++; - error = - grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(103), nullptr); + error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), + tag(103), nullptr); GPR_ASSERT(GRPC_CALL_OK == error); memset(ops, 0, sizeof(ops)); @@ -461,7 +467,8 @@ static void request_with_payload_template( op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(3), nullptr); + error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), tag(3), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(103), 1); @@ -495,7 +502,8 @@ static void request_with_payload_template( op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(4), nullptr); + error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), tag(4), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); memset(ops, 0, sizeof(ops)); @@ -508,7 +516,8 @@ static void request_with_payload_template( op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(104), nullptr); + error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), tag(104), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(1), 1); diff --git a/test/core/end2end/tests/connectivity.cc b/test/core/end2end/tests/connectivity.cc index da65080bc0..56e5189a22 100644 --- a/test/core/end2end/tests/connectivity.cc +++ b/test/core/end2end/tests/connectivity.cc @@ -34,7 +34,7 @@ typedef struct { } child_events; static void child_thread(void* arg) { - child_events* ce = (child_events*)arg; + child_events* ce = static_cast<child_events*>(arg); grpc_event ev; gpr_event_set(&ce->started, (void*)1); gpr_log(GPR_DEBUG, "verifying"); diff --git a/test/core/end2end/tests/default_host.cc b/test/core/end2end/tests/default_host.cc index 33be5f1273..3191f76688 100644 --- a/test/core/end2end/tests/default_host.cc +++ b/test/core/end2end/tests/default_host.cc @@ -140,7 +140,8 @@ static void simple_request_body(grpc_end2end_test_fixture f) { op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), nullptr); + error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), tag(1), + nullptr); GPR_ASSERT(error == GRPC_CALL_OK); error = @@ -179,7 +180,8 @@ static void simple_request_body(grpc_end2end_test_fixture f) { op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), nullptr); + error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), tag(102), + nullptr); GPR_ASSERT(error == GRPC_CALL_OK); CQ_EXPECT_COMPLETION(cqv, tag(102), 1); diff --git a/test/core/end2end/tests/disappearing_server.cc b/test/core/end2end/tests/disappearing_server.cc index 1b2f729ba8..d5b6f8fbf0 100644 --- a/test/core/end2end/tests/disappearing_server.cc +++ b/test/core/end2end/tests/disappearing_server.cc @@ -120,7 +120,8 @@ static void do_request_and_shutdown_server(grpc_end2end_test_config config, op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), nullptr); + error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), tag(1), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); error = @@ -154,7 +155,8 @@ static void do_request_and_shutdown_server(grpc_end2end_test_config config, op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), nullptr); + error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), tag(102), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(102), 1); diff --git a/test/core/end2end/tests/filter_call_init_fails.cc b/test/core/end2end/tests/filter_call_init_fails.cc index f60a47f8ff..6f72a1843a 100644 --- a/test/core/end2end/tests/filter_call_init_fails.cc +++ b/test/core/end2end/tests/filter_call_init_fails.cc @@ -158,7 +158,8 @@ static void test_server_channel_filter(grpc_end2end_test_config config) { op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), nullptr); + error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), tag(1), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); error = @@ -253,7 +254,8 @@ static void test_client_channel_filter(grpc_end2end_test_config config) { op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), nullptr); + error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), tag(1), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(1), 1); @@ -344,7 +346,8 @@ static void test_client_subchannel_filter(grpc_end2end_test_config config) { op->reserved = nullptr; op++; - error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), nullptr); + error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), tag(1), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(1), 1); @@ -368,7 +371,8 @@ static void test_client_subchannel_filter(grpc_end2end_test_config config) { nullptr); GPR_ASSERT(c); - error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(2), nullptr); + error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), tag(2), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(2), 1); diff --git a/test/core/end2end/tests/filter_causes_close.cc b/test/core/end2end/tests/filter_causes_close.cc index 43f20d7cc0..bc4cb8633d 100644 --- a/test/core/end2end/tests/filter_causes_close.cc +++ b/test/core/end2end/tests/filter_causes_close.cc @@ -152,7 +152,8 @@ static void test_request(grpc_end2end_test_config config) { op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), nullptr); + error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), tag(1), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); error = @@ -197,8 +198,8 @@ typedef struct { } channel_data; static void recv_im_ready(void* arg, grpc_error* error) { - grpc_call_element* elem = (grpc_call_element*)arg; - call_data* calld = (call_data*)elem->call_data; + grpc_call_element* elem = static_cast<grpc_call_element*>(arg); + call_data* calld = static_cast<call_data*>(elem->call_data); GRPC_CLOSURE_RUN( calld->recv_im_ready, grpc_error_set_int(GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING( @@ -209,7 +210,7 @@ static void recv_im_ready(void* arg, grpc_error* error) { static void start_transport_stream_op_batch( grpc_call_element* elem, grpc_transport_stream_op_batch* op) { - call_data* calld = (call_data*)elem->call_data; + call_data* calld = static_cast<call_data*>(elem->call_data); if (op->recv_initial_metadata) { calld->recv_im_ready = op->payload->recv_initial_metadata.recv_initial_metadata_ready; diff --git a/test/core/end2end/tests/filter_latency.cc b/test/core/end2end/tests/filter_latency.cc index d6cf3b034e..51f54c9742 100644 --- a/test/core/end2end/tests/filter_latency.cc +++ b/test/core/end2end/tests/filter_latency.cc @@ -165,7 +165,8 @@ static void test_request(grpc_end2end_test_config config) { op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), nullptr); + error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), tag(1), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); error = @@ -196,7 +197,8 @@ static void test_request(grpc_end2end_test_config config) { op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), nullptr); + error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), tag(102), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(102), 1); @@ -305,7 +307,7 @@ static const grpc_channel_filter test_server_filter = { */ static bool maybe_add_filter(grpc_channel_stack_builder* builder, void* arg) { - grpc_channel_filter* filter = (grpc_channel_filter*)arg; + grpc_channel_filter* filter = static_cast<grpc_channel_filter*>(arg); if (g_enable_filter) { // Want to add the filter as close to the end as possible, to make // sure that all of the filters work well together. However, we diff --git a/test/core/end2end/tests/filter_status_code.cc b/test/core/end2end/tests/filter_status_code.cc index ad80f23d6f..32cd95410e 100644 --- a/test/core/end2end/tests/filter_status_code.cc +++ b/test/core/end2end/tests/filter_status_code.cc @@ -164,7 +164,8 @@ static void test_request(grpc_end2end_test_config config) { op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), nullptr); + error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), tag(1), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); error = @@ -199,7 +200,8 @@ static void test_request(grpc_end2end_test_config config) { op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), nullptr); + error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), tag(102), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(102), 1); @@ -250,7 +252,7 @@ typedef struct final_status_data { static grpc_error* init_call_elem(grpc_call_element* elem, const grpc_call_element_args* args) { - final_status_data* data = (final_status_data*)elem->call_data; + final_status_data* data = static_cast<final_status_data*>(elem->call_data); data->call = args->call_stack; return GRPC_ERROR_NONE; } @@ -258,7 +260,7 @@ static grpc_error* init_call_elem(grpc_call_element* elem, static void client_destroy_call_elem(grpc_call_element* elem, const grpc_call_final_info* final_info, grpc_closure* ignored) { - final_status_data* data = (final_status_data*)elem->call_data; + final_status_data* data = static_cast<final_status_data*>(elem->call_data); gpr_mu_lock(&g_mu); // Some fixtures, like proxies, will spawn intermidiate calls // We only want the results from our explicit calls @@ -273,7 +275,7 @@ static void client_destroy_call_elem(grpc_call_element* elem, static void server_destroy_call_elem(grpc_call_element* elem, const grpc_call_final_info* final_info, grpc_closure* ignored) { - final_status_data* data = (final_status_data*)elem->call_data; + final_status_data* data = static_cast<final_status_data*>(elem->call_data); gpr_mu_lock(&g_mu); // Some fixtures, like proxies, will spawn intermidiate calls // We only want the results from our explicit calls @@ -323,7 +325,7 @@ static const grpc_channel_filter test_server_filter = { */ static bool maybe_add_filter(grpc_channel_stack_builder* builder, void* arg) { - grpc_channel_filter* filter = (grpc_channel_filter*)arg; + grpc_channel_filter* filter = static_cast<grpc_channel_filter*>(arg); if (g_enable_filter) { // Want to add the filter as close to the end as possible, to make // sure that all of the filters work well together. However, we diff --git a/test/core/end2end/tests/graceful_server_shutdown.cc b/test/core/end2end/tests/graceful_server_shutdown.cc index 3b6872bfd7..3ef414f83c 100644 --- a/test/core/end2end/tests/graceful_server_shutdown.cc +++ b/test/core/end2end/tests/graceful_server_shutdown.cc @@ -135,7 +135,8 @@ static void test_early_server_shutdown_finishes_inflight_calls( op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), nullptr); + error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), tag(1), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); error = @@ -169,7 +170,8 @@ static void test_early_server_shutdown_finishes_inflight_calls( op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), nullptr); + error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), tag(102), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(102), 1); diff --git a/test/core/end2end/tests/high_initial_seqno.cc b/test/core/end2end/tests/high_initial_seqno.cc index 989cd5610f..8767437802 100644 --- a/test/core/end2end/tests/high_initial_seqno.cc +++ b/test/core/end2end/tests/high_initial_seqno.cc @@ -139,7 +139,8 @@ static void simple_request_body(grpc_end2end_test_config config, op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), nullptr); + error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), tag(1), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); error = @@ -169,7 +170,8 @@ static void simple_request_body(grpc_end2end_test_config config, op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), nullptr); + error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), tag(102), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(102), 1); diff --git a/test/core/end2end/tests/hpack_size.cc b/test/core/end2end/tests/hpack_size.cc index 66b3a4019f..b49736841e 100644 --- a/test/core/end2end/tests/hpack_size.cc +++ b/test/core/end2end/tests/hpack_size.cc @@ -293,7 +293,8 @@ static void simple_request_body(grpc_end2end_test_config config, op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), nullptr); + error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), tag(1), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); error = @@ -323,7 +324,8 @@ static void simple_request_body(grpc_end2end_test_config config, op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), nullptr); + error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), tag(102), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(102), 1); diff --git a/test/core/end2end/tests/idempotent_request.cc b/test/core/end2end/tests/idempotent_request.cc index 578510d407..56be2d6afe 100644 --- a/test/core/end2end/tests/idempotent_request.cc +++ b/test/core/end2end/tests/idempotent_request.cc @@ -144,7 +144,8 @@ static void simple_request_body(grpc_end2end_test_config config, op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), nullptr); + error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), tag(1), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); error = @@ -183,7 +184,8 @@ static void simple_request_body(grpc_end2end_test_config config, op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), nullptr); + error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), tag(102), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(102), 1); diff --git a/test/core/end2end/tests/invoke_large_request.cc b/test/core/end2end/tests/invoke_large_request.cc index b7afa97401..1aab34c2ce 100644 --- a/test/core/end2end/tests/invoke_large_request.cc +++ b/test/core/end2end/tests/invoke_large_request.cc @@ -176,7 +176,8 @@ static void test_invoke_large_request(grpc_end2end_test_config config, op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), nullptr); + error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), tag(1), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); error = @@ -198,7 +199,8 @@ static void test_invoke_large_request(grpc_end2end_test_config config, op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), nullptr); + error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), tag(102), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(102), 1); @@ -224,7 +226,8 @@ static void test_invoke_large_request(grpc_end2end_test_config config, op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(103), nullptr); + error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), tag(103), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(103), 1); diff --git a/test/core/end2end/tests/keepalive_timeout.cc b/test/core/end2end/tests/keepalive_timeout.cc index 0cdd12e9ca..f0dd061e33 100644 --- a/test/core/end2end/tests/keepalive_timeout.cc +++ b/test/core/end2end/tests/keepalive_timeout.cc @@ -155,7 +155,8 @@ static void test_keepalive_timeout(grpc_end2end_test_config config) { op->op = GRPC_OP_RECV_MESSAGE; op->data.recv_message.recv_message = &response_payload_recv; op++; - error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), nullptr); + error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), tag(1), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call( @@ -172,7 +173,8 @@ static void test_keepalive_timeout(grpc_end2end_test_config config) { op->op = GRPC_OP_SEND_MESSAGE; op->data.send_message.send_message = response_payload; op++; - error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), nullptr); + error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), tag(102), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(102), 1); @@ -186,7 +188,8 @@ static void test_keepalive_timeout(grpc_end2end_test_config config) { op->data.recv_status_on_client.status = &status; op->data.recv_status_on_client.status_details = &details; op++; - error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(3), nullptr); + error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), tag(3), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(3), 1); diff --git a/test/core/end2end/tests/large_metadata.cc b/test/core/end2end/tests/large_metadata.cc index c1343f902d..da0615bf6e 100644 --- a/test/core/end2end/tests/large_metadata.cc +++ b/test/core/end2end/tests/large_metadata.cc @@ -96,7 +96,7 @@ static void test_request_with_large_metadata(grpc_end2end_test_config config) { grpc_arg arg; arg.type = GRPC_ARG_INTEGER; arg.key = const_cast<char*>(GRPC_ARG_MAX_METADATA_SIZE); - arg.value.integer = (int)large_size + 1024; + arg.value.integer = static_cast<int>(large_size) + 1024; grpc_channel_args args = {1, &arg}; grpc_end2end_test_fixture f = begin_test(config, "test_request_with_large_metadata", &args, &args); @@ -160,7 +160,8 @@ static void test_request_with_large_metadata(grpc_end2end_test_config config) { op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), nullptr); + error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), tag(1), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); error = @@ -184,7 +185,8 @@ static void test_request_with_large_metadata(grpc_end2end_test_config config) { op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), nullptr); + error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), tag(102), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(102), 1); @@ -207,7 +209,8 @@ static void test_request_with_large_metadata(grpc_end2end_test_config config) { op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(103), nullptr); + error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), tag(103), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(103), 1); diff --git a/test/core/end2end/tests/load_reporting_hook.cc b/test/core/end2end/tests/load_reporting_hook.cc index cfe5814755..9e79d02be4 100644 --- a/test/core/end2end/tests/load_reporting_hook.cc +++ b/test/core/end2end/tests/load_reporting_hook.cc @@ -185,7 +185,8 @@ static void request_response_with_payload( op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), nullptr); + error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), tag(1), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); error = @@ -207,7 +208,8 @@ static void request_response_with_payload( op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), nullptr); + error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), tag(102), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(102), 1); @@ -235,7 +237,8 @@ static void request_response_with_payload( op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(103), nullptr); + error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), tag(103), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(103), 1); diff --git a/test/core/end2end/tests/max_concurrent_streams.cc b/test/core/end2end/tests/max_concurrent_streams.cc index 642c0f7ce6..789b3d4b77 100644 --- a/test/core/end2end/tests/max_concurrent_streams.cc +++ b/test/core/end2end/tests/max_concurrent_streams.cc @@ -135,7 +135,8 @@ static void simple_request_body(grpc_end2end_test_config config, op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), nullptr); + error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), tag(1), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); error = @@ -165,7 +166,8 @@ static void simple_request_body(grpc_end2end_test_config config, op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), nullptr); + error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), tag(102), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(102), 1); @@ -274,7 +276,8 @@ static void test_max_concurrent_streams(grpc_end2end_test_config config) { op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(c1, ops, (size_t)(op - ops), tag(301), nullptr); + error = grpc_call_start_batch(c1, ops, static_cast<size_t>(op - ops), + tag(301), nullptr); GPR_ASSERT(GRPC_CALL_OK == error); memset(ops, 0, sizeof(ops)); @@ -292,7 +295,8 @@ static void test_max_concurrent_streams(grpc_end2end_test_config config) { op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(c1, ops, (size_t)(op - ops), tag(302), nullptr); + error = grpc_call_start_batch(c1, ops, static_cast<size_t>(op - ops), + tag(302), nullptr); GPR_ASSERT(GRPC_CALL_OK == error); memset(ops, 0, sizeof(ops)); @@ -306,7 +310,8 @@ static void test_max_concurrent_streams(grpc_end2end_test_config config) { op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(c2, ops, (size_t)(op - ops), tag(401), nullptr); + error = grpc_call_start_batch(c2, ops, static_cast<size_t>(op - ops), + tag(401), nullptr); GPR_ASSERT(GRPC_CALL_OK == error); memset(ops, 0, sizeof(ops)); @@ -324,7 +329,8 @@ static void test_max_concurrent_streams(grpc_end2end_test_config config) { op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(c2, ops, (size_t)(op - ops), tag(402), nullptr); + error = grpc_call_start_batch(c2, ops, static_cast<size_t>(op - ops), + tag(402), nullptr); GPR_ASSERT(GRPC_CALL_OK == error); got_client_start = 0; @@ -345,7 +351,7 @@ static void test_max_concurrent_streams(grpc_end2end_test_config config) { * both); * check this here */ /* We'll get tag 303 or 403, we want 300, 400 */ - live_call = ((int)(intptr_t)ev.tag) - 1; + live_call = (static_cast<int>((intptr_t)ev.tag)) - 1; got_client_start = 1; } } @@ -371,7 +377,8 @@ static void test_max_concurrent_streams(grpc_end2end_test_config config) { op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(s1, ops, (size_t)(op - ops), tag(102), nullptr); + error = grpc_call_start_batch(s1, ops, static_cast<size_t>(op - ops), + tag(102), nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(102), 1); @@ -408,7 +415,8 @@ static void test_max_concurrent_streams(grpc_end2end_test_config config) { op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(s2, ops, (size_t)(op - ops), tag(202), nullptr); + error = grpc_call_start_batch(s2, ops, static_cast<size_t>(op - ops), + tag(202), nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(live_call + 2), 1); @@ -514,7 +522,8 @@ static void test_max_concurrent_streams_with_timeout_on_first( op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(c1, ops, (size_t)(op - ops), tag(301), nullptr); + error = grpc_call_start_batch(c1, ops, static_cast<size_t>(op - ops), + tag(301), nullptr); GPR_ASSERT(GRPC_CALL_OK == error); memset(ops, 0, sizeof(ops)); @@ -532,7 +541,8 @@ static void test_max_concurrent_streams_with_timeout_on_first( op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(c1, ops, (size_t)(op - ops), tag(302), nullptr); + error = grpc_call_start_batch(c1, ops, static_cast<size_t>(op - ops), + tag(302), nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(101), 1); @@ -550,7 +560,8 @@ static void test_max_concurrent_streams_with_timeout_on_first( op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(c2, ops, (size_t)(op - ops), tag(401), nullptr); + error = grpc_call_start_batch(c2, ops, static_cast<size_t>(op - ops), + tag(401), nullptr); GPR_ASSERT(GRPC_CALL_OK == error); memset(ops, 0, sizeof(ops)); @@ -568,7 +579,8 @@ static void test_max_concurrent_streams_with_timeout_on_first( op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(c2, ops, (size_t)(op - ops), tag(402), nullptr); + error = grpc_call_start_batch(c2, ops, static_cast<size_t>(op - ops), + tag(402), nullptr); GPR_ASSERT(GRPC_CALL_OK == error); grpc_call_details_destroy(&call_details); @@ -603,7 +615,8 @@ static void test_max_concurrent_streams_with_timeout_on_first( op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(s2, ops, (size_t)(op - ops), tag(202), nullptr); + error = grpc_call_start_batch(s2, ops, static_cast<size_t>(op - ops), + tag(202), nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(402), 1); @@ -709,7 +722,8 @@ static void test_max_concurrent_streams_with_timeout_on_second( op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(c1, ops, (size_t)(op - ops), tag(301), nullptr); + error = grpc_call_start_batch(c1, ops, static_cast<size_t>(op - ops), + tag(301), nullptr); GPR_ASSERT(GRPC_CALL_OK == error); memset(ops, 0, sizeof(ops)); @@ -727,7 +741,8 @@ static void test_max_concurrent_streams_with_timeout_on_second( op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(c1, ops, (size_t)(op - ops), tag(302), nullptr); + error = grpc_call_start_batch(c1, ops, static_cast<size_t>(op - ops), + tag(302), nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(101), 1); @@ -745,7 +760,8 @@ static void test_max_concurrent_streams_with_timeout_on_second( op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(c2, ops, (size_t)(op - ops), tag(401), nullptr); + error = grpc_call_start_batch(c2, ops, static_cast<size_t>(op - ops), + tag(401), nullptr); GPR_ASSERT(GRPC_CALL_OK == error); memset(ops, 0, sizeof(ops)); @@ -763,7 +779,8 @@ static void test_max_concurrent_streams_with_timeout_on_second( op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(c2, ops, (size_t)(op - ops), tag(402), nullptr); + error = grpc_call_start_batch(c2, ops, static_cast<size_t>(op - ops), + tag(402), nullptr); GPR_ASSERT(GRPC_CALL_OK == error); /* the second request is time out*/ @@ -796,7 +813,8 @@ static void test_max_concurrent_streams_with_timeout_on_second( op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(s1, ops, (size_t)(op - ops), tag(102), nullptr); + error = grpc_call_start_batch(s1, ops, static_cast<size_t>(op - ops), + tag(102), nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(302), 1); diff --git a/test/core/end2end/tests/max_connection_age.cc b/test/core/end2end/tests/max_connection_age.cc index df5fd5cc1e..e494dad19c 100644 --- a/test/core/end2end/tests/max_connection_age.cc +++ b/test/core/end2end/tests/max_connection_age.cc @@ -145,7 +145,8 @@ static void test_max_age_forcibly_close(grpc_end2end_test_config config) { op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), nullptr); + error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), tag(1), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); error = @@ -156,7 +157,8 @@ static void test_max_age_forcibly_close(grpc_end2end_test_config config) { cq_verify(cqv); gpr_timespec expect_shutdown_time = grpc_timeout_milliseconds_to_deadline( - (int)(MAX_CONNECTION_AGE_MS * MAX_CONNECTION_AGE_JITTER_MULTIPLIER) + + static_cast<int>(MAX_CONNECTION_AGE_MS * + MAX_CONNECTION_AGE_JITTER_MULTIPLIER) + MAX_CONNECTION_AGE_GRACE_MS + IMMEDIATE_SHUTDOWN_GRACE_TIME_MS); /* Wait for the channel to reach its max age */ @@ -190,7 +192,8 @@ static void test_max_age_forcibly_close(grpc_end2end_test_config config) { op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), nullptr); + error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), tag(102), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(102), true); cq_verify(cqv); @@ -288,7 +291,8 @@ static void test_max_age_gracefully_close(grpc_end2end_test_config config) { op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), nullptr); + error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), tag(1), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); error = @@ -325,7 +329,8 @@ static void test_max_age_gracefully_close(grpc_end2end_test_config config) { op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), nullptr); + error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), tag(102), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(102), true); diff --git a/test/core/end2end/tests/max_connection_idle.cc b/test/core/end2end/tests/max_connection_idle.cc index 09b4a54df3..2f212b965f 100644 --- a/test/core/end2end/tests/max_connection_idle.cc +++ b/test/core/end2end/tests/max_connection_idle.cc @@ -100,7 +100,8 @@ static void simple_request_body(grpc_end2end_test_config config, op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), nullptr); + error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), tag(1), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); error = @@ -139,7 +140,8 @@ static void simple_request_body(grpc_end2end_test_config config, op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), nullptr); + error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), tag(102), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(102), 1); diff --git a/test/core/end2end/tests/max_message_length.cc b/test/core/end2end/tests/max_message_length.cc index b1757a9b0d..3dd1737793 100644 --- a/test/core/end2end/tests/max_message_length.cc +++ b/test/core/end2end/tests/max_message_length.cc @@ -219,7 +219,8 @@ static void test_max_message_length_on_request(grpc_end2end_test_config config, op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), nullptr); + error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), tag(1), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); if (send_limit) { @@ -247,7 +248,8 @@ static void test_max_message_length_on_request(grpc_end2end_test_config config, op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), nullptr); + error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), tag(102), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(102), 1); @@ -408,7 +410,8 @@ static void test_max_message_length_on_response(grpc_end2end_test_config config, op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), nullptr); + error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), tag(1), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); error = @@ -443,7 +446,8 @@ static void test_max_message_length_on_response(grpc_end2end_test_config config, op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), nullptr); + error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), tag(102), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(102), 1); diff --git a/test/core/end2end/tests/network_status_change.cc b/test/core/end2end/tests/network_status_change.cc index 809f8ffb5c..83cb172f26 100644 --- a/test/core/end2end/tests/network_status_change.cc +++ b/test/core/end2end/tests/network_status_change.cc @@ -150,7 +150,8 @@ static void test_invoke_network_status_change(grpc_end2end_test_config config) { op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), nullptr); + error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), tag(1), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call( @@ -170,7 +171,8 @@ static void test_invoke_network_status_change(grpc_end2end_test_config config) { op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), nullptr); + error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), tag(102), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(102), 1); @@ -193,7 +195,8 @@ static void test_invoke_network_status_change(grpc_end2end_test_config config) { op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(103), nullptr); + error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), tag(103), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(103), 1); diff --git a/test/core/end2end/tests/no_logging.cc b/test/core/end2end/tests/no_logging.cc index b4908d4926..b357e3b0ad 100644 --- a/test/core/end2end/tests/no_logging.cc +++ b/test/core/end2end/tests/no_logging.cc @@ -170,7 +170,8 @@ static void simple_request_body(grpc_end2end_test_config config, op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), nullptr); + error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), tag(1), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); error = @@ -207,7 +208,8 @@ static void simple_request_body(grpc_end2end_test_config config, op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), nullptr); + error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), tag(102), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(102), 1); diff --git a/test/core/end2end/tests/payload.cc b/test/core/end2end/tests/payload.cc index 3535d802e9..340c76e173 100644 --- a/test/core/end2end/tests/payload.cc +++ b/test/core/end2end/tests/payload.cc @@ -90,9 +90,9 @@ static grpc_slice generate_random_slice() { static const char chars[] = "abcdefghijklmnopqrstuvwxyz1234567890"; char* output; const size_t output_size = 1024 * 1024; - output = (char*)gpr_malloc(output_size); + output = static_cast<char*>(gpr_malloc(output_size)); for (i = 0; i < output_size - 1; ++i) { - output[i] = chars[rand() % (int)(sizeof(chars) - 1)]; + output[i] = chars[rand() % static_cast<int>(sizeof(chars) - 1)]; } output[output_size - 1] = '\0'; grpc_slice out = grpc_slice_from_copied_string(output); @@ -174,7 +174,8 @@ static void request_response_with_payload(grpc_end2end_test_config config, op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), nullptr); + error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), tag(1), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); error = @@ -196,7 +197,8 @@ static void request_response_with_payload(grpc_end2end_test_config config, op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), nullptr); + error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), tag(102), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(102), 1); @@ -222,7 +224,8 @@ static void request_response_with_payload(grpc_end2end_test_config config, op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(103), nullptr); + error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), tag(103), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(103), 1); diff --git a/test/core/end2end/tests/ping_pong_streaming.cc b/test/core/end2end/tests/ping_pong_streaming.cc index 714a7681b2..9ca880481f 100644 --- a/test/core/end2end/tests/ping_pong_streaming.cc +++ b/test/core/end2end/tests/ping_pong_streaming.cc @@ -143,7 +143,8 @@ static void test_pingpong_streaming(grpc_end2end_test_config config, op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), nullptr); + error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), tag(1), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); error = @@ -165,7 +166,8 @@ static void test_pingpong_streaming(grpc_end2end_test_config config, op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(101), nullptr); + error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), tag(101), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); for (i = 0; i < messages; i++) { @@ -184,7 +186,8 @@ static void test_pingpong_streaming(grpc_end2end_test_config config, op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(2), nullptr); + error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), tag(2), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); memset(ops, 0, sizeof(ops)); @@ -194,8 +197,8 @@ static void test_pingpong_streaming(grpc_end2end_test_config config, op->flags = 0; op->reserved = nullptr; op++; - error = - grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), nullptr); + error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), + tag(102), nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(102), 1); cq_verify(cqv); @@ -207,8 +210,8 @@ static void test_pingpong_streaming(grpc_end2end_test_config config, op->flags = 0; op->reserved = nullptr; op++; - error = - grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(103), nullptr); + error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), + tag(103), nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(103), 1); CQ_EXPECT_COMPLETION(cqv, tag(2), 1); @@ -229,7 +232,8 @@ static void test_pingpong_streaming(grpc_end2end_test_config config, op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(3), nullptr); + error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), tag(3), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); memset(ops, 0, sizeof(ops)); @@ -242,7 +246,8 @@ static void test_pingpong_streaming(grpc_end2end_test_config config, op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(104), nullptr); + error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), tag(104), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(1), 1); diff --git a/test/core/end2end/tests/proxy_auth.cc b/test/core/end2end/tests/proxy_auth.cc index c34505c878..5a2e0ef414 100644 --- a/test/core/end2end/tests/proxy_auth.cc +++ b/test/core/end2end/tests/proxy_auth.cc @@ -148,7 +148,8 @@ static void simple_request_body(grpc_end2end_test_config config, op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), nullptr); + error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), tag(1), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); error = @@ -187,7 +188,8 @@ static void simple_request_body(grpc_end2end_test_config config, op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), nullptr); + error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), tag(102), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(102), 1); diff --git a/test/core/end2end/tests/registered_call.cc b/test/core/end2end/tests/registered_call.cc index d1c37dca20..d4ca146707 100644 --- a/test/core/end2end/tests/registered_call.cc +++ b/test/core/end2end/tests/registered_call.cc @@ -135,7 +135,8 @@ static void simple_request_body(grpc_end2end_test_config config, op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), nullptr); + error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), tag(1), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); error = @@ -165,7 +166,8 @@ static void simple_request_body(grpc_end2end_test_config config, op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), nullptr); + error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), tag(102), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(102), 1); diff --git a/test/core/end2end/tests/request_with_flags.cc b/test/core/end2end/tests/request_with_flags.cc index 46023133ba..4a54318d0f 100644 --- a/test/core/end2end/tests/request_with_flags.cc +++ b/test/core/end2end/tests/request_with_flags.cc @@ -151,7 +151,8 @@ static void test_invoke_request_with_flags( op->reserved = nullptr; op++; expectation = call_start_batch_expected_result; - error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), nullptr); + error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), tag(1), + nullptr); GPR_ASSERT(expectation == error); if (expectation == GRPC_CALL_OK) { diff --git a/test/core/end2end/tests/request_with_payload.cc b/test/core/end2end/tests/request_with_payload.cc index 28818c80e7..44398df52d 100644 --- a/test/core/end2end/tests/request_with_payload.cc +++ b/test/core/end2end/tests/request_with_payload.cc @@ -147,7 +147,8 @@ static void test_invoke_request_with_payload(grpc_end2end_test_config config) { op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), nullptr); + error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), tag(1), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call( @@ -168,7 +169,8 @@ static void test_invoke_request_with_payload(grpc_end2end_test_config config) { op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), nullptr); + error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), tag(102), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(102), 1); @@ -189,7 +191,8 @@ static void test_invoke_request_with_payload(grpc_end2end_test_config config) { op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(103), nullptr); + error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), tag(103), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(103), 1); diff --git a/test/core/end2end/tests/resource_quota_server.cc b/test/core/end2end/tests/resource_quota_server.cc index 6d35d086aa..33d6b4ef31 100644 --- a/test/core/end2end/tests/resource_quota_server.cc +++ b/test/core/end2end/tests/resource_quota_server.cc @@ -91,9 +91,9 @@ static grpc_slice generate_random_slice() { static const char chars[] = "abcdefghijklmnopqrstuvwxyz1234567890"; char* output; const size_t output_size = 1024 * 1024; - output = (char*)gpr_malloc(output_size); + output = static_cast<char*>(gpr_malloc(output_size)); for (i = 0; i < output_size - 1; ++i) { - output[i] = chars[rand() % (int)(sizeof(chars) - 1)]; + output[i] = chars[rand() % static_cast<int>(sizeof(chars) - 1)]; } output[output_size - 1] = '\0'; grpc_slice out = grpc_slice_from_copied_string(output); @@ -132,25 +132,29 @@ void resource_quota_server(grpc_end2end_test_config config) { grpc_slice request_payload_slice = generate_random_slice(); grpc_call** client_calls = - (grpc_call**)malloc(sizeof(grpc_call*) * NUM_CALLS); + static_cast<grpc_call**>(malloc(sizeof(grpc_call*) * NUM_CALLS)); grpc_call** server_calls = - (grpc_call**)malloc(sizeof(grpc_call*) * NUM_CALLS); + static_cast<grpc_call**>(malloc(sizeof(grpc_call*) * NUM_CALLS)); grpc_metadata_array* initial_metadata_recv = - (grpc_metadata_array*)malloc(sizeof(grpc_metadata_array) * NUM_CALLS); + static_cast<grpc_metadata_array*>( + malloc(sizeof(grpc_metadata_array) * NUM_CALLS)); grpc_metadata_array* trailing_metadata_recv = - (grpc_metadata_array*)malloc(sizeof(grpc_metadata_array) * NUM_CALLS); + static_cast<grpc_metadata_array*>( + malloc(sizeof(grpc_metadata_array) * NUM_CALLS)); grpc_metadata_array* request_metadata_recv = - (grpc_metadata_array*)malloc(sizeof(grpc_metadata_array) * NUM_CALLS); - grpc_call_details* call_details = - (grpc_call_details*)malloc(sizeof(grpc_call_details) * NUM_CALLS); - grpc_status_code* status = - (grpc_status_code*)malloc(sizeof(grpc_status_code) * NUM_CALLS); - grpc_slice* details = (grpc_slice*)malloc(sizeof(grpc_slice) * NUM_CALLS); - grpc_byte_buffer** request_payload = - (grpc_byte_buffer**)malloc(sizeof(grpc_byte_buffer*) * NUM_CALLS); - grpc_byte_buffer** request_payload_recv = - (grpc_byte_buffer**)malloc(sizeof(grpc_byte_buffer*) * NUM_CALLS); - int* was_cancelled = (int*)malloc(sizeof(int) * NUM_CALLS); + static_cast<grpc_metadata_array*>( + malloc(sizeof(grpc_metadata_array) * NUM_CALLS)); + grpc_call_details* call_details = static_cast<grpc_call_details*>( + malloc(sizeof(grpc_call_details) * NUM_CALLS)); + grpc_status_code* status = static_cast<grpc_status_code*>( + malloc(sizeof(grpc_status_code) * NUM_CALLS)); + grpc_slice* details = + static_cast<grpc_slice*>(malloc(sizeof(grpc_slice) * NUM_CALLS)); + grpc_byte_buffer** request_payload = static_cast<grpc_byte_buffer**>( + malloc(sizeof(grpc_byte_buffer*) * NUM_CALLS)); + grpc_byte_buffer** request_payload_recv = static_cast<grpc_byte_buffer**>( + malloc(sizeof(grpc_byte_buffer*) * NUM_CALLS)); + int* was_cancelled = static_cast<int*>(malloc(sizeof(int) * NUM_CALLS)); grpc_call_error error; int pending_client_calls = 0; int pending_server_start_calls = 0; @@ -220,7 +224,8 @@ void resource_quota_server(grpc_end2end_test_config config) { op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(client_calls[i], ops, (size_t)(op - ops), + error = grpc_call_start_batch(client_calls[i], ops, + static_cast<size_t>(op - ops), tag(CLIENT_BASE_TAG + i), nullptr); GPR_ASSERT(GRPC_CALL_OK == error); @@ -234,7 +239,7 @@ void resource_quota_server(grpc_end2end_test_config config) { 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; + int ev_tag = static_cast<int>((intptr_t)ev.tag); if (ev_tag < CLIENT_BASE_TAG) { abort(); /* illegal tag */ } else if (ev_tag < SERVER_START_BASE_TAG) { @@ -285,9 +290,9 @@ void resource_quota_server(grpc_end2end_test_config config) { op->flags = 0; 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), nullptr); + error = grpc_call_start_batch( + server_calls[call_id], ops, static_cast<size_t>(op - ops), + tag(SERVER_RECV_BASE_TAG + call_id), nullptr); GPR_ASSERT(GRPC_CALL_OK == error); GPR_ASSERT(pending_server_start_calls > 0); @@ -326,9 +331,9 @@ void resource_quota_server(grpc_end2end_test_config config) { op->flags = 0; 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), nullptr); + error = grpc_call_start_batch( + server_calls[call_id], ops, static_cast<size_t>(op - ops), + tag(SERVER_END_BASE_TAG + call_id), nullptr); GPR_ASSERT(GRPC_CALL_OK == error); GPR_ASSERT(pending_server_recv_calls > 0); diff --git a/test/core/end2end/tests/server_finishes_request.cc b/test/core/end2end/tests/server_finishes_request.cc index f135851f86..6fc06cfaa1 100644 --- a/test/core/end2end/tests/server_finishes_request.cc +++ b/test/core/end2end/tests/server_finishes_request.cc @@ -133,7 +133,8 @@ static void simple_request_body(grpc_end2end_test_config config, op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), nullptr); + error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), tag(1), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); error = @@ -163,7 +164,8 @@ static void simple_request_body(grpc_end2end_test_config config, op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), nullptr); + error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), tag(102), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(102), 1); diff --git a/test/core/end2end/tests/shutdown_finishes_calls.cc b/test/core/end2end/tests/shutdown_finishes_calls.cc index 2e19e059ae..34c4ebbf0a 100644 --- a/test/core/end2end/tests/shutdown_finishes_calls.cc +++ b/test/core/end2end/tests/shutdown_finishes_calls.cc @@ -128,7 +128,8 @@ static void test_early_server_shutdown_finishes_inflight_calls( op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), nullptr); + error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), tag(1), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); error = @@ -145,7 +146,8 @@ static void test_early_server_shutdown_finishes_inflight_calls( op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), nullptr); + error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), tag(102), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); /* shutdown and destroy the server */ diff --git a/test/core/end2end/tests/shutdown_finishes_tags.cc b/test/core/end2end/tests/shutdown_finishes_tags.cc index d160647295..55caacb7ff 100644 --- a/test/core/end2end/tests/shutdown_finishes_tags.cc +++ b/test/core/end2end/tests/shutdown_finishes_tags.cc @@ -77,7 +77,7 @@ static void test_early_server_shutdown_finishes_tags( grpc_end2end_test_fixture f = begin_test( config, "test_early_server_shutdown_finishes_tags", nullptr, nullptr); cq_verifier* cqv = cq_verifier_create(f.cq); - grpc_call* s = (grpc_call*)(uintptr_t)1; + grpc_call* s = (grpc_call*)static_cast<uintptr_t>(1); grpc_call_details call_details; grpc_metadata_array request_metadata_recv; diff --git a/test/core/end2end/tests/simple_cacheable_request.cc b/test/core/end2end/tests/simple_cacheable_request.cc index b4732aed3f..4ae8398a6e 100644 --- a/test/core/end2end/tests/simple_cacheable_request.cc +++ b/test/core/end2end/tests/simple_cacheable_request.cc @@ -178,7 +178,8 @@ static void test_cacheable_request_response_with_metadata_and_payload( op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), nullptr); + error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), tag(1), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); error = @@ -201,7 +202,8 @@ static void test_cacheable_request_response_with_metadata_and_payload( op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), nullptr); + error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), tag(102), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(102), 1); @@ -227,7 +229,8 @@ static void test_cacheable_request_response_with_metadata_and_payload( op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(103), nullptr); + error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), tag(103), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(103), 1); diff --git a/test/core/end2end/tests/simple_delayed_request.cc b/test/core/end2end/tests/simple_delayed_request.cc index 54517fb242..f8a1ddfdc3 100644 --- a/test/core/end2end/tests/simple_delayed_request.cc +++ b/test/core/end2end/tests/simple_delayed_request.cc @@ -129,7 +129,8 @@ static void simple_delayed_request_body(grpc_end2end_test_config config, op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), nullptr); + error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), tag(1), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); error = @@ -159,7 +160,8 @@ static void simple_delayed_request_body(grpc_end2end_test_config config, op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), nullptr); + error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), tag(102), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(102), 1); diff --git a/test/core/end2end/tests/simple_metadata.cc b/test/core/end2end/tests/simple_metadata.cc index 5911834c91..1f39f8983b 100644 --- a/test/core/end2end/tests/simple_metadata.cc +++ b/test/core/end2end/tests/simple_metadata.cc @@ -176,7 +176,8 @@ static void test_request_response_with_metadata_and_payload( op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), nullptr); + error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), tag(1), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); error = @@ -199,7 +200,8 @@ static void test_request_response_with_metadata_and_payload( op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), nullptr); + error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), tag(102), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(102), 1); @@ -225,7 +227,8 @@ static void test_request_response_with_metadata_and_payload( op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(103), nullptr); + error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), tag(103), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(103), 1); diff --git a/test/core/end2end/tests/simple_request.cc b/test/core/end2end/tests/simple_request.cc index 6ec4a14959..926e2c7452 100644 --- a/test/core/end2end/tests/simple_request.cc +++ b/test/core/end2end/tests/simple_request.cc @@ -152,7 +152,8 @@ static void simple_request_body(grpc_end2end_test_config config, op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), nullptr); + error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), tag(1), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); error = @@ -191,7 +192,8 @@ static void simple_request_body(grpc_end2end_test_config config, op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), nullptr); + error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), tag(102), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(102), 1); diff --git a/test/core/end2end/tests/stream_compression_compressed_payload.cc b/test/core/end2end/tests/stream_compression_compressed_payload.cc index 637b7b2422..e90d54f054 100644 --- a/test/core/end2end/tests/stream_compression_compressed_payload.cc +++ b/test/core/end2end/tests/stream_compression_compressed_payload.cc @@ -187,7 +187,8 @@ static void request_for_disabled_algorithm( op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), nullptr); + error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), tag(1), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(101), true); @@ -205,7 +206,8 @@ static void request_for_disabled_algorithm( op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), nullptr); + error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), tag(102), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(102), false); @@ -216,7 +218,8 @@ static void request_for_disabled_algorithm( op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(103), nullptr); + error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), tag(103), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(103), true); @@ -345,7 +348,8 @@ static void request_with_payload_template( op->flags = client_send_flags_bitmask; op->reserved = nullptr; op++; - error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(2), nullptr); + error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), tag(2), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(2), true); } @@ -374,7 +378,8 @@ static void request_with_payload_template( op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), nullptr); + error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), tag(1), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); error = @@ -414,7 +419,8 @@ static void request_with_payload_template( op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(101), nullptr); + error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), tag(101), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); for (int i = 0; i < 2; i++) { @@ -429,8 +435,8 @@ static void request_with_payload_template( op->flags = client_send_flags_bitmask; op->reserved = nullptr; op++; - error = - grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(2), nullptr); + error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), + tag(2), nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(2), 1); } @@ -442,8 +448,8 @@ static void request_with_payload_template( op->flags = 0; op->reserved = nullptr; op++; - error = - grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), nullptr); + error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), + tag(102), nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(102), 1); @@ -459,8 +465,8 @@ static void request_with_payload_template( op->flags = 0; op->reserved = nullptr; op++; - error = - grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(103), nullptr); + error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), + tag(103), nullptr); GPR_ASSERT(GRPC_CALL_OK == error); memset(ops, 0, sizeof(ops)); @@ -470,7 +476,8 @@ static void request_with_payload_template( op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(3), nullptr); + error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), tag(3), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(103), 1); @@ -495,7 +502,8 @@ static void request_with_payload_template( op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(4), nullptr); + error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), tag(4), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); memset(ops, 0, sizeof(ops)); @@ -508,7 +516,8 @@ static void request_with_payload_template( op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(104), nullptr); + error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), tag(104), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(1), 1); diff --git a/test/core/end2end/tests/stream_compression_payload.cc b/test/core/end2end/tests/stream_compression_payload.cc index 6abb3bbf5d..9eace97afd 100644 --- a/test/core/end2end/tests/stream_compression_payload.cc +++ b/test/core/end2end/tests/stream_compression_payload.cc @@ -93,9 +93,9 @@ static grpc_slice generate_random_slice() { static const char chars[] = "abcdefghijklmnopqrstuvwxyz1234567890"; char* output; const size_t output_size = 1024 * 1024; - output = (char*)gpr_malloc(output_size); + output = static_cast<char*>(gpr_malloc(output_size)); for (i = 0; i < output_size - 1; ++i) { - output[i] = chars[rand() % (int)(sizeof(chars) - 1)]; + output[i] = chars[rand() % static_cast<int>(sizeof(chars) - 1)]; } output[output_size - 1] = '\0'; grpc_slice out = grpc_slice_from_copied_string(output); @@ -177,7 +177,8 @@ static void request_response_with_payload(grpc_end2end_test_config config, op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), nullptr); + error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), tag(1), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); error = @@ -199,7 +200,8 @@ static void request_response_with_payload(grpc_end2end_test_config config, op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), nullptr); + error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), tag(102), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(102), 1); @@ -225,7 +227,8 @@ static void request_response_with_payload(grpc_end2end_test_config config, op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(103), nullptr); + error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), tag(103), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(103), 1); diff --git a/test/core/end2end/tests/stream_compression_ping_pong_streaming.cc b/test/core/end2end/tests/stream_compression_ping_pong_streaming.cc index 8242c2cdd1..5b033292b0 100644 --- a/test/core/end2end/tests/stream_compression_ping_pong_streaming.cc +++ b/test/core/end2end/tests/stream_compression_ping_pong_streaming.cc @@ -151,7 +151,8 @@ static void test_pingpong_streaming(grpc_end2end_test_config config, op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), nullptr); + error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), tag(1), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); error = @@ -173,7 +174,8 @@ static void test_pingpong_streaming(grpc_end2end_test_config config, op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(101), nullptr); + error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), tag(101), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); for (i = 0; i < messages; i++) { @@ -192,7 +194,8 @@ static void test_pingpong_streaming(grpc_end2end_test_config config, op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(2), nullptr); + error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), tag(2), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); memset(ops, 0, sizeof(ops)); @@ -202,8 +205,8 @@ static void test_pingpong_streaming(grpc_end2end_test_config config, op->flags = 0; op->reserved = nullptr; op++; - error = - grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), nullptr); + error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), + tag(102), nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(102), 1); cq_verify(cqv); @@ -215,8 +218,8 @@ static void test_pingpong_streaming(grpc_end2end_test_config config, op->flags = 0; op->reserved = nullptr; op++; - error = - grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(103), nullptr); + error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), + tag(103), nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(103), 1); CQ_EXPECT_COMPLETION(cqv, tag(2), 1); @@ -237,7 +240,8 @@ static void test_pingpong_streaming(grpc_end2end_test_config config, op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(3), nullptr); + error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), tag(3), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); memset(ops, 0, sizeof(ops)); @@ -250,7 +254,8 @@ static void test_pingpong_streaming(grpc_end2end_test_config config, op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(104), nullptr); + error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), tag(104), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(1), 1); diff --git a/test/core/end2end/tests/streaming_error_response.cc b/test/core/end2end/tests/streaming_error_response.cc index 167530a6ae..7c7d778d1e 100644 --- a/test/core/end2end/tests/streaming_error_response.cc +++ b/test/core/end2end/tests/streaming_error_response.cc @@ -148,7 +148,8 @@ static void test(grpc_end2end_test_config config, bool request_status_early) { op->data.recv_status_on_client.status_details = &details; op++; } - error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), nullptr); + error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), tag(1), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call( @@ -165,7 +166,8 @@ static void test(grpc_end2end_test_config config, bool request_status_early) { op->op = GRPC_OP_SEND_MESSAGE; op->data.send_message.send_message = response_payload1; op++; - error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), nullptr); + error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), tag(102), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(102), 1); @@ -179,7 +181,8 @@ static void test(grpc_end2end_test_config config, bool request_status_early) { op->op = GRPC_OP_SEND_MESSAGE; op->data.send_message.send_message = response_payload2; op++; - error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(103), nullptr); + error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), tag(103), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(103), 1); @@ -190,7 +193,8 @@ static void test(grpc_end2end_test_config config, bool request_status_early) { op->op = GRPC_OP_RECV_MESSAGE; op->data.recv_message.recv_message = &response_payload2_recv; op++; - error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(2), nullptr); + error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), tag(2), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(2), 1); @@ -208,7 +212,8 @@ static void test(grpc_end2end_test_config config, bool request_status_early) { grpc_slice status_details = grpc_slice_from_static_string("xyz"); op->data.send_status_from_server.status_details = &status_details; op++; - error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(104), nullptr); + error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), tag(104), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(104), 1); @@ -225,7 +230,8 @@ static void test(grpc_end2end_test_config config, bool request_status_early) { op->data.recv_status_on_client.status = &status; op->data.recv_status_on_client.status_details = &details; op++; - error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(3), nullptr); + error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), tag(3), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(3), 1); diff --git a/test/core/end2end/tests/trailing_metadata.cc b/test/core/end2end/tests/trailing_metadata.cc index 150c1cbd51..24069854ac 100644 --- a/test/core/end2end/tests/trailing_metadata.cc +++ b/test/core/end2end/tests/trailing_metadata.cc @@ -184,7 +184,8 @@ static void test_request_response_with_metadata_and_payload( op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), nullptr); + error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), tag(1), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); error = @@ -207,7 +208,8 @@ static void test_request_response_with_metadata_and_payload( op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), nullptr); + error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), tag(102), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(102), 1); @@ -234,7 +236,8 @@ static void test_request_response_with_metadata_and_payload( op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(103), nullptr); + error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), tag(103), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(103), 1); diff --git a/test/core/end2end/tests/workaround_cronet_compression.cc b/test/core/end2end/tests/workaround_cronet_compression.cc index edf03d8ffc..4d4c369a42 100644 --- a/test/core/end2end/tests/workaround_cronet_compression.cc +++ b/test/core/end2end/tests/workaround_cronet_compression.cc @@ -191,7 +191,8 @@ static void request_with_payload_template( op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), nullptr); + error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), tag(1), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); error = @@ -227,7 +228,8 @@ static void request_with_payload_template( op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(101), nullptr); + error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), tag(101), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); for (int i = 0; i < 2; i++) { @@ -246,7 +248,8 @@ static void request_with_payload_template( op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(2), nullptr); + error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), tag(2), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); memset(ops, 0, sizeof(ops)); @@ -256,8 +259,8 @@ static void request_with_payload_template( op->flags = 0; op->reserved = nullptr; op++; - error = - grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), nullptr); + error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), + tag(102), nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(102), 1); cq_verify(cqv); @@ -274,8 +277,8 @@ static void request_with_payload_template( op->flags = 0; op->reserved = nullptr; op++; - error = - grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(103), nullptr); + error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), + tag(103), nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(103), 1); CQ_EXPECT_COMPLETION(cqv, tag(2), 1); @@ -308,7 +311,8 @@ static void request_with_payload_template( op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(3), nullptr); + error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), tag(3), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); memset(ops, 0, sizeof(ops)); @@ -321,7 +325,8 @@ static void request_with_payload_template( op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(104), nullptr); + error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), tag(104), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(1), 1); diff --git a/test/core/end2end/tests/write_buffering.cc b/test/core/end2end/tests/write_buffering.cc index 7f3d1abc39..5d76d238b9 100644 --- a/test/core/end2end/tests/write_buffering.cc +++ b/test/core/end2end/tests/write_buffering.cc @@ -128,7 +128,8 @@ static void test_invoke_request_with_payload(grpc_end2end_test_config config) { op->op = GRPC_OP_SEND_INITIAL_METADATA; op->data.send_initial_metadata.count = 0; op++; - error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), nullptr); + error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), tag(1), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); memset(ops, 0, sizeof(ops)); @@ -138,7 +139,8 @@ static void test_invoke_request_with_payload(grpc_end2end_test_config config) { op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(2), nullptr); + error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), tag(2), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call( @@ -154,7 +156,8 @@ static void test_invoke_request_with_payload(grpc_end2end_test_config config) { op->data.send_message.send_message = request_payload1; op->flags = GRPC_WRITE_BUFFER_HINT; op++; - error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(3), nullptr); + error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), tag(3), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); memset(ops, 0, sizeof(ops)); @@ -162,7 +165,8 @@ static void test_invoke_request_with_payload(grpc_end2end_test_config config) { op->op = GRPC_OP_SEND_INITIAL_METADATA; op->data.send_initial_metadata.count = 0; op++; - error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), nullptr); + error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), tag(102), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); /* recv message should not succeed yet - it's buffered at the client still */ @@ -171,7 +175,8 @@ static void test_invoke_request_with_payload(grpc_end2end_test_config config) { op->op = GRPC_OP_RECV_MESSAGE; op->data.recv_message.recv_message = &request_payload_recv1; op++; - error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(103), nullptr); + error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), tag(103), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(2), true); @@ -186,7 +191,8 @@ static void test_invoke_request_with_payload(grpc_end2end_test_config config) { op->data.send_message.send_message = request_payload2; op->flags = 0; op++; - error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(4), nullptr); + error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), tag(4), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); /* now the first send should match up with the first recv */ @@ -200,7 +206,8 @@ static void test_invoke_request_with_payload(grpc_end2end_test_config config) { op->op = GRPC_OP_RECV_MESSAGE; op->data.recv_message.recv_message = &request_payload_recv2; op++; - error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(104), nullptr); + error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), tag(104), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(104), true); @@ -219,7 +226,8 @@ static void test_invoke_request_with_payload(grpc_end2end_test_config config) { op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(4), nullptr); + error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), tag(4), + nullptr); memset(ops, 0, sizeof(ops)); op = ops; @@ -236,7 +244,8 @@ static void test_invoke_request_with_payload(grpc_end2end_test_config config) { op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(105), nullptr); + error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), tag(105), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(105), 1); diff --git a/test/core/end2end/tests/write_buffering_at_end.cc b/test/core/end2end/tests/write_buffering_at_end.cc index a1fbfef3fc..bd046ef9cc 100644 --- a/test/core/end2end/tests/write_buffering_at_end.cc +++ b/test/core/end2end/tests/write_buffering_at_end.cc @@ -125,7 +125,8 @@ static void test_invoke_request_with_payload(grpc_end2end_test_config config) { op->op = GRPC_OP_SEND_INITIAL_METADATA; op->data.send_initial_metadata.count = 0; op++; - error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), nullptr); + error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), tag(1), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); memset(ops, 0, sizeof(ops)); @@ -135,7 +136,8 @@ static void test_invoke_request_with_payload(grpc_end2end_test_config config) { op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(2), nullptr); + error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), tag(2), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call( @@ -151,7 +153,8 @@ static void test_invoke_request_with_payload(grpc_end2end_test_config config) { op->data.send_message.send_message = request_payload; op->flags = GRPC_WRITE_BUFFER_HINT; op++; - error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(3), nullptr); + error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), tag(3), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); memset(ops, 0, sizeof(ops)); @@ -159,7 +162,8 @@ static void test_invoke_request_with_payload(grpc_end2end_test_config config) { op->op = GRPC_OP_SEND_INITIAL_METADATA; op->data.send_initial_metadata.count = 0; op++; - error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), nullptr); + error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), tag(102), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); /* recv message should not succeed yet - it's buffered at the client still */ @@ -168,7 +172,8 @@ static void test_invoke_request_with_payload(grpc_end2end_test_config config) { op->op = GRPC_OP_RECV_MESSAGE; op->data.recv_message.recv_message = &request_payload_recv1; op++; - error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(103), nullptr); + error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), tag(103), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(2), true); @@ -181,7 +186,8 @@ static void test_invoke_request_with_payload(grpc_end2end_test_config config) { op = ops; op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT; op++; - error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(4), nullptr); + error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), tag(4), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); /* now the first send should match up with the first recv */ @@ -195,7 +201,8 @@ static void test_invoke_request_with_payload(grpc_end2end_test_config config) { op->op = GRPC_OP_RECV_MESSAGE; op->data.recv_message.recv_message = &request_payload_recv2; op++; - error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(104), nullptr); + error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), tag(104), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(104), true); @@ -210,7 +217,8 @@ static void test_invoke_request_with_payload(grpc_end2end_test_config config) { op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(4), nullptr); + error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), tag(4), + nullptr); memset(ops, 0, sizeof(ops)); op = ops; @@ -227,7 +235,8 @@ static void test_invoke_request_with_payload(grpc_end2end_test_config config) { op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(105), nullptr); + error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), tag(105), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(105), 1); |