aboutsummaryrefslogtreecommitdiff
path: root/src/transport/test_transport_address_switch.c
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2014-05-20 16:13:07 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2014-05-20 16:13:07 +0000
commit3a33753786eca144a1dd2c3c4884b78774f29e3b (patch)
treec46e80627c8e72cc79bfac7740f09f17bd0e788c /src/transport/test_transport_address_switch.c
parentaa6baad926e5488cfdb4e06b5cea2f4419737769 (diff)
downloadgnunet-3a33753786eca144a1dd2c3c4884b78774f29e3b.tar.gz
gnunet-3a33753786eca144a1dd2c3c4884b78774f29e3b.zip
improved test
Diffstat (limited to 'src/transport/test_transport_address_switch.c')
-rw-r--r--src/transport/test_transport_address_switch.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/src/transport/test_transport_address_switch.c b/src/transport/test_transport_address_switch.c
index 469dfbf55..21dd417bf 100644
--- a/src/transport/test_transport_address_switch.c
+++ b/src/transport/test_transport_address_switch.c
@@ -591,6 +591,19 @@ run (void *cls, char * const *args, const char *cfgfile,
591 591
592 p1 = GNUNET_TRANSPORT_TESTING_start_peer (tth, cfg_file_p1, 1, 592 p1 = GNUNET_TRANSPORT_TESTING_start_peer (tth, cfg_file_p1, 1,
593 &notify_receive, &notify_connect, &notify_disconnect, &start_cb, NULL ); 593 &notify_receive, &notify_connect, &notify_disconnect, &start_cb, NULL );
594
595 p2 = GNUNET_TRANSPORT_TESTING_start_peer (tth, cfg_file_p2, 2,
596 &notify_receive, &notify_connect, &notify_disconnect, &start_cb, NULL );
597
598 if ((p1 == NULL )|| (p2 == NULL))
599 {
600 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Fail! Could not start peers!\n");
601 if (die_task != GNUNET_SCHEDULER_NO_TASK)
602 GNUNET_SCHEDULER_cancel (die_task);
603 die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
604 return;
605 }
606
594 p1_stat = GNUNET_STATISTICS_create ("transport", p1->cfg); 607 p1_stat = GNUNET_STATISTICS_create ("transport", p1->cfg);
595 GNUNET_STATISTICS_watch (p1_stat, "transport", 608 GNUNET_STATISTICS_watch (p1_stat, "transport",
596 "# Attempts to switch addresses", 609 "# Attempts to switch addresses",
@@ -611,9 +624,6 @@ run (void *cls, char * const *args, const char *cfgfile,
611 "# transport addresses", 624 "# transport addresses",
612 stat_addresses_available, p1); 625 stat_addresses_available, p1);
613 626
614 p2 = GNUNET_TRANSPORT_TESTING_start_peer (tth, cfg_file_p2, 2,
615 &notify_receive, &notify_connect, &notify_disconnect, &start_cb, NULL );
616
617 p2_stat = GNUNET_STATISTICS_create ("transport", p2->cfg); 627 p2_stat = GNUNET_STATISTICS_create ("transport", p2->cfg);
618 GNUNET_STATISTICS_watch (p2_stat, "transport", 628 GNUNET_STATISTICS_watch (p2_stat, "transport",
619 "# Attempts to switch addresses", 629 "# Attempts to switch addresses",
@@ -634,15 +644,6 @@ run (void *cls, char * const *args, const char *cfgfile,
634 "# transport addresses", 644 "# transport addresses",
635 stat_addresses_available, p2); 645 stat_addresses_available, p2);
636 646
637 if ((p1 == NULL )|| (p2 == NULL))
638 {
639 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Fail! Could not start peers!\n");
640 if (die_task != GNUNET_SCHEDULER_NO_TASK)
641 GNUNET_SCHEDULER_cancel (die_task);
642 die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
643 return;
644 }
645
646 if ((p1_stat == NULL )|| (p2_stat == NULL)) 647 if ((p1_stat == NULL )|| (p2_stat == NULL))
647 { 648 {
648 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Fail! Could not create statistics for peers!\n"); 649 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Fail! Could not create statistics for peers!\n");