Fix cronet tests (#28189)

pull/27308/head
Craig Tiller 3 years ago committed by GitHub
parent 46eae022cc
commit de6ef448e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 14
      src/objective-c/tests/CronetTests/CoreCronetEnd2EndTests.mm
  2. 4
      test/core/iomgr/ios/CFStreamTests/CFStreamClientTests.mm
  3. 2
      test/core/iomgr/ios/CFStreamTests/CFStreamEndpointTests.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);

@ -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,

@ -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);

Loading…
Cancel
Save