aboutsummaryrefslogtreecommitdiff
path: root/src/transport/test_communicator_basic.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/transport/test_communicator_basic.c')
-rw-r--r--src/transport/test_communicator_basic.c35
1 files changed, 32 insertions, 3 deletions
diff --git a/src/transport/test_communicator_basic.c b/src/transport/test_communicator_basic.c
index e99db7cfb..1dfcf2371 100644
--- a/src/transport/test_communicator_basic.c
+++ b/src/transport/test_communicator_basic.c
@@ -70,9 +70,9 @@ static struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue *my_tc;
70 70
71#define LONG_MESSAGE_SIZE 32000 71#define LONG_MESSAGE_SIZE 32000
72 72
73#define BURST_PACKETS 5000 73#define BURST_PACKETS 50
74 74
75#define TOTAL_ITERATIONS 5 75#define TOTAL_ITERATIONS 1
76 76
77#define PEER_A 0 77#define PEER_A 0
78 78
@@ -288,6 +288,34 @@ short_test (void *cls)
288 timeout = GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_SECONDS); 288 timeout = GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_SECONDS);
289} 289}
290 290
291static int test_prepared = GNUNET_NO;
292
293/**
294 * This helps establishing the backchannel
295 */
296static void
297prepare_test (void *cls)
298{
299 char *payload;
300
301 if (GNUNET_YES == test_prepared)
302 {
303 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS,
304 &short_test,
305 NULL);
306 return;
307 }
308 test_prepared = GNUNET_YES;
309 payload = make_payload (SHORT_MESSAGE_SIZE);
310 GNUNET_TRANSPORT_TESTING_transport_communicator_send (my_tc,
311 &prepare_test,
312 NULL,
313 payload,
314 SHORT_MESSAGE_SIZE);
315 GNUNET_free (payload);
316}
317
318
291 319
292/** 320/**
293 * @brief Handle opening of queue 321 * @brief Handle opening of queue
@@ -318,7 +346,7 @@ add_queue_cb (void *cls,
318 to_task = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS, 346 to_task = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS,
319 &latency_timeout, 347 &latency_timeout,
320 NULL); 348 NULL);
321 short_test (NULL); 349 prepare_test (NULL);
322} 350}
323 351
324 352
@@ -501,6 +529,7 @@ run (void *cls)
501 "transport", 529 "transport",
502 communicator_binary, 530 communicator_binary,
503 cfg_peers_name[i], 531 cfg_peers_name[i],
532 &peer_id[i],
504 &communicator_available_cb, 533 &communicator_available_cb,
505 &add_address_cb, 534 &add_address_cb,
506 &queue_create_reply_cb, 535 &queue_create_reply_cb,