aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core/security/secure_endpoint_test.cc
diff options
context:
space:
mode:
authorGravatar Yash Tibrewal <yashkt@google.com>2017-11-28 13:23:36 -0800
committerGravatar Yash Tibrewal <yashkt@google.com>2017-11-28 13:23:36 -0800
commit81fc8c9c336fab7a71b448f748a32d680301277c (patch)
tree5cd64fd191db0f87d59ef53768c1b6760b4f1654 /test/core/security/secure_endpoint_test.cc
parent3285f4c7329bf4305133be74f88dd4b10d5e2052 (diff)
Fix tests to call grpc_init and grpc_shutdown before using exec_ctx
Diffstat (limited to 'test/core/security/secure_endpoint_test.cc')
-rw-r--r--test/core/security/secure_endpoint_test.cc24
1 files changed, 13 insertions, 11 deletions
diff --git a/test/core/security/secure_endpoint_test.cc b/test/core/security/secure_endpoint_test.cc
index 694a8584ea..c8f4f32538 100644
--- a/test/core/security/secure_endpoint_test.cc
+++ b/test/core/security/secure_endpoint_test.cc
@@ -205,19 +205,21 @@ static void destroy_pollset(void* p, grpc_error* error) {
int main(int argc, char** argv) {
grpc_closure destroyed;
- grpc_core::ExecCtx _local_exec_ctx;
grpc_test_init(argc, argv);
-
grpc_init();
- g_pollset = (grpc_pollset*)gpr_zalloc(grpc_pollset_size());
- grpc_pollset_init(g_pollset, &g_mu);
- grpc_endpoint_tests(configs[0], g_pollset, g_mu);
- grpc_endpoint_tests(configs[1], g_pollset, g_mu);
- test_leftover(configs[2], 1);
- test_leftover(configs[3], 1);
- GRPC_CLOSURE_INIT(&destroyed, destroy_pollset, g_pollset,
- grpc_schedule_on_exec_ctx);
- grpc_pollset_shutdown(g_pollset, &destroyed);
+
+ {
+ grpc_core::ExecCtx _local_exec_ctx;
+ g_pollset = (grpc_pollset*)gpr_zalloc(grpc_pollset_size());
+ grpc_pollset_init(g_pollset, &g_mu);
+ grpc_endpoint_tests(configs[0], g_pollset, g_mu);
+ grpc_endpoint_tests(configs[1], g_pollset, g_mu);
+ test_leftover(configs[2], 1);
+ test_leftover(configs[3], 1);
+ GRPC_CLOSURE_INIT(&destroyed, destroy_pollset, g_pollset,
+ grpc_schedule_on_exec_ctx);
+ grpc_pollset_shutdown(g_pollset, &destroyed);
+ }
grpc_shutdown();