From de6ef448e4a4becbf9cd5e82d53a3f783ec8a368 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Tue, 23 Nov 2021 14:26:56 -0800 Subject: [PATCH] Fix cronet tests (#28189) --- .../tests/CronetTests/CoreCronetEnd2EndTests.mm | 14 +++++++------- .../iomgr/ios/CFStreamTests/CFStreamClientTests.mm | 4 ++-- .../ios/CFStreamTests/CFStreamEndpointTests.mm | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/objective-c/tests/CronetTests/CoreCronetEnd2EndTests.mm b/src/objective-c/tests/CronetTests/CoreCronetEnd2EndTests.mm index 6823da016ee..9adbef5261a 100644 --- a/src/objective-c/tests/CronetTests/CoreCronetEnd2EndTests.mm +++ b/src/objective-c/tests/CronetTests/CoreCronetEnd2EndTests.mm @@ -56,7 +56,7 @@ struct fullstack_secure_fixture_data { }; static grpc_end2end_test_fixture chttp2_create_fixture_secure_fullstack( - grpc_channel_args *client_args, grpc_channel_args *server_args) { + const grpc_channel_args *client_args, const grpc_channel_args *server_args) { grpc_end2end_test_fixture f; int port = grpc_pick_unused_port_or_die(); fullstack_secure_fixture_data *ffd = new fullstack_secure_fixture_data(); @@ -79,7 +79,7 @@ static void process_auth_failure(void *state, grpc_auth_context *ctx, const grpc } static void cronet_init_client_secure_fullstack(grpc_end2end_test_fixture *f, - grpc_channel_args *client_args, + const grpc_channel_args *client_args, stream_engine *cronetEngine) { fullstack_secure_fixture_data *ffd = (fullstack_secure_fixture_data *)f->fixture_data; f->client = @@ -88,7 +88,7 @@ static void cronet_init_client_secure_fullstack(grpc_end2end_test_fixture *f, } static void chttp2_init_server_secure_fullstack(grpc_end2end_test_fixture *f, - grpc_channel_args *server_args, + const grpc_channel_args *server_args, grpc_server_credentials *server_creds) { fullstack_secure_fixture_data *ffd = (fullstack_secure_fixture_data *)f->fixture_data; if (f->server) { @@ -107,16 +107,16 @@ static void chttp2_tear_down_secure_fullstack(grpc_end2end_test_fixture *f) { } static void cronet_init_client_simple_ssl_secure_fullstack(grpc_end2end_test_fixture *f, - grpc_channel_args *client_args) { + const grpc_channel_args *client_args) { grpc_core::ExecCtx exec_ctx; stream_engine *cronetEngine = [Cronet getGlobalEngine]; - grpc_channel_args *new_client_args = grpc_channel_args_copy(client_args); + const grpc_channel_args *new_client_args = grpc_channel_args_copy(client_args); cronet_init_client_secure_fullstack(f, new_client_args, cronetEngine); grpc_channel_args_destroy(new_client_args); } -static int fail_server_auth_check(grpc_channel_args *server_args) { +static int fail_server_auth_check(const grpc_channel_args *server_args) { size_t i; if (server_args == NULL) return 0; for (i = 0; i < server_args->num_args; i++) { @@ -128,7 +128,7 @@ static int fail_server_auth_check(grpc_channel_args *server_args) { } static void chttp2_init_server_simple_ssl_secure_fullstack(grpc_end2end_test_fixture *f, - grpc_channel_args *server_args) { + const grpc_channel_args *server_args) { grpc_ssl_pem_key_cert_pair pem_cert_key_pair = {test_server1_key, test_server1_cert}; grpc_server_credentials *ssl_creds = grpc_ssl_server_credentials_create(NULL, &pem_cert_key_pair, 1, 0, NULL); diff --git a/test/core/iomgr/ios/CFStreamTests/CFStreamClientTests.mm b/test/core/iomgr/ios/CFStreamTests/CFStreamClientTests.mm index 393770c8699..258d5bd09f6 100644 --- a/test/core/iomgr/ios/CFStreamTests/CFStreamClientTests.mm +++ b/test/core/iomgr/ios/CFStreamTests/CFStreamClientTests.mm @@ -103,7 +103,7 @@ static void must_fail(void* arg, grpc_error_handle error) { /* connect to it */ GPR_ASSERT(getsockname(svr_fd, (struct sockaddr*)addr, (socklen_t*)&resolved_addr.len) == 0); GRPC_CLOSURE_INIT(&done, must_succeed, nullptr, grpc_schedule_on_exec_ctx); - grpc_channel_args* args = + const grpc_channel_args* args = grpc_core::CoreConfiguration::Get().channel_args_preconditioning().PreconditionChannelArgs( nullptr); grpc_tcp_client_connect(&done, &g_connecting, nullptr, args, &resolved_addr, @@ -162,7 +162,7 @@ static void must_fail(void* arg, grpc_error_handle error) { /* connect to a broken address */ GRPC_CLOSURE_INIT(&done, must_fail, nullptr, grpc_schedule_on_exec_ctx); - grpc_channel_args* args = + const grpc_channel_args* args = grpc_core::CoreConfiguration::Get().channel_args_preconditioning().PreconditionChannelArgs( nullptr); grpc_tcp_client_connect(&done, &g_connecting, nullptr, args, &resolved_addr, diff --git a/test/core/iomgr/ios/CFStreamTests/CFStreamEndpointTests.mm b/test/core/iomgr/ios/CFStreamTests/CFStreamEndpointTests.mm index bf7cfc2dc71..95a64c00727 100644 --- a/test/core/iomgr/ios/CFStreamTests/CFStreamEndpointTests.mm +++ b/test/core/iomgr/ios/CFStreamTests/CFStreamEndpointTests.mm @@ -127,7 +127,7 @@ static bool compare_slice_buffer_with_buffer(grpc_slice_buffer *slices, const ch /* connect to it */ XCTAssertEqual(getsockname(svr_fd, (struct sockaddr *)addr, (socklen_t *)&resolved_addr.len), 0); init_event_closure(&done, &connected); - grpc_channel_args *args = + const grpc_channel_args *args = grpc_core::CoreConfiguration::Get().channel_args_preconditioning().PreconditionChannelArgs( nullptr); grpc_tcp_client_connect(&done, &ep_, nullptr, args, &resolved_addr, GRPC_MILLIS_INF_FUTURE);