aboutsummaryrefslogtreecommitdiff
path: root/src/testing/test_testing_large_topology.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/testing/test_testing_large_topology.c')
-rw-r--r--src/testing/test_testing_large_topology.c62
1 files changed, 31 insertions, 31 deletions
diff --git a/src/testing/test_testing_large_topology.c b/src/testing/test_testing_large_topology.c
index e966ca137..2bca7b3b9 100644
--- a/src/testing/test_testing_large_topology.c
+++ b/src/testing/test_testing_large_topology.c
@@ -245,7 +245,7 @@ finish_testing ()
245 245
246 if (dotOutFile != NULL) 246 if (dotOutFile != NULL)
247 { 247 {
248 fprintf (dotOutFile, "}"); 248 FPRINTF (dotOutFile, "%s", "}");
249 fclose (dotOutFile); 249 fclose (dotOutFile);
250 } 250 }
251 251
@@ -290,19 +290,19 @@ topology_cb (void *cls, const struct GNUNET_PeerIdentity *first,
290 { 290 {
291 if (outfile != NULL) 291 if (outfile != NULL)
292 { 292 {
293 fprintf (outfile, "\t\"%s\" -- ", GNUNET_i2s (first)); 293 FPRINTF (outfile, "\t\"%s\" -- ", GNUNET_i2s (first));
294 fprintf (outfile, "\"%s\";\n", GNUNET_i2s (second)); 294 FPRINTF (outfile, "\"%s\";\n", GNUNET_i2s (second));
295 } 295 }
296 topology_connections++; 296 topology_connections++;
297 } 297 }
298 else 298 else
299 { 299 {
300 fprintf (stderr, 300 FPRINTF (stderr,
301 "Finished iterating over topology, %d total connections!\n", 301 "Finished iterating over topology, %d total connections!\n",
302 topology_connections); 302 topology_connections);
303 if (outfile != NULL) 303 if (outfile != NULL)
304 { 304 {
305 fprintf (outfile, "}\n"); 305 FPRINTF (outfile, "%s", "}\n");
306 fclose (outfile); 306 fclose (outfile);
307 GNUNET_SCHEDULER_add_now (&finish_testing, NULL); 307 GNUNET_SCHEDULER_add_now (&finish_testing, NULL);
308 } 308 }
@@ -326,16 +326,16 @@ process_mtype (void *cls, const struct GNUNET_PeerIdentity *peer,
326 if ((total_messages_received) % modnum == 0) 326 if ((total_messages_received) % modnum == 0)
327 { 327 {
328 if (total_messages_received == 0) 328 if (total_messages_received == 0)
329 fprintf (stdout, "0%%"); 329 FPRINTF (stdout, "%s", "0%%");
330 else 330 else
331 fprintf (stdout, "%d%%", 331 FPRINTF (stdout, "%d%%",
332 (int) (((float) total_messages_received / expected_messages) * 332 (int) (((float) total_messages_received / expected_messages) *
333 100)); 333 100));
334 334
335 } 335 }
336 else if (total_messages_received % dotnum == 0) 336 else if (total_messages_received % dotnum == 0)
337 { 337 {
338 fprintf (stdout, "."); 338 FPRINTF (stdout, "%s", ".");
339 } 339 }
340 fflush (stdout); 340 fflush (stdout);
341#endif 341#endif
@@ -354,7 +354,7 @@ process_mtype (void *cls, const struct GNUNET_PeerIdentity *peer,
354 if (total_messages_received == expected_messages) 354 if (total_messages_received == expected_messages)
355 { 355 {
356#if VERBOSE 356#if VERBOSE
357 fprintf (stdout, "100%%]\n"); 357 FPRINTF (stdout, "%s", "100%%]\n");
358#endif 358#endif
359 GNUNET_SCHEDULER_cancel (die_task); 359 GNUNET_SCHEDULER_cancel (die_task);
360 GNUNET_asprintf (&dotOutFileNameFinished, "%s.dot", "final_topology"); 360 GNUNET_asprintf (&dotOutFileNameFinished, "%s.dot", "final_topology");
@@ -362,7 +362,7 @@ process_mtype (void *cls, const struct GNUNET_PeerIdentity *peer,
362 GNUNET_free (dotOutFileNameFinished); 362 GNUNET_free (dotOutFileNameFinished);
363 if (dotOutFileFinished != NULL) 363 if (dotOutFileFinished != NULL)
364 { 364 {
365 fprintf (dotOutFileFinished, "strict graph G {\n"); 365 FPRINTF (dotOutFileFinished, "%s", "strict graph G {\n");
366 } 366 }
367 topology_connections = 0; 367 topology_connections = 0;
368 GNUNET_TESTING_get_topology (pg, &topology_cb, dotOutFileFinished); 368 GNUNET_TESTING_get_topology (pg, &topology_cb, dotOutFileFinished);
@@ -424,7 +424,7 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
424 424
425 if (dotOutFile != NULL) 425 if (dotOutFile != NULL)
426 { 426 {
427 fprintf (dotOutFile, "}"); 427 FPRINTF (dotOutFile, "%s", "}");
428 fclose (dotOutFile); 428 fclose (dotOutFile);
429 } 429 }
430} 430}
@@ -639,16 +639,16 @@ topology_callback (void *cls, const struct GNUNET_PeerIdentity *first,
639 if ((total_connections) % modnum == 0) 639 if ((total_connections) % modnum == 0)
640 { 640 {
641 if (total_connections == 0) 641 if (total_connections == 0)
642 fprintf (stdout, "0%%"); 642 FPRINTF (stdout, "%s", "0%%");
643 else 643 else
644 fprintf (stdout, "%d%%", 644 FPRINTF (stdout, "%d%%",
645 (int) (((float) total_connections / expected_connections) * 645 (int) (((float) total_connections / expected_connections) *
646 100)); 646 100));
647 647
648 } 648 }
649 else if (total_connections % dotnum == 0) 649 else if (total_connections % dotnum == 0)
650 { 650 {
651 fprintf (stdout, "."); 651 FPRINTF (stdout, "%s", ".");
652 } 652 }
653 fflush (stdout); 653 fflush (stdout);
654#endif 654#endif
@@ -667,7 +667,7 @@ topology_callback (void *cls, const struct GNUNET_PeerIdentity *first,
667 667
668 expected_messages++; 668 expected_messages++;
669 if (dotOutFile != NULL) 669 if (dotOutFile != NULL)
670 fprintf (dotOutFile, "\tn%s -- n%s;\n", first_daemon->shortname, 670 FPRINTF (dotOutFile, "\tn%s -- n%s;\n", first_daemon->shortname,
671 second_daemon->shortname); 671 second_daemon->shortname);
672 } 672 }
673#if VERBOSE 673#if VERBOSE
@@ -683,7 +683,7 @@ topology_callback (void *cls, const struct GNUNET_PeerIdentity *first,
683 if (total_connections == expected_connections) 683 if (total_connections == expected_connections)
684 { 684 {
685#if VERBOSE 685#if VERBOSE
686 fprintf (stdout, "100%%]\n"); 686 FPRINTF (stdout, "%s", "100%%]\n");
687#endif 687#endif
688#if VERBOSE 688#if VERBOSE
689 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 689 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -695,7 +695,7 @@ topology_callback (void *cls, const struct GNUNET_PeerIdentity *first,
695 GNUNET_SCHEDULER_cancel (die_task); 695 GNUNET_SCHEDULER_cancel (die_task);
696 die_task = GNUNET_SCHEDULER_NO_TASK; 696 die_task = GNUNET_SCHEDULER_NO_TASK;
697#if DELAY_FOR_LOGGING 697#if DELAY_FOR_LOGGING
698 fprintf (stdout, "Sending test messages in 10 seconds.\n"); 698 FPRINTF (stdout, "%s", "Sending test messages in 10 seconds.\n");
699 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply 699 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply
700 (GNUNET_TIME_UNIT_SECONDS, 10), 700 (GNUNET_TIME_UNIT_SECONDS, 10),
701 &send_test_messages, test_messages); 701 &send_test_messages, test_messages);
@@ -709,7 +709,7 @@ topology_callback (void *cls, const struct GNUNET_PeerIdentity *first,
709 test_messages); 709 test_messages);
710#endif 710#endif
711#if VERBOSE 711#if VERBOSE
712 fprintf (stdout, "Test message progress: ["); 712 FPRINTF (stdout, "%s", "Test message progress: [");
713#endif 713#endif
714 714
715 } 715 }
@@ -784,7 +784,7 @@ connect_topology ()
784 modnum = expected_connections / 4; 784 modnum = expected_connections / 4;
785 dotnum = (expected_connections / 50) + 1; 785 dotnum = (expected_connections / 50) + 1;
786#if VERBOSE 786#if VERBOSE
787 fprintf (stdout, "Peer connection progress: ["); 787 FPRINTF (stdout, "%s", "Peer connection progress: [");
788#endif 788#endif
789} 789}
790 790
@@ -798,7 +798,7 @@ create_topology ()
798#if VERBOSE 798#if VERBOSE
799 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 799 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
800 "Topology set up, now starting peers!\n"); 800 "Topology set up, now starting peers!\n");
801 fprintf (stdout, "Daemon start progress ["); 801 FPRINTF (stdout, "%s", "Daemon start progress [");
802#endif 802#endif
803 GNUNET_TESTING_daemons_continue_startup (pg); 803 GNUNET_TESTING_daemons_continue_startup (pg);
804 } 804 }
@@ -836,15 +836,15 @@ peers_started_callback (void *cls, const struct GNUNET_PeerIdentity *id,
836 if ((num_peers - peers_left) % modnum == 0) 836 if ((num_peers - peers_left) % modnum == 0)
837 { 837 {
838 if (num_peers - peers_left == 0) 838 if (num_peers - peers_left == 0)
839 fprintf (stdout, "0%%"); 839 FPRINTF (stdout, "%s", "0%%");
840 else 840 else
841 fprintf (stdout, "%d%%", 841 FPRINTF (stdout, "%d%%",
842 (int) (((float) (num_peers - peers_left) / num_peers) * 100)); 842 (int) (((float) (num_peers - peers_left) / num_peers) * 100));
843 843
844 } 844 }
845 else if ((num_peers - peers_left) % dotnum == 0) 845 else if ((num_peers - peers_left) % dotnum == 0)
846 { 846 {
847 fprintf (stdout, "."); 847 FPRINTF (stdout, "%s", ".");
848 } 848 }
849 fflush (stdout); 849 fflush (stdout);
850#endif 850#endif
@@ -852,7 +852,7 @@ peers_started_callback (void *cls, const struct GNUNET_PeerIdentity *id,
852 if (peers_left == 0) 852 if (peers_left == 0)
853 { 853 {
854#if VERBOSE 854#if VERBOSE
855 fprintf (stdout, "100%%]\n"); 855 FPRINTF (stdout, "%s", "100%%]\n");
856#endif 856#endif
857#if VERBOSE 857#if VERBOSE
858 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 858 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -865,7 +865,7 @@ peers_started_callback (void *cls, const struct GNUNET_PeerIdentity *id,
865 GNUNET_SCHEDULER_add_delayed (timeout, &end_badly, 865 GNUNET_SCHEDULER_add_delayed (timeout, &end_badly,
866 "from peers_started_callback"); 866 "from peers_started_callback");
867#if DELAY_FOR_LOGGING 867#if DELAY_FOR_LOGGING
868 fprintf (stdout, "Connecting topology in 10 seconds\n"); 868 FPRINTF (stdout, "%s", "Connecting topology in 10 seconds\n");
869 gather_log_data (); 869 gather_log_data ();
870 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply 870 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply
871 (GNUNET_TIME_UNIT_SECONDS, 10), 871 (GNUNET_TIME_UNIT_SECONDS, 10),
@@ -905,15 +905,15 @@ hostkey_callback (void *cls, const struct GNUNET_PeerIdentity *id,
905 if ((num_peers - peers_left) % modnum == 0) 905 if ((num_peers - peers_left) % modnum == 0)
906 { 906 {
907 if (num_peers - peers_left == 0) 907 if (num_peers - peers_left == 0)
908 fprintf (stdout, "0%%"); 908 FPRINTF (stdout, "%s", "0%%");
909 else 909 else
910 fprintf (stdout, "%d%%", 910 FPRINTF (stdout, "%d%%",
911 (int) (((float) (num_peers - peers_left) / num_peers) * 100)); 911 (int) (((float) (num_peers - peers_left) / num_peers) * 100));
912 912
913 } 913 }
914 else if ((num_peers - peers_left) % dotnum == 0) 914 else if ((num_peers - peers_left) % dotnum == 0)
915 { 915 {
916 fprintf (stdout, "."); 916 FPRINTF (stdout, "%s", ".");
917 } 917 }
918 fflush (stdout); 918 fflush (stdout);
919#endif 919#endif
@@ -921,7 +921,7 @@ hostkey_callback (void *cls, const struct GNUNET_PeerIdentity *id,
921 if (peers_left == 0) 921 if (peers_left == 0)
922 { 922 {
923#if VERBOSE 923#if VERBOSE
924 fprintf (stdout, "100%%]\n"); 924 FPRINTF (stdout, "%s", "100%%]\n");
925 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 925 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
926 "All %d hostkeys created, now creating topology!\n", num_peers); 926 "All %d hostkeys created, now creating topology!\n", num_peers);
927#endif 927#endif
@@ -952,7 +952,7 @@ run (void *cls, char *const *args, const char *cfgfile,
952 dotOutFile = fopen (dotOutFileName, "w"); 952 dotOutFile = fopen (dotOutFileName, "w");
953 if (dotOutFile != NULL) 953 if (dotOutFile != NULL)
954 { 954 {
955 fprintf (dotOutFile, "strict graph G {\n"); 955 FPRINTF (dotOutFile, "%s", "strict graph G {\n");
956 } 956 }
957 957
958#if VERBOSE 958#if VERBOSE
@@ -1101,7 +1101,7 @@ run (void *cls, char *const *args, const char *cfgfile,
1101 modnum = num_peers / 4; 1101 modnum = num_peers / 4;
1102 dotnum = (num_peers / 50) + 1; 1102 dotnum = (num_peers / 50) + 1;
1103#if VERBOSE 1103#if VERBOSE
1104 fprintf (stdout, "Hostkey generation progress: ["); 1104 FPRINTF (stdout, "%s", "Hostkey generation progress: [");
1105#endif 1105#endif
1106 /* Set up a task to end testing if peer start fails */ 1106 /* Set up a task to end testing if peer start fails */
1107 die_task = 1107 die_task =