@@ -86,8 +86,6 @@ static void run_test(const test_fixture* fixture, bool share_subchannel) {
86
86
gpr_log (GPR_INFO, " TEST: %s sharing subchannel: %d" , fixture->name ,
87
87
share_subchannel);
88
88
89
- grpc_init ();
90
-
91
89
std::string addr =
92
90
grpc_core::JoinHostPort (" localhost" , grpc_pick_unused_port_or_die ());
93
91
@@ -147,8 +145,6 @@ static void run_test(const test_fixture* fixture, bool share_subchannel) {
147
145
grpc_server_destroy (server);
148
146
grpc_completion_queue_destroy (server_cq);
149
147
grpc_completion_queue_destroy (cq);
150
-
151
- grpc_shutdown ();
152
148
}
153
149
154
150
static void insecure_test_add_port (grpc_server* server, const char * addr) {
@@ -176,13 +172,13 @@ static void secure_test_add_port(grpc_server* server, const char* addr) {
176
172
177
173
int main (int argc, char ** argv) {
178
174
grpc::testing::TestEnvironment env (argc, argv);
175
+ grpc_init ();
179
176
180
177
const test_fixture insecure_test = {
181
178
" insecure" ,
182
179
insecure_test_add_port,
183
180
nullptr ,
184
181
};
185
-
186
182
run_test (&insecure_test, /* share_subchannel=*/ true );
187
183
run_test (&insecure_test, /* share_subchannel=*/ false );
188
184
@@ -202,4 +198,6 @@ int main(int argc, char** argv) {
202
198
run_test (&secure_test, /* share_subchannel=*/ true );
203
199
run_test (&secure_test, /* share_subchannel=*/ false );
204
200
grpc_channel_credentials_release (ssl_creds);
201
+
202
+ grpc_shutdown ();
205
203
}
0 commit comments