diff options
Diffstat (limited to 'test/core/surface')
-rw-r--r-- | test/core/surface/alarm_test.c | 8 | ||||
-rw-r--r-- | test/core/surface/completion_queue_test.c | 4 | ||||
-rw-r--r-- | test/core/surface/concurrent_connectivity_test.c | 6 | ||||
-rw-r--r-- | test/core/surface/lame_client_test.c | 2 | ||||
-rw-r--r-- | test/core/surface/secure_channel_create_test.c | 35 | ||||
-rw-r--r-- | test/core/surface/sequential_connectivity_test.c | 2 |
6 files changed, 29 insertions, 28 deletions
diff --git a/test/core/surface/alarm_test.c b/test/core/surface/alarm_test.c index 054c328389..4afe357c27 100644 --- a/test/core/surface/alarm_test.c +++ b/test/core/surface/alarm_test.c @@ -64,9 +64,9 @@ static void test_alarm(void) { grpc_event ev; void *tag = create_test_tag(); grpc_alarm *alarm = - grpc_alarm_create(cc, GRPC_TIMEOUT_SECONDS_TO_DEADLINE(1), tag); + grpc_alarm_create(cc, grpc_timeout_seconds_to_deadline(1), tag); - ev = grpc_completion_queue_next(cc, GRPC_TIMEOUT_SECONDS_TO_DEADLINE(2), + ev = grpc_completion_queue_next(cc, grpc_timeout_seconds_to_deadline(2), NULL); GPR_ASSERT(ev.type == GRPC_OP_COMPLETE); GPR_ASSERT(ev.tag == tag); @@ -78,10 +78,10 @@ static void test_alarm(void) { grpc_event ev; void *tag = create_test_tag(); grpc_alarm *alarm = - grpc_alarm_create(cc, GRPC_TIMEOUT_SECONDS_TO_DEADLINE(2), tag); + grpc_alarm_create(cc, grpc_timeout_seconds_to_deadline(2), tag); grpc_alarm_cancel(alarm); - ev = grpc_completion_queue_next(cc, GRPC_TIMEOUT_SECONDS_TO_DEADLINE(1), + ev = grpc_completion_queue_next(cc, grpc_timeout_seconds_to_deadline(1), NULL); GPR_ASSERT(ev.type == GRPC_OP_COMPLETE); GPR_ASSERT(ev.tag == tag); diff --git a/test/core/surface/completion_queue_test.c b/test/core/surface/completion_queue_test.c index 1486d2508f..b8ea90921a 100644 --- a/test/core/surface/completion_queue_test.c +++ b/test/core/surface/completion_queue_test.c @@ -232,7 +232,7 @@ static void test_too_many_plucks(void) { } /* wait until all other threads are plucking */ - gpr_sleep_until(GRPC_TIMEOUT_MILLIS_TO_DEADLINE(1000)); + gpr_sleep_until(grpc_timeout_milliseconds_to_deadline(1000)); ev = grpc_completion_queue_pluck(cc, create_test_tag(), gpr_inf_future(GPR_CLOCK_REALTIME), NULL); @@ -266,7 +266,7 @@ typedef struct test_thread_options { } test_thread_options; gpr_timespec ten_seconds_time(void) { - return GRPC_TIMEOUT_SECONDS_TO_DEADLINE(10); + return grpc_timeout_seconds_to_deadline(10); } static void free_completion(grpc_exec_ctx *exec_ctx, void *arg, diff --git a/test/core/surface/concurrent_connectivity_test.c b/test/core/surface/concurrent_connectivity_test.c index 7071f93d8d..4f7a25ab93 100644 --- a/test/core/surface/concurrent_connectivity_test.c +++ b/test/core/surface/concurrent_connectivity_test.c @@ -70,11 +70,13 @@ void create_loop_destroy(void *addr) { grpc_channel *chan = grpc_insecure_channel_create((char *)addr, NULL, NULL); for (int j = 0; j < NUM_INNER_LOOPS; ++j) { - gpr_timespec later_time = GRPC_TIMEOUT_MILLIS_TO_DEADLINE(DELAY_MILLIS); + gpr_timespec later_time = + grpc_timeout_milliseconds_to_deadline(DELAY_MILLIS); grpc_connectivity_state state = grpc_channel_check_connectivity_state(chan, 1); grpc_channel_watch_connectivity_state(chan, state, later_time, cq, NULL); - gpr_timespec poll_time = GRPC_TIMEOUT_MILLIS_TO_DEADLINE(POLL_MILLIS); + gpr_timespec poll_time = + grpc_timeout_milliseconds_to_deadline(POLL_MILLIS); GPR_ASSERT(grpc_completion_queue_next(cq, poll_time, NULL).type == GRPC_OP_COMPLETE); } diff --git a/test/core/surface/lame_client_test.c b/test/core/surface/lame_client_test.c index b5b42c16ff..9deb50bb04 100644 --- a/test/core/surface/lame_client_test.c +++ b/test/core/surface/lame_client_test.c @@ -113,7 +113,7 @@ int main(int argc, char **argv) { grpc_slice host = grpc_slice_from_static_string("anywhere"); call = grpc_channel_create_call(chan, NULL, GRPC_PROPAGATE_DEFAULTS, cq, grpc_slice_from_static_string("/Foo"), &host, - GRPC_TIMEOUT_SECONDS_TO_DEADLINE(100), NULL); + grpc_timeout_seconds_to_deadline(100), NULL); GPR_ASSERT(call); cqv = cq_verifier_create(cq); diff --git a/test/core/surface/secure_channel_create_test.c b/test/core/surface/secure_channel_create_test.c index ab4067dbe1..280806707e 100644 --- a/test/core/surface/secure_channel_create_test.c +++ b/test/core/surface/secure_channel_create_test.c @@ -43,45 +43,44 @@ #include "test/core/util/test_config.h" void test_unknown_scheme_target(void) { - grpc_channel *chan; - grpc_channel_credentials *creds; grpc_resolver_registry_shutdown(); grpc_resolver_registry_init(); - - creds = grpc_fake_transport_security_credentials_create(); - chan = grpc_secure_channel_create(creds, "blah://blah", NULL, NULL); - GPR_ASSERT(chan == NULL); + grpc_channel_credentials *creds = + grpc_fake_transport_security_credentials_create(); + grpc_channel *chan = + grpc_secure_channel_create(creds, "blah://blah", NULL, NULL); + grpc_channel_element *elem = + grpc_channel_stack_element(grpc_channel_get_channel_stack(chan), 0); + GPR_ASSERT(0 == strcmp(elem->filter->name, "lame-client")); grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; + GRPC_CHANNEL_INTERNAL_UNREF(&exec_ctx, chan, "test"); grpc_channel_credentials_unref(&exec_ctx, creds); grpc_exec_ctx_finish(&exec_ctx); } void test_security_connector_already_in_arg(void) { - grpc_channel *chan; - grpc_channel_element *elem; - grpc_channel_args args; grpc_arg arg; - grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - arg.type = GRPC_ARG_POINTER; arg.value.pointer.p = NULL; arg.key = GRPC_SECURITY_CONNECTOR_ARG; + grpc_channel_args args; args.num_args = 1; args.args = &arg; - chan = grpc_secure_channel_create(NULL, NULL, &args, NULL); - elem = grpc_channel_stack_element(grpc_channel_get_channel_stack(chan), 0); + grpc_channel *chan = grpc_secure_channel_create(NULL, NULL, &args, NULL); + grpc_channel_element *elem = + grpc_channel_stack_element(grpc_channel_get_channel_stack(chan), 0); GPR_ASSERT(0 == strcmp(elem->filter->name, "lame-client")); + grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; GRPC_CHANNEL_INTERNAL_UNREF(&exec_ctx, chan, "test"); grpc_exec_ctx_finish(&exec_ctx); } void test_null_creds(void) { - grpc_channel *chan; - grpc_channel_element *elem; - grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - chan = grpc_secure_channel_create(NULL, NULL, NULL, NULL); - elem = grpc_channel_stack_element(grpc_channel_get_channel_stack(chan), 0); + grpc_channel *chan = grpc_secure_channel_create(NULL, NULL, NULL, NULL); + grpc_channel_element *elem = + grpc_channel_stack_element(grpc_channel_get_channel_stack(chan), 0); GPR_ASSERT(0 == strcmp(elem->filter->name, "lame-client")); + grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; GRPC_CHANNEL_INTERNAL_UNREF(&exec_ctx, chan, "test"); grpc_exec_ctx_finish(&exec_ctx); } diff --git a/test/core/surface/sequential_connectivity_test.c b/test/core/surface/sequential_connectivity_test.c index 3292718762..5f66f90037 100644 --- a/test/core/surface/sequential_connectivity_test.c +++ b/test/core/surface/sequential_connectivity_test.c @@ -91,7 +91,7 @@ static void run_test(const test_fixture *fixture) { for (size_t i = 0; i < NUM_CONNECTIONS; i++) { channels[i] = fixture->create_channel(addr); - gpr_timespec connect_deadline = GRPC_TIMEOUT_SECONDS_TO_DEADLINE(30); + gpr_timespec connect_deadline = grpc_timeout_seconds_to_deadline(30); grpc_connectivity_state state; while ((state = grpc_channel_check_connectivity_state(channels[i], 1)) != GRPC_CHANNEL_READY) { |