diff options
Diffstat (limited to 'src/transport/test_transport_plugin_cmd_simple_send_broadcast.c')
-rw-r--r-- | src/transport/test_transport_plugin_cmd_simple_send_broadcast.c | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/src/transport/test_transport_plugin_cmd_simple_send_broadcast.c b/src/transport/test_transport_plugin_cmd_simple_send_broadcast.c index 3a282bb11..f7a4b117f 100644 --- a/src/transport/test_transport_plugin_cmd_simple_send_broadcast.c +++ b/src/transport/test_transport_plugin_cmd_simple_send_broadcast.c | |||
@@ -30,6 +30,7 @@ | |||
30 | #include "gnunet_transport_application_service.h" | 30 | #include "gnunet_transport_application_service.h" |
31 | #include "transport-testing2.h" | 31 | #include "transport-testing2.h" |
32 | #include "transport-testing-cmds.h" | 32 | #include "transport-testing-cmds.h" |
33 | #include "gnunet_testing_barrier.h" | ||
33 | 34 | ||
34 | /** | 35 | /** |
35 | * Generic logging shortcut | 36 | * Generic logging shortcut |
@@ -40,6 +41,8 @@ | |||
40 | 41 | ||
41 | #define TOPOLOGY_CONFIG "test_transport_simple_send_topo.conf" | 42 | #define TOPOLOGY_CONFIG "test_transport_simple_send_topo.conf" |
42 | 43 | ||
44 | #define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 600) | ||
45 | |||
43 | static struct GNUNET_TESTING_Command block_send; | 46 | static struct GNUNET_TESTING_Command block_send; |
44 | 47 | ||
45 | static struct GNUNET_TESTING_Command block_receive; | 48 | static struct GNUNET_TESTING_Command block_receive; |
@@ -48,6 +51,8 @@ static struct GNUNET_TESTING_Command connect_peers; | |||
48 | 51 | ||
49 | static struct GNUNET_TESTING_Command local_prepared; | 52 | static struct GNUNET_TESTING_Command local_prepared; |
50 | 53 | ||
54 | static struct GNUNET_TESTING_Interpreter *is; | ||
55 | |||
51 | /** | 56 | /** |
52 | * Function called to check a message of type GNUNET_TRANSPORT_TESTING_SIMPLE_MTYPE being | 57 | * Function called to check a message of type GNUNET_TRANSPORT_TESTING_SIMPLE_MTYPE being |
53 | * received. | 58 | * received. |
@@ -82,6 +87,25 @@ handle_test (void *cls, | |||
82 | } | 87 | } |
83 | 88 | ||
84 | 89 | ||
90 | struct GNUNET_TESTING_Barrier * | ||
91 | get_waiting_for_barriers () | ||
92 | { | ||
93 | struct GNUNET_TESTING_Barrier *barrier; | ||
94 | |||
95 | //No Barrier | ||
96 | return NULL; | ||
97 | } | ||
98 | |||
99 | |||
100 | static void | ||
101 | barrier_advanced (const char *barrier_name) | ||
102 | { | ||
103 | struct GNUNET_TESTING_Barrier *barrier = GNUNET_TESTING_get_barrier (is, barrier_name); | ||
104 | |||
105 | GNUNET_TESTING_finish_attached_cmds (is, barrier); | ||
106 | } | ||
107 | |||
108 | |||
85 | /** | 109 | /** |
86 | * Callback to set the flag indicating all peers started. Will be called via the plugin api. | 110 | * Callback to set the flag indicating all peers started. Will be called via the plugin api. |
87 | * | 111 | * |
@@ -338,8 +362,8 @@ start_testcase (TESTING_CMD_HELPER_write_cb write_message, char *router_ip, | |||
338 | 362 | ||
339 | ts->write_message = write_message; | 363 | ts->write_message = write_message; |
340 | 364 | ||
341 | GNUNET_TESTING_run (commands, | 365 | is = GNUNET_TESTING_run (commands, |
342 | GNUNET_TIME_UNIT_FOREVER_REL, | 366 | TIMEOUT, |
343 | &handle_result, | 367 | &handle_result, |
344 | ts); | 368 | ts); |
345 | 369 | ||
@@ -365,6 +389,8 @@ libgnunet_test_transport_plugin_cmd_simple_send_broadcast_init (void *cls) | |||
365 | api->start_testcase = &start_testcase; | 389 | api->start_testcase = &start_testcase; |
366 | api->all_peers_started = &all_peers_started; | 390 | api->all_peers_started = &all_peers_started; |
367 | api->all_local_tests_prepared = all_local_tests_prepared; | 391 | api->all_local_tests_prepared = all_local_tests_prepared; |
392 | api->barrier_advanced = barrier_advanced; | ||
393 | api->get_waiting_for_barriers = get_waiting_for_barriers; | ||
368 | return api; | 394 | return api; |
369 | } | 395 | } |
370 | 396 | ||