aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core/iomgr
diff options
context:
space:
mode:
Diffstat (limited to 'test/core/iomgr')
-rw-r--r--test/core/iomgr/combiner_test.c20
-rw-r--r--test/core/iomgr/endpoint_pair_test.c2
-rw-r--r--test/core/iomgr/endpoint_tests.c10
-rw-r--r--test/core/iomgr/ev_epollsig_linux_test.c6
-rw-r--r--test/core/iomgr/fd_posix_test.c12
-rw-r--r--test/core/iomgr/pollset_set_test.c4
-rw-r--r--test/core/iomgr/resolve_address_posix_test.c6
-rw-r--r--test/core/iomgr/resolve_address_test.c18
-rw-r--r--test/core/iomgr/resource_quota_test.c10
-rw-r--r--test/core/iomgr/tcp_client_posix_test.c6
-rw-r--r--test/core/iomgr/tcp_client_uv_test.c6
-rw-r--r--test/core/iomgr/tcp_posix_test.c12
-rw-r--r--test/core/iomgr/tcp_server_posix_test.c4
-rw-r--r--test/core/iomgr/tcp_server_uv_test.c4
-rw-r--r--test/core/iomgr/timer_list_test.c14
-rw-r--r--test/core/iomgr/udp_server_test.c2
16 files changed, 68 insertions, 68 deletions
diff --git a/test/core/iomgr/combiner_test.c b/test/core/iomgr/combiner_test.c
index 82e692902e..38f512de0e 100644
--- a/test/core/iomgr/combiner_test.c
+++ b/test/core/iomgr/combiner_test.c
@@ -45,8 +45,8 @@ static void test_execute_one(void) {
gpr_event done;
gpr_event_init(&done);
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
- grpc_closure_sched(&exec_ctx,
- grpc_closure_create(set_event_to_true, &done,
+ GRPC_CLOSURE_SCHED(&exec_ctx,
+ GRPC_CLOSURE_CREATE(set_event_to_true, &done,
grpc_combiner_scheduler(lock)),
GRPC_ERROR_NONE);
grpc_exec_ctx_flush(&exec_ctx);
@@ -83,8 +83,8 @@ static void execute_many_loop(void *a) {
ex_args *c = gpr_malloc(sizeof(*c));
c->ctr = &args->ctr;
c->value = n++;
- grpc_closure_sched(&exec_ctx,
- grpc_closure_create(
+ GRPC_CLOSURE_SCHED(&exec_ctx,
+ GRPC_CLOSURE_CREATE(
check_one, c, grpc_combiner_scheduler(args->lock)),
GRPC_ERROR_NONE);
grpc_exec_ctx_flush(&exec_ctx);
@@ -93,8 +93,8 @@ static void execute_many_loop(void *a) {
// picking it up
gpr_sleep_until(grpc_timeout_milliseconds_to_deadline(100));
}
- grpc_closure_sched(&exec_ctx,
- grpc_closure_create(set_event_to_true, &args->done,
+ GRPC_CLOSURE_SCHED(&exec_ctx,
+ GRPC_CLOSURE_CREATE(set_event_to_true, &args->done,
grpc_combiner_scheduler(args->lock)),
GRPC_ERROR_NONE);
grpc_exec_ctx_finish(&exec_ctx);
@@ -131,8 +131,8 @@ static void in_finally(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) {
}
static void add_finally(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) {
- grpc_closure_sched(exec_ctx,
- grpc_closure_create(in_finally, arg,
+ GRPC_CLOSURE_SCHED(exec_ctx,
+ GRPC_CLOSURE_CREATE(in_finally, arg,
grpc_combiner_finally_scheduler(arg)),
GRPC_ERROR_NONE);
}
@@ -143,9 +143,9 @@ static void test_execute_finally(void) {
grpc_combiner *lock = grpc_combiner_create();
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
gpr_event_init(&got_in_finally);
- grpc_closure_sched(
+ GRPC_CLOSURE_SCHED(
&exec_ctx,
- grpc_closure_create(add_finally, lock, grpc_combiner_scheduler(lock)),
+ GRPC_CLOSURE_CREATE(add_finally, lock, grpc_combiner_scheduler(lock)),
GRPC_ERROR_NONE);
grpc_exec_ctx_flush(&exec_ctx);
GPR_ASSERT(gpr_event_wait(&got_in_finally,
diff --git a/test/core/iomgr/endpoint_pair_test.c b/test/core/iomgr/endpoint_pair_test.c
index 1c514129e5..f2ce3d0d12 100644
--- a/test/core/iomgr/endpoint_pair_test.c
+++ b/test/core/iomgr/endpoint_pair_test.c
@@ -66,7 +66,7 @@ int main(int argc, char **argv) {
g_pollset = gpr_zalloc(grpc_pollset_size());
grpc_pollset_init(g_pollset, &g_mu);
grpc_endpoint_tests(configs[0], g_pollset, g_mu);
- grpc_closure_init(&destroyed, destroy_pollset, g_pollset,
+ GRPC_CLOSURE_INIT(&destroyed, destroy_pollset, g_pollset,
grpc_schedule_on_exec_ctx);
grpc_pollset_shutdown(&exec_ctx, g_pollset, &destroyed);
grpc_exec_ctx_finish(&exec_ctx);
diff --git a/test/core/iomgr/endpoint_tests.c b/test/core/iomgr/endpoint_tests.c
index d6477a6a87..11b45e8e08 100644
--- a/test/core/iomgr/endpoint_tests.c
+++ b/test/core/iomgr/endpoint_tests.c
@@ -198,9 +198,9 @@ static void read_and_write_test(grpc_endpoint_test_config config,
state.write_done = 0;
state.current_read_data = 0;
state.current_write_data = 0;
- grpc_closure_init(&state.done_read, read_and_write_test_read_handler, &state,
+ GRPC_CLOSURE_INIT(&state.done_read, read_and_write_test_read_handler, &state,
grpc_schedule_on_exec_ctx);
- grpc_closure_init(&state.done_write, read_and_write_test_write_handler,
+ GRPC_CLOSURE_INIT(&state.done_write, read_and_write_test_write_handler,
&state, grpc_schedule_on_exec_ctx);
grpc_slice_buffer_init(&state.outgoing);
grpc_slice_buffer_init(&state.incoming);
@@ -287,19 +287,19 @@ static void multiple_shutdown_test(grpc_endpoint_test_config config) {
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
grpc_endpoint_add_to_pollset(&exec_ctx, f.client_ep, g_pollset);
grpc_endpoint_read(&exec_ctx, f.client_ep, &slice_buffer,
- grpc_closure_create(inc_on_failure, &fail_count,
+ GRPC_CLOSURE_CREATE(inc_on_failure, &fail_count,
grpc_schedule_on_exec_ctx));
wait_for_fail_count(&exec_ctx, &fail_count, 0);
grpc_endpoint_shutdown(&exec_ctx, f.client_ep,
GRPC_ERROR_CREATE_FROM_STATIC_STRING("Test Shutdown"));
wait_for_fail_count(&exec_ctx, &fail_count, 1);
grpc_endpoint_read(&exec_ctx, f.client_ep, &slice_buffer,
- grpc_closure_create(inc_on_failure, &fail_count,
+ GRPC_CLOSURE_CREATE(inc_on_failure, &fail_count,
grpc_schedule_on_exec_ctx));
wait_for_fail_count(&exec_ctx, &fail_count, 2);
grpc_slice_buffer_add(&slice_buffer, grpc_slice_from_copied_string("a"));
grpc_endpoint_write(&exec_ctx, f.client_ep, &slice_buffer,
- grpc_closure_create(inc_on_failure, &fail_count,
+ GRPC_CLOSURE_CREATE(inc_on_failure, &fail_count,
grpc_schedule_on_exec_ctx));
wait_for_fail_count(&exec_ctx, &fail_count, 3);
grpc_endpoint_shutdown(&exec_ctx, f.client_ep,
diff --git a/test/core/iomgr/ev_epollsig_linux_test.c b/test/core/iomgr/ev_epollsig_linux_test.c
index 85f933651d..1d272fa406 100644
--- a/test/core/iomgr/ev_epollsig_linux_test.c
+++ b/test/core/iomgr/ev_epollsig_linux_test.c
@@ -106,7 +106,7 @@ static void test_pollset_cleanup(grpc_exec_ctx *exec_ctx,
int i;
for (i = 0; i < num_pollsets; i++) {
- grpc_closure_init(&destroyed, destroy_pollset, pollsets[i].pollset,
+ GRPC_CLOSURE_INIT(&destroyed, destroy_pollset, pollsets[i].pollset,
grpc_schedule_on_exec_ctx);
grpc_pollset_shutdown(exec_ctx, pollsets[i].pollset, &destroyed);
@@ -280,7 +280,7 @@ static void test_threading(void) {
grpc_pollset_add_fd(&exec_ctx, shared.pollset, shared.wakeup_desc);
grpc_fd_notify_on_read(
&exec_ctx, shared.wakeup_desc,
- grpc_closure_init(&shared.on_wakeup, test_threading_wakeup, &shared,
+ GRPC_CLOSURE_INIT(&shared.on_wakeup, test_threading_wakeup, &shared,
grpc_schedule_on_exec_ctx));
grpc_exec_ctx_finish(&exec_ctx);
}
@@ -296,7 +296,7 @@ static void test_threading(void) {
grpc_fd_shutdown(&exec_ctx, shared.wakeup_desc, GRPC_ERROR_CANCELLED);
grpc_fd_orphan(&exec_ctx, shared.wakeup_desc, NULL, NULL, "done");
grpc_pollset_shutdown(&exec_ctx, shared.pollset,
- grpc_closure_create(destroy_pollset, shared.pollset,
+ GRPC_CLOSURE_CREATE(destroy_pollset, shared.pollset,
grpc_schedule_on_exec_ctx));
grpc_exec_ctx_finish(&exec_ctx);
}
diff --git a/test/core/iomgr/fd_posix_test.c b/test/core/iomgr/fd_posix_test.c
index 54c71b8a1f..02596450d2 100644
--- a/test/core/iomgr/fd_posix_test.c
+++ b/test/core/iomgr/fd_posix_test.c
@@ -205,7 +205,7 @@ static void listen_cb(grpc_exec_ctx *exec_ctx, void *arg, /*=sv_arg*/
se->sv = sv;
se->em_fd = grpc_fd_create(fd, "listener");
grpc_pollset_add_fd(exec_ctx, g_pollset, se->em_fd);
- grpc_closure_init(&se->session_read_closure, session_read_cb, se,
+ GRPC_CLOSURE_INIT(&se->session_read_closure, session_read_cb, se,
grpc_schedule_on_exec_ctx);
grpc_fd_notify_on_read(exec_ctx, se->em_fd, &se->session_read_closure);
@@ -235,7 +235,7 @@ static int server_start(grpc_exec_ctx *exec_ctx, server *sv) {
sv->em_fd = grpc_fd_create(fd, "server");
grpc_pollset_add_fd(exec_ctx, g_pollset, sv->em_fd);
/* Register to be interested in reading from listen_fd. */
- grpc_closure_init(&sv->listen_closure, listen_cb, sv,
+ GRPC_CLOSURE_INIT(&sv->listen_closure, listen_cb, sv,
grpc_schedule_on_exec_ctx);
grpc_fd_notify_on_read(exec_ctx, sv->em_fd, &sv->listen_closure);
@@ -319,7 +319,7 @@ static void client_session_write(grpc_exec_ctx *exec_ctx, void *arg, /*client */
if (errno == EAGAIN) {
gpr_mu_lock(g_mu);
if (cl->client_write_cnt < CLIENT_TOTAL_WRITE_CNT) {
- grpc_closure_init(&cl->write_closure, client_session_write, cl,
+ GRPC_CLOSURE_INIT(&cl->write_closure, client_session_write, cl,
grpc_schedule_on_exec_ctx);
grpc_fd_notify_on_write(exec_ctx, cl->em_fd, &cl->write_closure);
cl->client_write_cnt++;
@@ -445,9 +445,9 @@ static void test_grpc_fd_change(void) {
grpc_closure second_closure;
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
- grpc_closure_init(&first_closure, first_read_callback, &a,
+ GRPC_CLOSURE_INIT(&first_closure, first_read_callback, &a,
grpc_schedule_on_exec_ctx);
- grpc_closure_init(&second_closure, second_read_callback, &b,
+ GRPC_CLOSURE_INIT(&second_closure, second_read_callback, &b,
grpc_schedule_on_exec_ctx);
init_change_data(&a);
@@ -533,7 +533,7 @@ int main(int argc, char **argv) {
grpc_pollset_init(g_pollset, &g_mu);
test_grpc_fd();
test_grpc_fd_change();
- grpc_closure_init(&destroyed, destroy_pollset, g_pollset,
+ GRPC_CLOSURE_INIT(&destroyed, destroy_pollset, g_pollset,
grpc_schedule_on_exec_ctx);
grpc_pollset_shutdown(&exec_ctx, g_pollset, &destroyed);
grpc_exec_ctx_flush(&exec_ctx);
diff --git a/test/core/iomgr/pollset_set_test.c b/test/core/iomgr/pollset_set_test.c
index 4486586992..6aedaf1081 100644
--- a/test/core/iomgr/pollset_set_test.c
+++ b/test/core/iomgr/pollset_set_test.c
@@ -79,7 +79,7 @@ static void cleanup_test_pollsets(grpc_exec_ctx *exec_ctx,
const int num_pollsets) {
grpc_closure destroyed;
for (int i = 0; i < num_pollsets; i++) {
- grpc_closure_init(&destroyed, destroy_pollset, pollsets[i].ps,
+ GRPC_CLOSURE_INIT(&destroyed, destroy_pollset, pollsets[i].ps,
grpc_schedule_on_exec_ctx);
grpc_pollset_shutdown(exec_ctx, pollsets[i].ps, &destroyed);
@@ -108,7 +108,7 @@ void on_readable(grpc_exec_ctx *exec_ctx, void *tfd, grpc_error *error) {
static void reset_test_fd(grpc_exec_ctx *exec_ctx, test_fd *tfd) {
tfd->is_on_readable_called = false;
- grpc_closure_init(&tfd->on_readable, on_readable, tfd,
+ GRPC_CLOSURE_INIT(&tfd->on_readable, on_readable, tfd,
grpc_schedule_on_exec_ctx);
grpc_fd_notify_on_read(exec_ctx, tfd->fd, &tfd->on_readable);
}
diff --git a/test/core/iomgr/resolve_address_posix_test.c b/test/core/iomgr/resolve_address_posix_test.c
index be193deca3..9cc09ed5d3 100644
--- a/test/core/iomgr/resolve_address_posix_test.c
+++ b/test/core/iomgr/resolve_address_posix_test.c
@@ -61,7 +61,7 @@ void args_finish(grpc_exec_ctx *exec_ctx, args_struct *args) {
grpc_pollset_set_del_pollset(exec_ctx, args->pollset_set, args->pollset);
grpc_pollset_set_destroy(exec_ctx, args->pollset_set);
grpc_closure do_nothing_cb;
- grpc_closure_init(&do_nothing_cb, do_nothing, NULL,
+ GRPC_CLOSURE_INIT(&do_nothing_cb, do_nothing, NULL,
grpc_schedule_on_exec_ctx);
grpc_pollset_shutdown(exec_ctx, args->pollset, &do_nothing_cb);
// exec_ctx needs to be flushed before calling grpc_pollset_destroy()
@@ -129,7 +129,7 @@ static void test_unix_socket(void) {
poll_pollset_until_request_done(&args);
grpc_resolve_address(
&exec_ctx, "unix:/path/name", NULL, args.pollset_set,
- grpc_closure_create(must_succeed, &args, grpc_schedule_on_exec_ctx),
+ GRPC_CLOSURE_CREATE(must_succeed, &args, grpc_schedule_on_exec_ctx),
&args.addrs);
args_finish(&exec_ctx, &args);
grpc_exec_ctx_finish(&exec_ctx);
@@ -150,7 +150,7 @@ static void test_unix_socket_path_name_too_long(void) {
poll_pollset_until_request_done(&args);
grpc_resolve_address(
&exec_ctx, path_name, NULL, args.pollset_set,
- grpc_closure_create(must_fail, &args, grpc_schedule_on_exec_ctx),
+ GRPC_CLOSURE_CREATE(must_fail, &args, grpc_schedule_on_exec_ctx),
&args.addrs);
gpr_free(path_name);
args_finish(&exec_ctx, &args);
diff --git a/test/core/iomgr/resolve_address_test.c b/test/core/iomgr/resolve_address_test.c
index dfcc5ad9de..cb156ee61e 100644
--- a/test/core/iomgr/resolve_address_test.c
+++ b/test/core/iomgr/resolve_address_test.c
@@ -56,7 +56,7 @@ void args_finish(grpc_exec_ctx *exec_ctx, args_struct *args) {
grpc_pollset_set_del_pollset(exec_ctx, args->pollset_set, args->pollset);
grpc_pollset_set_destroy(exec_ctx, args->pollset_set);
grpc_closure do_nothing_cb;
- grpc_closure_init(&do_nothing_cb, do_nothing, NULL,
+ GRPC_CLOSURE_INIT(&do_nothing_cb, do_nothing, NULL,
grpc_schedule_on_exec_ctx);
gpr_mu_lock(args->mu);
grpc_pollset_shutdown(exec_ctx, args->pollset, &do_nothing_cb);
@@ -124,7 +124,7 @@ static void test_localhost(void) {
args_init(&exec_ctx, &args);
grpc_resolve_address(
&exec_ctx, "localhost:1", NULL, args.pollset_set,
- grpc_closure_create(must_succeed, &args, grpc_schedule_on_exec_ctx),
+ GRPC_CLOSURE_CREATE(must_succeed, &args, grpc_schedule_on_exec_ctx),
&args.addrs);
grpc_exec_ctx_flush(&exec_ctx);
poll_pollset_until_request_done(&args);
@@ -138,7 +138,7 @@ static void test_default_port(void) {
args_init(&exec_ctx, &args);
grpc_resolve_address(
&exec_ctx, "localhost", "1", args.pollset_set,
- grpc_closure_create(must_succeed, &args, grpc_schedule_on_exec_ctx),
+ GRPC_CLOSURE_CREATE(must_succeed, &args, grpc_schedule_on_exec_ctx),
&args.addrs);
grpc_exec_ctx_flush(&exec_ctx);
poll_pollset_until_request_done(&args);
@@ -152,7 +152,7 @@ static void test_non_numeric_default_port(void) {
args_init(&exec_ctx, &args);
grpc_resolve_address(
&exec_ctx, "localhost", "https", args.pollset_set,
- grpc_closure_create(must_succeed, &args, grpc_schedule_on_exec_ctx),
+ GRPC_CLOSURE_CREATE(must_succeed, &args, grpc_schedule_on_exec_ctx),
&args.addrs);
grpc_exec_ctx_flush(&exec_ctx);
poll_pollset_until_request_done(&args);
@@ -166,7 +166,7 @@ static void test_missing_default_port(void) {
args_init(&exec_ctx, &args);
grpc_resolve_address(
&exec_ctx, "localhost", NULL, args.pollset_set,
- grpc_closure_create(must_fail, &args, grpc_schedule_on_exec_ctx),
+ GRPC_CLOSURE_CREATE(must_fail, &args, grpc_schedule_on_exec_ctx),
&args.addrs);
grpc_exec_ctx_flush(&exec_ctx);
poll_pollset_until_request_done(&args);
@@ -180,7 +180,7 @@ static void test_ipv6_with_port(void) {
args_init(&exec_ctx, &args);
grpc_resolve_address(
&exec_ctx, "[2001:db8::1]:1", NULL, args.pollset_set,
- grpc_closure_create(must_succeed, &args, grpc_schedule_on_exec_ctx),
+ GRPC_CLOSURE_CREATE(must_succeed, &args, grpc_schedule_on_exec_ctx),
&args.addrs);
grpc_exec_ctx_flush(&exec_ctx);
poll_pollset_until_request_done(&args);
@@ -199,7 +199,7 @@ static void test_ipv6_without_port(void) {
args_init(&exec_ctx, &args);
grpc_resolve_address(
&exec_ctx, kCases[i], "80", args.pollset_set,
- grpc_closure_create(must_succeed, &args, grpc_schedule_on_exec_ctx),
+ GRPC_CLOSURE_CREATE(must_succeed, &args, grpc_schedule_on_exec_ctx),
&args.addrs);
grpc_exec_ctx_flush(&exec_ctx);
poll_pollset_until_request_done(&args);
@@ -219,7 +219,7 @@ static void test_invalid_ip_addresses(void) {
args_init(&exec_ctx, &args);
grpc_resolve_address(
&exec_ctx, kCases[i], NULL, args.pollset_set,
- grpc_closure_create(must_fail, &args, grpc_schedule_on_exec_ctx),
+ GRPC_CLOSURE_CREATE(must_fail, &args, grpc_schedule_on_exec_ctx),
&args.addrs);
grpc_exec_ctx_flush(&exec_ctx);
poll_pollset_until_request_done(&args);
@@ -239,7 +239,7 @@ static void test_unparseable_hostports(void) {
args_init(&exec_ctx, &args);
grpc_resolve_address(
&exec_ctx, kCases[i], "1", args.pollset_set,
- grpc_closure_create(must_fail, &args, grpc_schedule_on_exec_ctx),
+ GRPC_CLOSURE_CREATE(must_fail, &args, grpc_schedule_on_exec_ctx),
&args.addrs);
grpc_exec_ctx_flush(&exec_ctx);
poll_pollset_until_request_done(&args);
diff --git a/test/core/iomgr/resource_quota_test.c b/test/core/iomgr/resource_quota_test.c
index a3a0db59f5..b588f3d120 100644
--- a/test/core/iomgr/resource_quota_test.c
+++ b/test/core/iomgr/resource_quota_test.c
@@ -47,7 +47,7 @@ static void set_event_cb(grpc_exec_ctx *exec_ctx, void *a, grpc_error *error) {
gpr_event_set((gpr_event *)a, (void *)1);
}
grpc_closure *set_event(gpr_event *ev) {
- return grpc_closure_create(set_event_cb, ev, grpc_schedule_on_exec_ctx);
+ return GRPC_CLOSURE_CREATE(set_event_cb, ev, grpc_schedule_on_exec_ctx);
}
typedef struct {
@@ -61,7 +61,7 @@ static void reclaimer_cb(grpc_exec_ctx *exec_ctx, void *args,
reclaimer_args *a = args;
grpc_resource_user_free(exec_ctx, a->resource_user, a->size);
grpc_resource_user_finish_reclamation(exec_ctx, a->resource_user);
- grpc_closure_run(exec_ctx, a->then, GRPC_ERROR_NONE);
+ GRPC_CLOSURE_RUN(exec_ctx, a->then, GRPC_ERROR_NONE);
gpr_free(a);
}
grpc_closure *make_reclaimer(grpc_resource_user *resource_user, size_t size,
@@ -70,16 +70,16 @@ grpc_closure *make_reclaimer(grpc_resource_user *resource_user, size_t size,
a->size = size;
a->resource_user = resource_user;
a->then = then;
- return grpc_closure_create(reclaimer_cb, a, grpc_schedule_on_exec_ctx);
+ return GRPC_CLOSURE_CREATE(reclaimer_cb, a, grpc_schedule_on_exec_ctx);
}
static void unused_reclaimer_cb(grpc_exec_ctx *exec_ctx, void *arg,
grpc_error *error) {
GPR_ASSERT(error == GRPC_ERROR_CANCELLED);
- grpc_closure_run(exec_ctx, arg, GRPC_ERROR_NONE);
+ GRPC_CLOSURE_RUN(exec_ctx, arg, GRPC_ERROR_NONE);
}
grpc_closure *make_unused_reclaimer(grpc_closure *then) {
- return grpc_closure_create(unused_reclaimer_cb, then,
+ return GRPC_CLOSURE_CREATE(unused_reclaimer_cb, then,
grpc_schedule_on_exec_ctx);
}
diff --git a/test/core/iomgr/tcp_client_posix_test.c b/test/core/iomgr/tcp_client_posix_test.c
index 75104617c5..00ea495bbe 100644
--- a/test/core/iomgr/tcp_client_posix_test.c
+++ b/test/core/iomgr/tcp_client_posix_test.c
@@ -105,7 +105,7 @@ void test_succeeds(void) {
/* connect to it */
GPR_ASSERT(getsockname(svr_fd, (struct sockaddr *)addr,
(socklen_t *)&resolved_addr.len) == 0);
- grpc_closure_init(&done, must_succeed, NULL, grpc_schedule_on_exec_ctx);
+ GRPC_CLOSURE_INIT(&done, must_succeed, NULL, grpc_schedule_on_exec_ctx);
grpc_tcp_client_connect(&exec_ctx, &done, &g_connecting, g_pollset_set, NULL,
&resolved_addr, gpr_inf_future(GPR_CLOCK_REALTIME));
@@ -155,7 +155,7 @@ void test_fails(void) {
gpr_mu_unlock(g_mu);
/* connect to a broken address */
- grpc_closure_init(&done, must_fail, NULL, grpc_schedule_on_exec_ctx);
+ GRPC_CLOSURE_INIT(&done, must_fail, NULL, grpc_schedule_on_exec_ctx);
grpc_tcp_client_connect(&exec_ctx, &done, &g_connecting, g_pollset_set, NULL,
&resolved_addr, gpr_inf_future(GPR_CLOCK_REALTIME));
@@ -206,7 +206,7 @@ int main(int argc, char **argv) {
gpr_log(GPR_ERROR, "End of first test");
test_fails();
grpc_pollset_set_destroy(&exec_ctx, g_pollset_set);
- grpc_closure_init(&destroyed, destroy_pollset, g_pollset,
+ GRPC_CLOSURE_INIT(&destroyed, destroy_pollset, g_pollset,
grpc_schedule_on_exec_ctx);
grpc_pollset_shutdown(&exec_ctx, g_pollset, &destroyed);
grpc_exec_ctx_finish(&exec_ctx);
diff --git a/test/core/iomgr/tcp_client_uv_test.c b/test/core/iomgr/tcp_client_uv_test.c
index 9b741d3682..9927356613 100644
--- a/test/core/iomgr/tcp_client_uv_test.c
+++ b/test/core/iomgr/tcp_client_uv_test.c
@@ -108,7 +108,7 @@ void test_succeeds(void) {
/* connect to it */
GPR_ASSERT(uv_tcp_getsockname(svr_handle, (struct sockaddr *)addr,
(int *)&resolved_addr.len) == 0);
- grpc_closure_init(&done, must_succeed, NULL, grpc_schedule_on_exec_ctx);
+ GRPC_CLOSURE_INIT(&done, must_succeed, NULL, grpc_schedule_on_exec_ctx);
grpc_tcp_client_connect(&exec_ctx, &done, &g_connecting, NULL, NULL,
&resolved_addr, gpr_inf_future(GPR_CLOCK_REALTIME));
@@ -152,7 +152,7 @@ void test_fails(void) {
gpr_mu_unlock(g_mu);
/* connect to a broken address */
- grpc_closure_init(&done, must_fail, NULL, grpc_schedule_on_exec_ctx);
+ GRPC_CLOSURE_INIT(&done, must_fail, NULL, grpc_schedule_on_exec_ctx);
grpc_tcp_client_connect(&exec_ctx, &done, &g_connecting, NULL, NULL,
&resolved_addr, gpr_inf_future(GPR_CLOCK_REALTIME));
@@ -200,7 +200,7 @@ int main(int argc, char **argv) {
test_succeeds();
gpr_log(GPR_ERROR, "End of first test");
test_fails();
- grpc_closure_init(&destroyed, destroy_pollset, g_pollset,
+ GRPC_CLOSURE_INIT(&destroyed, destroy_pollset, g_pollset,
grpc_schedule_on_exec_ctx);
grpc_pollset_shutdown(&exec_ctx, g_pollset, &destroyed);
grpc_exec_ctx_finish(&exec_ctx);
diff --git a/test/core/iomgr/tcp_posix_test.c b/test/core/iomgr/tcp_posix_test.c
index 9ae03fc023..c45068e7ec 100644
--- a/test/core/iomgr/tcp_posix_test.c
+++ b/test/core/iomgr/tcp_posix_test.c
@@ -184,7 +184,7 @@ static void read_test(size_t num_bytes, size_t slice_size) {
state.read_bytes = 0;
state.target_read_bytes = written_bytes;
grpc_slice_buffer_init(&state.incoming);
- grpc_closure_init(&state.read_cb, read_cb, &state, grpc_schedule_on_exec_ctx);
+ GRPC_CLOSURE_INIT(&state.read_cb, read_cb, &state, grpc_schedule_on_exec_ctx);
grpc_endpoint_read(&exec_ctx, ep, &state.incoming, &state.read_cb);
@@ -236,7 +236,7 @@ static void large_read_test(size_t slice_size) {
state.read_bytes = 0;
state.target_read_bytes = (size_t)written_bytes;
grpc_slice_buffer_init(&state.incoming);
- grpc_closure_init(&state.read_cb, read_cb, &state, grpc_schedule_on_exec_ctx);
+ GRPC_CLOSURE_INIT(&state.read_cb, read_cb, &state, grpc_schedule_on_exec_ctx);
grpc_endpoint_read(&exec_ctx, ep, &state.incoming, &state.read_cb);
@@ -376,7 +376,7 @@ static void write_test(size_t num_bytes, size_t slice_size) {
grpc_slice_buffer_init(&outgoing);
grpc_slice_buffer_addn(&outgoing, slices, num_blocks);
- grpc_closure_init(&write_done_closure, write_done, &state,
+ GRPC_CLOSURE_INIT(&write_done_closure, write_done, &state,
grpc_schedule_on_exec_ctx);
grpc_endpoint_write(&exec_ctx, ep, &outgoing, &write_done_closure);
@@ -422,7 +422,7 @@ static void release_fd_test(size_t num_bytes, size_t slice_size) {
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
grpc_closure fd_released_cb;
int fd_released_done = 0;
- grpc_closure_init(&fd_released_cb, &on_fd_released, &fd_released_done,
+ GRPC_CLOSURE_INIT(&fd_released_cb, &on_fd_released, &fd_released_done,
grpc_schedule_on_exec_ctx);
gpr_log(GPR_INFO,
@@ -447,7 +447,7 @@ static void release_fd_test(size_t num_bytes, size_t slice_size) {
state.read_bytes = 0;
state.target_read_bytes = written_bytes;
grpc_slice_buffer_init(&state.incoming);
- grpc_closure_init(&state.read_cb, read_cb, &state, grpc_schedule_on_exec_ctx);
+ GRPC_CLOSURE_INIT(&state.read_cb, read_cb, &state, grpc_schedule_on_exec_ctx);
grpc_endpoint_read(&exec_ctx, ep, &state.incoming, &state.read_cb);
@@ -560,7 +560,7 @@ int main(int argc, char **argv) {
grpc_pollset_init(g_pollset, &g_mu);
grpc_endpoint_tests(configs[0], g_pollset, g_mu);
run_tests();
- grpc_closure_init(&destroyed, destroy_pollset, g_pollset,
+ GRPC_CLOSURE_INIT(&destroyed, destroy_pollset, g_pollset,
grpc_schedule_on_exec_ctx);
grpc_pollset_shutdown(&exec_ctx, g_pollset, &destroyed);
grpc_exec_ctx_finish(&exec_ctx);
diff --git a/test/core/iomgr/tcp_server_posix_test.c b/test/core/iomgr/tcp_server_posix_test.c
index adfaa390dc..2371721a60 100644
--- a/test/core/iomgr/tcp_server_posix_test.c
+++ b/test/core/iomgr/tcp_server_posix_test.c
@@ -118,7 +118,7 @@ static void server_weak_ref_shutdown(grpc_exec_ctx *exec_ctx, void *arg,
static void server_weak_ref_init(server_weak_ref *weak_ref) {
weak_ref->server = NULL;
- grpc_closure_init(&weak_ref->server_shutdown, server_weak_ref_shutdown,
+ GRPC_CLOSURE_INIT(&weak_ref->server_shutdown, server_weak_ref_shutdown,
weak_ref, grpc_schedule_on_exec_ctx);
}
@@ -492,7 +492,7 @@ int main(int argc, char **argv) {
/* Test connect(2) with dst_addrs. */
test_connect(10, &channel_args, dst_addrs, false);
- grpc_closure_init(&destroyed, destroy_pollset, g_pollset,
+ GRPC_CLOSURE_INIT(&destroyed, destroy_pollset, g_pollset,
grpc_schedule_on_exec_ctx);
grpc_pollset_shutdown(&exec_ctx, g_pollset, &destroyed);
grpc_exec_ctx_finish(&exec_ctx);
diff --git a/test/core/iomgr/tcp_server_uv_test.c b/test/core/iomgr/tcp_server_uv_test.c
index 307e40a49e..8f4d553d1e 100644
--- a/test/core/iomgr/tcp_server_uv_test.c
+++ b/test/core/iomgr/tcp_server_uv_test.c
@@ -82,7 +82,7 @@ static void server_weak_ref_shutdown(grpc_exec_ctx *exec_ctx, void *arg,
static void server_weak_ref_init(server_weak_ref *weak_ref) {
weak_ref->server = NULL;
- grpc_closure_init(&weak_ref->server_shutdown, server_weak_ref_shutdown,
+ GRPC_CLOSURE_INIT(&weak_ref->server_shutdown, server_weak_ref_shutdown,
weak_ref, grpc_schedule_on_exec_ctx);
}
@@ -309,7 +309,7 @@ int main(int argc, char **argv) {
test_connect(1);
test_connect(10);
- grpc_closure_init(&destroyed, destroy_pollset, g_pollset,
+ GRPC_CLOSURE_INIT(&destroyed, destroy_pollset, g_pollset,
grpc_schedule_on_exec_ctx);
grpc_pollset_shutdown(&exec_ctx, g_pollset, &destroyed);
grpc_exec_ctx_finish(&exec_ctx);
diff --git a/test/core/iomgr/timer_list_test.c b/test/core/iomgr/timer_list_test.c
index fbd2d0df77..5f8b01fdc4 100644
--- a/test/core/iomgr/timer_list_test.c
+++ b/test/core/iomgr/timer_list_test.c
@@ -58,7 +58,7 @@ static void add_test(void) {
grpc_timer_init(
&exec_ctx, &timers[i],
gpr_time_add(start, gpr_time_from_millis(10, GPR_TIMESPAN)),
- grpc_closure_create(cb, (void *)(intptr_t)i, grpc_schedule_on_exec_ctx),
+ GRPC_CLOSURE_CREATE(cb, (void *)(intptr_t)i, grpc_schedule_on_exec_ctx),
start);
}
@@ -67,7 +67,7 @@ static void add_test(void) {
grpc_timer_init(
&exec_ctx, &timers[i],
gpr_time_add(start, gpr_time_from_millis(1010, GPR_TIMESPAN)),
- grpc_closure_create(cb, (void *)(intptr_t)i, grpc_schedule_on_exec_ctx),
+ GRPC_CLOSURE_CREATE(cb, (void *)(intptr_t)i, grpc_schedule_on_exec_ctx),
start);
}
@@ -134,23 +134,23 @@ void destruction_test(void) {
grpc_timer_init(
&exec_ctx, &timers[0], tfm(100),
- grpc_closure_create(cb, (void *)(intptr_t)0, grpc_schedule_on_exec_ctx),
+ GRPC_CLOSURE_CREATE(cb, (void *)(intptr_t)0, grpc_schedule_on_exec_ctx),
gpr_time_0(GPR_CLOCK_REALTIME));
grpc_timer_init(
&exec_ctx, &timers[1], tfm(3),
- grpc_closure_create(cb, (void *)(intptr_t)1, grpc_schedule_on_exec_ctx),
+ GRPC_CLOSURE_CREATE(cb, (void *)(intptr_t)1, grpc_schedule_on_exec_ctx),
gpr_time_0(GPR_CLOCK_REALTIME));
grpc_timer_init(
&exec_ctx, &timers[2], tfm(100),
- grpc_closure_create(cb, (void *)(intptr_t)2, grpc_schedule_on_exec_ctx),
+ GRPC_CLOSURE_CREATE(cb, (void *)(intptr_t)2, grpc_schedule_on_exec_ctx),
gpr_time_0(GPR_CLOCK_REALTIME));
grpc_timer_init(
&exec_ctx, &timers[3], tfm(3),
- grpc_closure_create(cb, (void *)(intptr_t)3, grpc_schedule_on_exec_ctx),
+ GRPC_CLOSURE_CREATE(cb, (void *)(intptr_t)3, grpc_schedule_on_exec_ctx),
gpr_time_0(GPR_CLOCK_REALTIME));
grpc_timer_init(
&exec_ctx, &timers[4], tfm(1),
- grpc_closure_create(cb, (void *)(intptr_t)4, grpc_schedule_on_exec_ctx),
+ GRPC_CLOSURE_CREATE(cb, (void *)(intptr_t)4, grpc_schedule_on_exec_ctx),
gpr_time_0(GPR_CLOCK_REALTIME));
GPR_ASSERT(grpc_timer_check(&exec_ctx, tfm(2), NULL) == GRPC_TIMERS_FIRED);
grpc_exec_ctx_finish(&exec_ctx);
diff --git a/test/core/iomgr/udp_server_test.c b/test/core/iomgr/udp_server_test.c
index c95d0ce835..aa34857dbd 100644
--- a/test/core/iomgr/udp_server_test.c
+++ b/test/core/iomgr/udp_server_test.c
@@ -311,7 +311,7 @@ int main(int argc, char **argv) {
test_receive(1);
test_receive(10);
- grpc_closure_init(&destroyed, destroy_pollset, g_pollset,
+ GRPC_CLOSURE_INIT(&destroyed, destroy_pollset, g_pollset,
grpc_schedule_on_exec_ctx);
grpc_pollset_shutdown(&exec_ctx, g_pollset, &destroyed);
grpc_exec_ctx_finish(&exec_ctx);