Lines Matching refs:test_data

21 struct test_data {  struct
52 static struct test_data s_test_data; argument
58 struct test_data *test_data = user_data; in s_fixture_on_server_protocol_message() local
59 test_data->on_server_message_received(connection, message_args, test_data->user_data); in s_fixture_on_server_protocol_message()
66 struct test_data *test_data = user_data; in s_on_stream_server_continuation_shim() local
67test_data->on_new_server_continuation(token, message_args, test_data->server_continuation_user_dat… in s_on_stream_server_continuation_shim()
73 struct test_data *test_data = user_data; in s_stream_server_continuation_closed_shim() local
74 test_data->on_server_continuation_closed(token, test_data->server_continuation_user_data); in s_stream_server_continuation_closed_shim()
83 struct test_data *test_data = user_data; in s_on_server_incoming_stream_shim() local
87 continuation_options->user_data = test_data; in s_on_server_incoming_stream_shim()
89 if (test_data->on_new_server_stream) { in s_on_server_incoming_stream_shim()
90 test_data->on_new_server_stream( in s_on_server_incoming_stream_shim()
91 …connection, token, operation_name, continuation_options, test_data->server_continuation_user_data); in s_on_server_incoming_stream_shim()
104 struct test_data *test_data = user_data; in s_fixture_on_new_server_connection() local
105 test_data->server_connection = connection; in s_fixture_on_new_server_connection()
106 aws_mutex_lock(&test_data->setup_lock); in s_fixture_on_new_server_connection()
107 test_data->server_setup_completed = true; in s_fixture_on_new_server_connection()
108 aws_mutex_unlock(&test_data->setup_lock); in s_fixture_on_new_server_connection()
115 aws_condition_variable_notify_one(&test_data->setup_cvar); in s_fixture_on_new_server_connection()
127 struct test_data *test_data = user_data; in s_fixture_on_server_connection_shutdown() local
129 aws_mutex_lock(&test_data->shutdown_lock); in s_fixture_on_server_connection_shutdown()
130 test_data->server_connection_shutdown_completed = true; in s_fixture_on_server_connection_shutdown()
131 aws_mutex_unlock(&test_data->shutdown_lock); in s_fixture_on_server_connection_shutdown()
132 aws_condition_variable_notify_one(&test_data->shutdown_cvar); in s_fixture_on_server_connection_shutdown()
136 struct test_data *test_data = args; in s_server_connection_shutdown_completed() local
137 return test_data->server_connection_shutdown_completed; in s_server_connection_shutdown_completed()
142 struct test_data *test_data = user_data; in s_on_listener_destroy() local
143 aws_mutex_lock(&test_data->shutdown_lock); in s_on_listener_destroy()
144 test_data->listener_shutdown_completed = true; in s_on_listener_destroy()
145 aws_mutex_unlock(&test_data->shutdown_lock); in s_on_listener_destroy()
146 aws_condition_variable_notify_one(&test_data->shutdown_cvar); in s_on_listener_destroy()
150 struct test_data *test_data = arg; in s_listener_shutdown_pred() local
151 return test_data->listener_shutdown_completed; in s_listener_shutdown_pred()
155 struct test_data *test_data = user_data; in s_event_loop_shutdown_callback() local
156 aws_mutex_lock(&test_data->shutdown_lock); in s_event_loop_shutdown_callback()
157 test_data->event_loop_shutdown_completed = true; in s_event_loop_shutdown_callback()
158 aws_mutex_unlock(&test_data->shutdown_lock); in s_event_loop_shutdown_callback()
159 aws_condition_variable_notify_one(&test_data->shutdown_cvar); in s_event_loop_shutdown_callback()
163 struct test_data *test_data = arg; in s_event_loop_shutdown_pred() local
164 return test_data->event_loop_shutdown_completed; in s_event_loop_shutdown_pred()
172 struct test_data *test_data = user_data; in s_client_on_connection_setup() local
174 aws_mutex_lock(&test_data->setup_lock); in s_client_on_connection_setup()
175 test_data->client_connection = connection; in s_client_on_connection_setup()
180 test_data->client_setup_completed = true; in s_client_on_connection_setup()
181 aws_mutex_unlock(&test_data->setup_lock); in s_client_on_connection_setup()
182 aws_condition_variable_notify_one(&test_data->setup_cvar); in s_client_on_connection_setup()
192 struct test_data *test_data = user_data; in s_client_on_connection_shutdown() local
194 aws_mutex_lock(&test_data->shutdown_lock); in s_client_on_connection_shutdown()
195 test_data->client_connection_shutdown = true; in s_client_on_connection_shutdown()
196 aws_mutex_unlock(&test_data->shutdown_lock); in s_client_on_connection_shutdown()
197 aws_condition_variable_notify_one(&test_data->shutdown_cvar); in s_client_on_connection_shutdown()
201 struct test_data *test_data = args; in s_client_connection_shutdown_completed() local
202 return test_data->client_connection_shutdown; in s_client_connection_shutdown_completed()
209 struct test_data *test_data = user_data; in s_client_connection_protocol_message() local
210 test_data->on_client_message_received(connection, message_args, test_data->user_data); in s_client_connection_protocol_message()
214 struct test_data *test_data = arg; in s_setup_completed_pred() local
216 return test_data->client_setup_completed && test_data->server_setup_completed; in s_setup_completed_pred()
220 struct test_data *test_data = arg; in s_resolver_shutdown_completion_callback() local
222 aws_mutex_lock(&test_data->shutdown_lock); in s_resolver_shutdown_completion_callback()
223 test_data->resolver_shutdown_completed = true; in s_resolver_shutdown_completion_callback()
224 aws_mutex_unlock(&test_data->shutdown_lock); in s_resolver_shutdown_completion_callback()
225 aws_condition_variable_notify_one(&test_data->shutdown_cvar); in s_resolver_shutdown_completion_callback()
229 struct test_data *test_data = arg; in s_resolver_shutdown_completed_pred() local
231 return test_data->resolver_shutdown_completed; in s_resolver_shutdown_completed_pred()
236 struct test_data *test_data = ctx; in s_fixture_setup() local
237 AWS_ZERO_STRUCT(*test_data); in s_fixture_setup()
238 aws_mutex_init(&test_data->setup_lock); in s_fixture_setup()
239 aws_mutex_init(&test_data->shutdown_lock); in s_fixture_setup()
240 aws_condition_variable_init(&test_data->setup_cvar); in s_fixture_setup()
241 aws_condition_variable_init(&test_data->shutdown_cvar); in s_fixture_setup()
245 .shutdown_callback_user_data = test_data, in s_fixture_setup()
247 test_data->el_group = aws_event_loop_group_new_default(allocator, 1, &el_shutdown_options); in s_fixture_setup()
248 ASSERT_NOT_NULL(test_data->el_group); in s_fixture_setup()
249 test_data->server_bootstrap = aws_server_bootstrap_new(allocator, test_data->el_group); in s_fixture_setup()
250 ASSERT_NOT_NULL(test_data->server_bootstrap); in s_fixture_setup()
254 .shutdown_callback_user_data = test_data, in s_fixture_setup()
258 .el_group = test_data->el_group, in s_fixture_setup()
263 test_data->resolver = aws_host_resolver_new_default(allocator, &resolver_options); in s_fixture_setup()
264 ASSERT_NOT_NULL(test_data->resolver); in s_fixture_setup()
267 .user_data = test_data, in s_fixture_setup()
268 .event_loop_group = test_data->el_group, in s_fixture_setup()
269 .host_resolver = test_data->resolver, in s_fixture_setup()
271 test_data->client_bootstrap = aws_client_bootstrap_new(allocator, &client_bootstrap_options); in s_fixture_setup()
272 ASSERT_NOT_NULL(test_data->client_bootstrap); in s_fixture_setup()
274 ASSERT_SUCCESS(aws_mutex_init(&test_data->shutdown_lock)); in s_fixture_setup()
275 ASSERT_SUCCESS(aws_condition_variable_init(&test_data->shutdown_cvar)); in s_fixture_setup()
285 while (!test_data->listener) { in s_fixture_setup()
293 .bootstrap = test_data->server_bootstrap, in s_fixture_setup()
294 .user_data = test_data, in s_fixture_setup()
300test_data->listener = aws_event_stream_rpc_server_new_listener(allocator, &listener_options); in s_fixture_setup()
301 if (!test_data->listener) { in s_fixture_setup()
306 test_data->allocator = allocator; in s_fixture_setup()
310 .user_data = test_data, in s_fixture_setup()
311 .bootstrap = test_data->client_bootstrap, in s_fixture_setup()
321 aws_mutex_lock(&test_data->setup_lock); in s_fixture_setup()
322 …aws_condition_variable_wait_pred(&test_data->setup_cvar, &test_data->setup_lock, s_setup_completed… in s_fixture_setup()
323 aws_mutex_unlock(&test_data->setup_lock); in s_fixture_setup()
325 ASSERT_NOT_NULL(&test_data->client_connection); in s_fixture_setup()
331 struct test_data *test_data = ctx; in s_fixture_shutdown() local
334 aws_mutex_lock(&test_data->shutdown_lock); in s_fixture_shutdown()
336 …&test_data->shutdown_cvar, &test_data->shutdown_lock, s_server_connection_shutdown_completed, test… in s_fixture_shutdown()
338 …&test_data->shutdown_cvar, &test_data->shutdown_lock, s_client_connection_shutdown_completed, test… in s_fixture_shutdown()
339 aws_event_stream_rpc_client_connection_release(test_data->client_connection); in s_fixture_shutdown()
340 aws_event_stream_rpc_server_connection_release(test_data->server_connection); in s_fixture_shutdown()
341 aws_event_stream_rpc_server_listener_release(test_data->listener); in s_fixture_shutdown()
343 … &test_data->shutdown_cvar, &test_data->shutdown_lock, s_listener_shutdown_pred, test_data); in s_fixture_shutdown()
344 aws_server_bootstrap_release(test_data->server_bootstrap); in s_fixture_shutdown()
345 aws_client_bootstrap_release(test_data->client_bootstrap); in s_fixture_shutdown()
346 aws_host_resolver_release(test_data->resolver); in s_fixture_shutdown()
348 …&test_data->shutdown_cvar, &test_data->shutdown_lock, s_resolver_shutdown_completed_pred, test_dat… in s_fixture_shutdown()
349 aws_event_loop_group_release(test_data->el_group); in s_fixture_shutdown()
351 … &test_data->shutdown_cvar, &test_data->shutdown_lock, s_event_loop_shutdown_pred, test_data); in s_fixture_shutdown()
352 aws_mutex_unlock(&test_data->shutdown_lock); in s_fixture_shutdown()
353 aws_mutex_clean_up(&test_data->shutdown_lock); in s_fixture_shutdown()
354 aws_condition_variable_clean_up(&test_data->shutdown_cvar); in s_fixture_shutdown()
355 aws_mutex_clean_up(&test_data->setup_lock); in s_fixture_shutdown()
356 aws_condition_variable_clean_up(&test_data->setup_cvar); in s_fixture_shutdown()
365 struct test_data *test_data = ctx; in s_test_event_stream_rpc_client_connection_setup_and_teardown() local
369 aws_event_stream_rpc_client_connection_close(test_data->client_connection, AWS_ERROR_SUCCESS); in s_test_event_stream_rpc_client_connection_setup_and_teardown()
370 aws_event_stream_rpc_server_connection_close(test_data->server_connection, AWS_ERROR_SUCCESS); in s_test_event_stream_rpc_client_connection_setup_and_teardown()
444 struct test_data *test_data = ctx; in s_test_event_stream_rpc_client_connection_connect() local
445 test_data->on_server_message_received = s_rpc_server_connection_protocol_message; in s_test_event_stream_rpc_client_connection_connect()
446 test_data->on_client_message_received = s_rpc_client_connection_protocol_message; in s_test_event_stream_rpc_client_connection_connect()
454 test_data->user_data = &client_test_data; in s_test_event_stream_rpc_client_connection_connect()
465test_data->client_connection, &connect_args, s_rpc_client_message_flush, &client_test_data)); in s_test_event_stream_rpc_client_connection_connect()
490test_data->server_connection, &connect_args, s_rpc_client_message_flush, &client_test_data)); in s_test_event_stream_rpc_client_connection_connect()
506 aws_event_stream_rpc_client_connection_close(test_data->client_connection, AWS_ERROR_SUCCESS); in s_test_event_stream_rpc_client_connection_connect()
507 aws_event_stream_rpc_server_connection_close(test_data->server_connection, AWS_ERROR_SUCCESS); in s_test_event_stream_rpc_client_connection_connect()
528 struct test_data *test_data = ctx; in s_test_event_stream_rpc_client_connection_message_before_connect() local
541 test_data->client_connection, &connect_args, s_rpc_client_message_flush, NULL)); in s_test_event_stream_rpc_client_connection_message_before_connect()
543 aws_event_stream_rpc_client_connection_close(test_data->client_connection, AWS_ERROR_SUCCESS); in s_test_event_stream_rpc_client_connection_message_before_connect()
544 aws_event_stream_rpc_server_connection_close(test_data->server_connection, AWS_ERROR_SUCCESS); in s_test_event_stream_rpc_client_connection_message_before_connect()
558 struct test_data *test_data = ctx; in s_test_event_stream_rpc_client_connection_protocol_message() local
559 test_data->on_server_message_received = s_rpc_server_connection_protocol_message; in s_test_event_stream_rpc_client_connection_protocol_message()
560 test_data->on_client_message_received = s_rpc_client_connection_protocol_message; in s_test_event_stream_rpc_client_connection_protocol_message()
568 test_data->user_data = &client_test_data; in s_test_event_stream_rpc_client_connection_protocol_message()
579test_data->client_connection, &connect_args, s_rpc_client_message_flush, &client_test_data)); in s_test_event_stream_rpc_client_connection_protocol_message()
604test_data->server_connection, &connect_args, s_rpc_client_message_flush, &client_test_data)); in s_test_event_stream_rpc_client_connection_protocol_message()
636 test_data->client_connection, &ping_args, s_rpc_client_message_flush, &client_test_data)); in s_test_event_stream_rpc_client_connection_protocol_message()
659 test_data->server_connection, &ping_args, s_rpc_client_message_flush, &client_test_data)); in s_test_event_stream_rpc_client_connection_protocol_message()
675 aws_event_stream_rpc_client_connection_close(test_data->client_connection, AWS_ERROR_SUCCESS); in s_test_event_stream_rpc_client_connection_protocol_message()
676 aws_event_stream_rpc_server_connection_close(test_data->server_connection, AWS_ERROR_SUCCESS); in s_test_event_stream_rpc_client_connection_protocol_message()
769 struct test_data *test_data = ctx; in s_test_event_stream_rpc_client_connection_continuation_flow() local
770 test_data->on_server_message_received = s_rpc_server_connection_protocol_message; in s_test_event_stream_rpc_client_connection_continuation_flow()
771 test_data->on_client_message_received = s_rpc_client_connection_protocol_message; in s_test_event_stream_rpc_client_connection_continuation_flow()
772 test_data->on_new_server_stream = s_rpc_server_on_incoming_stream; in s_test_event_stream_rpc_client_connection_continuation_flow()
773 test_data->on_new_server_continuation = s_rpc_server_stream_continuation; in s_test_event_stream_rpc_client_connection_continuation_flow()
774 test_data->on_server_continuation_closed = s_rpc_server_stream_continuation_closed; in s_test_event_stream_rpc_client_connection_continuation_flow()
782 test_data->user_data = &client_test_data; in s_test_event_stream_rpc_client_connection_continuation_flow()
783 test_data->server_continuation_user_data = &client_test_data; in s_test_event_stream_rpc_client_connection_continuation_flow()
794test_data->client_connection, &connect_args, s_rpc_client_message_flush, &client_test_data)); in s_test_event_stream_rpc_client_connection_continuation_flow()
819test_data->server_connection, &connect_args, s_rpc_client_message_flush, &client_test_data)); in s_test_event_stream_rpc_client_connection_continuation_flow()
846 …aws_event_stream_rpc_client_connection_new_stream(test_data->client_connection, &continuation_opti… in s_test_event_stream_rpc_client_connection_continuation_flow()
916 aws_event_stream_rpc_client_connection_close(test_data->client_connection, AWS_ERROR_SUCCESS); in s_test_event_stream_rpc_client_connection_continuation_flow()
917 aws_event_stream_rpc_server_connection_close(test_data->server_connection, AWS_ERROR_SUCCESS); in s_test_event_stream_rpc_client_connection_continuation_flow()
937 struct test_data *test_data = ctx; in s_test_event_stream_rpc_client_connection_unactivated_continuation_fails() local
938 test_data->on_server_message_received = s_rpc_server_connection_protocol_message; in s_test_event_stream_rpc_client_connection_unactivated_continuation_fails()
939 test_data->on_client_message_received = s_rpc_client_connection_protocol_message; in s_test_event_stream_rpc_client_connection_unactivated_continuation_fails()
940 test_data->on_new_server_stream = s_rpc_server_on_incoming_stream; in s_test_event_stream_rpc_client_connection_unactivated_continuation_fails()
941 test_data->on_new_server_continuation = s_rpc_server_stream_continuation; in s_test_event_stream_rpc_client_connection_unactivated_continuation_fails()
942 test_data->on_server_continuation_closed = s_rpc_server_stream_continuation_closed; in s_test_event_stream_rpc_client_connection_unactivated_continuation_fails()
950 test_data->user_data = &client_test_data; in s_test_event_stream_rpc_client_connection_unactivated_continuation_fails()
951 test_data->server_continuation_user_data = &client_test_data; in s_test_event_stream_rpc_client_connection_unactivated_continuation_fails()
962test_data->client_connection, &connect_args, s_rpc_client_message_flush, &client_test_data)); in s_test_event_stream_rpc_client_connection_unactivated_continuation_fails()
987test_data->server_connection, &connect_args, s_rpc_client_message_flush, &client_test_data)); in s_test_event_stream_rpc_client_connection_unactivated_continuation_fails()
1014 …aws_event_stream_rpc_client_connection_new_stream(test_data->client_connection, &continuation_opti… in s_test_event_stream_rpc_client_connection_unactivated_continuation_fails()
1032 aws_event_stream_rpc_client_connection_close(test_data->client_connection, AWS_ERROR_SUCCESS); in s_test_event_stream_rpc_client_connection_unactivated_continuation_fails()
1033 aws_event_stream_rpc_server_connection_close(test_data->server_connection, AWS_ERROR_SUCCESS); in s_test_event_stream_rpc_client_connection_unactivated_continuation_fails()
1053 struct test_data *test_data = ctx; in s_test_event_stream_rpc_client_connection_continuation_send_message_on_closed_fails() local
1054 test_data->on_server_message_received = s_rpc_server_connection_protocol_message; in s_test_event_stream_rpc_client_connection_continuation_send_message_on_closed_fails()
1055 test_data->on_client_message_received = s_rpc_client_connection_protocol_message; in s_test_event_stream_rpc_client_connection_continuation_send_message_on_closed_fails()
1056 test_data->on_new_server_stream = s_rpc_server_on_incoming_stream; in s_test_event_stream_rpc_client_connection_continuation_send_message_on_closed_fails()
1057 test_data->on_new_server_continuation = s_rpc_server_stream_continuation; in s_test_event_stream_rpc_client_connection_continuation_send_message_on_closed_fails()
1058 test_data->on_server_continuation_closed = s_rpc_server_stream_continuation_closed; in s_test_event_stream_rpc_client_connection_continuation_send_message_on_closed_fails()
1066 test_data->user_data = &client_test_data; in s_test_event_stream_rpc_client_connection_continuation_send_message_on_closed_fails()
1067 test_data->server_continuation_user_data = &client_test_data; in s_test_event_stream_rpc_client_connection_continuation_send_message_on_closed_fails()
1079test_data->client_connection, &connect_args, s_rpc_client_message_flush, &client_test_data)); in s_test_event_stream_rpc_client_connection_continuation_send_message_on_closed_fails()
1107test_data->server_connection, &connect_args, s_rpc_client_message_flush, &client_test_data)); in s_test_event_stream_rpc_client_connection_continuation_send_message_on_closed_fails()
1136 …aws_event_stream_rpc_client_connection_new_stream(test_data->client_connection, &continuation_opti… in s_test_event_stream_rpc_client_connection_continuation_send_message_on_closed_fails()
1217 aws_event_stream_rpc_client_connection_close(test_data->client_connection, AWS_ERROR_SUCCESS); in s_test_event_stream_rpc_client_connection_continuation_send_message_on_closed_fails()
1218 aws_event_stream_rpc_server_connection_close(test_data->server_connection, AWS_ERROR_SUCCESS); in s_test_event_stream_rpc_client_connection_continuation_send_message_on_closed_fails()
1238 struct test_data *test_data = ctx; in s_test_event_stream_rpc_client_connection_continuation_duplicated_activate_fails() local
1239 test_data->on_server_message_received = s_rpc_server_connection_protocol_message; in s_test_event_stream_rpc_client_connection_continuation_duplicated_activate_fails()
1240 test_data->on_client_message_received = s_rpc_client_connection_protocol_message; in s_test_event_stream_rpc_client_connection_continuation_duplicated_activate_fails()
1241 test_data->on_new_server_stream = s_rpc_server_on_incoming_stream; in s_test_event_stream_rpc_client_connection_continuation_duplicated_activate_fails()
1242 test_data->on_new_server_continuation = s_rpc_server_stream_continuation; in s_test_event_stream_rpc_client_connection_continuation_duplicated_activate_fails()
1243 test_data->on_server_continuation_closed = s_rpc_server_stream_continuation_closed; in s_test_event_stream_rpc_client_connection_continuation_duplicated_activate_fails()
1251 test_data->user_data = &client_test_data; in s_test_event_stream_rpc_client_connection_continuation_duplicated_activate_fails()
1252 test_data->server_continuation_user_data = &client_test_data; in s_test_event_stream_rpc_client_connection_continuation_duplicated_activate_fails()
1263test_data->client_connection, &connect_args, s_rpc_client_message_flush, &client_test_data)); in s_test_event_stream_rpc_client_connection_continuation_duplicated_activate_fails()
1288test_data->server_connection, &connect_args, s_rpc_client_message_flush, &client_test_data)); in s_test_event_stream_rpc_client_connection_continuation_duplicated_activate_fails()
1315 …aws_event_stream_rpc_client_connection_new_stream(test_data->client_connection, &continuation_opti… in s_test_event_stream_rpc_client_connection_continuation_duplicated_activate_fails()
1346 aws_event_stream_rpc_client_connection_close(test_data->client_connection, AWS_ERROR_SUCCESS); in s_test_event_stream_rpc_client_connection_continuation_duplicated_activate_fails()
1347 aws_event_stream_rpc_server_connection_close(test_data->server_connection, AWS_ERROR_SUCCESS); in s_test_event_stream_rpc_client_connection_continuation_duplicated_activate_fails()