aboutsummaryrefslogtreecommitdiff
path: root/src/testing/test_testing_topology.c
diff options
context:
space:
mode:
authorNathan S. Evans <evans@in.tum.de>2011-01-27 19:25:53 +0000
committerNathan S. Evans <evans@in.tum.de>2011-01-27 19:25:53 +0000
commit76dba8dc2275420dac68eb797a8bcc3b29d7257f (patch)
treef6fcdb3fc15cb9b8c737e539de335d5bdd81fbda /src/testing/test_testing_topology.c
parent3987e36bc0a7e14336bda1494c723fdd08d8bd8a (diff)
downloadgnunet-76dba8dc2275420dac68eb797a8bcc3b29d7257f.tar.gz
gnunet-76dba8dc2275420dac68eb797a8bcc3b29d7257f.zip
reduce topology overheads in testing, probably breaking some stuff
Diffstat (limited to 'src/testing/test_testing_topology.c')
-rw-r--r--src/testing/test_testing_topology.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/testing/test_testing_topology.c b/src/testing/test_testing_topology.c
index 8ad864be7..0e64f93aa 100644
--- a/src/testing/test_testing_topology.c
+++ b/src/testing/test_testing_topology.c
@@ -279,6 +279,7 @@ disconnect_cores (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
279 total_server_connections -= 2; 279 total_server_connections -= 2;
280} 280}
281 281
282#if DO_STATS
282static void 283static void
283stats_finished (void *cls, int result) 284stats_finished (void *cls, int result)
284{ 285{
@@ -306,6 +307,7 @@ stats_print (void *cls,
306 GNUNET_i2s (peer), subsystem, name, value); 307 GNUNET_i2s (peer), subsystem, name, value);
307 return GNUNET_OK; 308 return GNUNET_OK;
308} 309}
310#endif
309 311
310static void 312static void
311topology_cb (void *cls, 313topology_cb (void *cls,
@@ -331,9 +333,11 @@ topology_cb (void *cls,
331 { 333 {
332 fprintf (outfile, "}\n"); 334 fprintf (outfile, "}\n");
333 fclose (outfile); 335 fclose (outfile);
336#if DO_STATS
334 GNUNET_TESTING_get_statistics (pg, &stats_finished, &stats_print, 337 GNUNET_TESTING_get_statistics (pg, &stats_finished, &stats_print,
335 NULL); 338 NULL);
336 //GNUNET_SCHEDULER_add_now (&finish_testing, NULL); 339#endif
340 GNUNET_SCHEDULER_add_now (&finish_testing, NULL);
337 } 341 }
338 } 342 }
339} 343}
@@ -811,18 +815,19 @@ connect_topology ()
811 connect_topology_option, 815 connect_topology_option,
812 connect_topology_option_modifier, 816 connect_topology_option_modifier,
813 &topology_creation_finished, NULL); 817 &topology_creation_finished, NULL);
814#if VERBOSE > 1 818#if VERBOSE
815 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 819 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
816 "Have %d expected connections\n", expected_connections); 820 "Have %d expected connections\n", expected_connections);
817#endif 821#endif
818 } 822 }
819 823
820 GNUNET_SCHEDULER_cancel (die_task); 824 GNUNET_SCHEDULER_cancel (die_task);
821 if (expected_connections == GNUNET_SYSERR) 825 if (expected_connections < 1)
822 { 826 {
823 die_task = 827 die_task =
824 GNUNET_SCHEDULER_add_now (&end_badly, 828 GNUNET_SCHEDULER_add_now (&end_badly,
825 "from connect topology (bad return)"); 829 "from connect topology (bad return)");
830 return;
826 } 831 }
827 832
828 die_task = GNUNET_SCHEDULER_add_delayed (TEST_TIMEOUT, 833 die_task = GNUNET_SCHEDULER_add_delayed (TEST_TIMEOUT,