aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-05-18 05:34:34 +0000
committerChristian Grothoff <christian@grothoff.org>2012-05-18 05:34:34 +0000
commit45a6c8033e511e2d3dc3f20cb62248c77ee90725 (patch)
treec6ee2c18875b6bd4f950e463f04dcee3db8d2937
parent04630c5e40fc4de16393894d0b5ff2ca9055f4e2 (diff)
downloadgnunet-45a6c8033e511e2d3dc3f20cb62248c77ee90725.tar.gz
gnunet-45a6c8033e511e2d3dc3f20cb62248c77ee90725.zip
-code cleanup
-rw-r--r--src/dht/test_dht_monitor.c31
-rw-r--r--src/dht/test_dht_multipeer.c25
-rw-r--r--src/dht/test_dht_topo.c24
-rw-r--r--src/dht/test_dht_twopeer.c15
-rw-r--r--src/dht/test_dht_twopeer_get_put.c17
-rw-r--r--src/dht/test_dht_twopeer_put_get.c17
6 files changed, 13 insertions, 116 deletions
diff --git a/src/dht/test_dht_monitor.c b/src/dht/test_dht_monitor.c
index 62d1dcbde..62210e85c 100644
--- a/src/dht/test_dht_monitor.c
+++ b/src/dht/test_dht_monitor.c
@@ -31,8 +31,6 @@
31#include "gnunet_testing_lib.h" 31#include "gnunet_testing_lib.h"
32#include "gnunet_dht_service.h" 32#include "gnunet_dht_service.h"
33 33
34#define VERBOSE GNUNET_YES
35
36#define REMOVE_DIR GNUNET_YES 34#define REMOVE_DIR GNUNET_YES
37 35
38 36
@@ -137,17 +135,14 @@ shutdown_callback (void *cls, const char *emsg)
137{ 135{
138 if (emsg != NULL) 136 if (emsg != NULL)
139 { 137 {
140#if VERBOSE 138 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "test: Shutdown of peers failed: %s\n",
141 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: Shutdown of peers failed!\n"); 139 emsg);
142#endif
143 ok++; 140 ok++;
144 } 141 }
145 else 142 else
146 { 143 {
147#if VERBOSE
148 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 144 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
149 "test: All peers successfully shut down!\n"); 145 "test: All peers successfully shut down!\n");
150#endif
151 } 146 }
152 GNUNET_CONFIGURATION_destroy (testing_cfg); 147 GNUNET_CONFIGURATION_destroy (testing_cfg);
153} 148}
@@ -156,16 +151,12 @@ shutdown_callback (void *cls, const char *emsg)
156static void 151static void
157shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 152shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
158{ 153{
159#if VERBOSE
160 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: Ending test.\n"); 154 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: Ending test.\n");
161#endif
162
163 if (disconnect_task != GNUNET_SCHEDULER_NO_TASK) 155 if (disconnect_task != GNUNET_SCHEDULER_NO_TASK)
164 { 156 {
165 GNUNET_SCHEDULER_cancel (disconnect_task); 157 GNUNET_SCHEDULER_cancel (disconnect_task);
166 disconnect_task = GNUNET_SCHEDULER_NO_TASK; 158 disconnect_task = GNUNET_SCHEDULER_NO_TASK;
167 } 159 }
168
169 if (data_file != NULL) 160 if (data_file != NULL)
170 GNUNET_DISK_file_close (data_file); 161 GNUNET_DISK_file_close (data_file);
171 GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL); 162 GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL);
@@ -448,15 +439,9 @@ peergroup_ready (void *cls, const char *emsg)
448 GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL); 439 GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL);
449 return; 440 return;
450 } 441 }
451#if VERBOSE
452 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
453 "************************************************************\n");
454 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 442 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
455 "test: Peer Group started successfully!\n"); 443 "test: Peer Group started successfully with %u connections\n",
456 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: Have %u connections\n",
457 total_connections); 444 total_connections);
458#endif
459
460 if (data_file != NULL) 445 if (data_file != NULL)
461 { 446 {
462 buf = NULL; 447 buf = NULL;
@@ -564,19 +549,12 @@ run (void *cls, char *const *args, const char *cfgfile,
564 testing_cfg = GNUNET_CONFIGURATION_dup (cfg); 549 testing_cfg = GNUNET_CONFIGURATION_dup (cfg);
565 550
566 GNUNET_log_setup ("test_dht_monitor", 551 GNUNET_log_setup ("test_dht_monitor",
567#if VERBOSE
568 "DEBUG",
569#else
570 "WARNING", 552 "WARNING",
571#endif
572 NULL); 553 NULL);
573 554
574#if VERBOSE
575 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: Starting daemons.\n"); 555 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: Starting daemons.\n");
576 GNUNET_CONFIGURATION_set_value_string (testing_cfg, "testing", 556 GNUNET_CONFIGURATION_set_value_string (testing_cfg, "testing",
577 "use_progressbars", "YES"); 557 "use_progressbars", "YES");
578#endif
579
580 if (GNUNET_OK != 558 if (GNUNET_OK !=
581 GNUNET_CONFIGURATION_get_value_number (testing_cfg, "testing", 559 GNUNET_CONFIGURATION_get_value_number (testing_cfg, "testing",
582 "num_peers", &num_peers)) 560 "num_peers", &num_peers))
@@ -664,9 +642,6 @@ main (int xargc, char *xargv[])
664 char *const argv[] = { "test-dht-monitor", 642 char *const argv[] = { "test-dht-monitor",
665 "-c", 643 "-c",
666 "test_dht_line.conf", 644 "test_dht_line.conf",
667#if VERBOSE
668 "-L", "DEBUG",
669#endif
670 NULL 645 NULL
671 }; 646 };
672 647
diff --git a/src/dht/test_dht_multipeer.c b/src/dht/test_dht_multipeer.c
index a821b303c..9649405b1 100644
--- a/src/dht/test_dht_multipeer.c
+++ b/src/dht/test_dht_multipeer.c
@@ -27,9 +27,6 @@
27#include "gnunet_core_service.h" 27#include "gnunet_core_service.h"
28#include "gnunet_dht_service.h" 28#include "gnunet_dht_service.h"
29 29
30/* DEFINES */
31#define VERBOSE GNUNET_NO
32
33/* Timeout for entire testcase */ 30/* Timeout for entire testcase */
34#define TIMEOUT GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_MINUTES, 30) 31#define TIMEOUT GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_MINUTES, 30)
35 32
@@ -658,10 +655,9 @@ start_gets (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
658 unsigned long long j; 655 unsigned long long j;
659 struct TestGetContext *test_get; 656 struct TestGetContext *test_get;
660 657
661#if VERBOSE 658 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
662 FPRINTF (stderr, "Issuing %llu GETs\n", 659 "Issuing %llu GETs\n",
663 (unsigned long long) (num_peers * num_peers)); 660 (unsigned long long) (num_peers * num_peers));
664#endif
665 for (i = 0; i < num_peers; i++) 661 for (i = 0; i < num_peers; i++)
666 for (j = 0; j < num_peers; j++) 662 for (j = 0; j < num_peers; j++)
667 { 663 {
@@ -719,10 +715,9 @@ do_put (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
719 test_put->dht_handle = GNUNET_DHT_connect (test_put->daemon->cfg, 10); 715 test_put->dht_handle = GNUNET_DHT_connect (test_put->daemon->cfg, 10);
720 GNUNET_assert (test_put->dht_handle != NULL); 716 GNUNET_assert (test_put->dht_handle != NULL);
721 outstanding_puts++; 717 outstanding_puts++;
722#if VERBOSE > 2 718 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
723 FPRINTF (stderr, "PUT %u at `%s'\n", test_put->uid, 719 "PUT %u at `%s'\n", test_put->uid,
724 GNUNET_i2s (&test_put->daemon->id)); 720 GNUNET_i2s (&test_put->daemon->id));
725#endif
726 GNUNET_DHT_put (test_put->dht_handle, &key, 1, route_option, 721 GNUNET_DHT_put (test_put->dht_handle, &key, 1, route_option,
727 GNUNET_BLOCK_TYPE_TEST, sizeof (data), data, 722 GNUNET_BLOCK_TYPE_TEST, sizeof (data), data,
728 GNUNET_TIME_UNIT_FOREVER_ABS, GNUNET_TIME_UNIT_FOREVER_REL, 723 GNUNET_TIME_UNIT_FOREVER_ABS, GNUNET_TIME_UNIT_FOREVER_REL,
@@ -822,9 +817,6 @@ check ()
822 char *const argv[] = { "test-dht-multipeer", /* Name to give running binary */ 817 char *const argv[] = { "test-dht-multipeer", /* Name to give running binary */
823 "-c", 818 "-c",
824 "test_dht_multipeer_data.conf", /* Config file to use */ 819 "test_dht_multipeer_data.conf", /* Config file to use */
825#if VERBOSE
826 "-L", "DEBUG",
827#endif
828 NULL 820 NULL
829 }; 821 };
830 struct GNUNET_GETOPT_CommandLineOption options[] = { 822 struct GNUNET_GETOPT_CommandLineOption options[] = {
@@ -848,13 +840,8 @@ main (int argc, char *argv[])
848{ 840{
849 int ret; 841 int ret;
850 842
851
852 GNUNET_log_setup ("test-dht-multipeer", 843 GNUNET_log_setup ("test-dht-multipeer",
853#if VERBOSE
854 "DEBUG",
855#else
856 "WARNING", 844 "WARNING",
857#endif
858 NULL); 845 NULL);
859 ret = check (); 846 ret = check ();
860 /** 847 /**
diff --git a/src/dht/test_dht_topo.c b/src/dht/test_dht_topo.c
index cb0399da9..ed746a583 100644
--- a/src/dht/test_dht_topo.c
+++ b/src/dht/test_dht_topo.c
@@ -30,8 +30,6 @@
30#include "gnunet_testing_lib.h" 30#include "gnunet_testing_lib.h"
31#include "gnunet_dht_service.h" 31#include "gnunet_dht_service.h"
32 32
33#define VERBOSE GNUNET_NO
34
35#define REMOVE_DIR GNUNET_YES 33#define REMOVE_DIR GNUNET_YES
36 34
37/** 35/**
@@ -401,15 +399,9 @@ peergroup_ready (void *cls, const char *emsg)
401 GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL); 399 GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL);
402 return; 400 return;
403 } 401 }
404#if VERBOSE
405 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
406 "************************************************************\n");
407 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 402 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
408 "Peer Group started successfully!\n"); 403 "Peer Group started successfully with %u connections\n",
409 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Have %u connections\n",
410 total_connections); 404 total_connections);
411#endif
412
413 if (data_file != NULL) 405 if (data_file != NULL)
414 { 406 {
415 buf = NULL; 407 buf = NULL;
@@ -493,19 +485,11 @@ run (void *cls, char *const *args, const char *cfgfile,
493 testing_cfg = GNUNET_CONFIGURATION_dup (cfg); 485 testing_cfg = GNUNET_CONFIGURATION_dup (cfg);
494 486
495 GNUNET_log_setup ("test_dht_topo", 487 GNUNET_log_setup ("test_dht_topo",
496#if VERBOSE
497 "DEBUG",
498#else
499 "WARNING", 488 "WARNING",
500#endif
501 NULL); 489 NULL);
502
503#if VERBOSE
504 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Starting daemons.\n"); 490 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Starting daemons.\n");
505 GNUNET_CONFIGURATION_set_value_string (testing_cfg, "testing", 491 GNUNET_CONFIGURATION_set_value_string (testing_cfg, "testing",
506 "use_progressbars", "YES"); 492 "use_progressbars", "YES");
507#endif
508
509 if (GNUNET_OK != 493 if (GNUNET_OK !=
510 GNUNET_CONFIGURATION_get_value_number (testing_cfg, "testing", 494 GNUNET_CONFIGURATION_get_value_number (testing_cfg, "testing",
511 "num_peers", &num_peers)) 495 "num_peers", &num_peers))
@@ -593,17 +577,11 @@ main (int xargc, char *xargv[])
593 char *const argv_torus[] = { "test-dht-2dtorus", 577 char *const argv_torus[] = { "test-dht-2dtorus",
594 "-c", 578 "-c",
595 "test_dht_2dtorus.conf", 579 "test_dht_2dtorus.conf",
596#if VERBOSE
597 "-L", "DEBUG",
598#endif
599 NULL 580 NULL
600 }; 581 };
601 char *const argv_line[] = { "test-dht-line", 582 char *const argv_line[] = { "test-dht-line",
602 "-c", 583 "-c",
603 "test_dht_line.conf", 584 "test_dht_line.conf",
604#if VERBOSE
605 "-L", "DEBUG",
606#endif
607 NULL 585 NULL
608 }; 586 };
609 char *const *argv; 587 char *const *argv;
diff --git a/src/dht/test_dht_twopeer.c b/src/dht/test_dht_twopeer.c
index a3b6e4a54..6f2b0de18 100644
--- a/src/dht/test_dht_twopeer.c
+++ b/src/dht/test_dht_twopeer.c
@@ -306,7 +306,6 @@ topology_callback (void *cls, const struct GNUNET_PeerIdentity *first,
306 if (emsg == NULL) 306 if (emsg == NULL)
307 { 307 {
308 total_connections++; 308 total_connections++;
309#if VERBOSE
310 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 309 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
311 "connected peer %s to peer %s, distance %u\n", 310 "connected peer %s to peer %s, distance %u\n",
312 first_daemon->shortname, second_daemon->shortname, distance); 311 first_daemon->shortname, second_daemon->shortname, distance);
@@ -314,19 +313,16 @@ topology_callback (void *cls, const struct GNUNET_PeerIdentity *first,
314 else 313 else
315 { 314 {
316 failed_connections++; 315 failed_connections++;
317 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 316 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
318 "Failed to connect peer %s to peer %s with error :\n%s\n", 317 "Failed to connect peer %s to peer %s with error :\n%s\n",
319 first_daemon->shortname, second_daemon->shortname, emsg); 318 first_daemon->shortname, second_daemon->shortname, emsg);
320#endif
321 } 319 }
322 320
323 if (total_connections == expected_connections) 321 if (total_connections == expected_connections)
324 { 322 {
325#if VERBOSE
326 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 323 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
327 "Created %d total connections, which is our target number! Starting next phase of testing.\n", 324 "Created %d total connections, which is our target number! Starting next phase of testing.\n",
328 total_connections); 325 total_connections);
329#endif
330 GNUNET_SCHEDULER_cancel (die_task); 326 GNUNET_SCHEDULER_cancel (die_task);
331 die_task = 327 die_task =
332 GNUNET_SCHEDULER_add_delayed (TIMEOUT, &end_badly, 328 GNUNET_SCHEDULER_add_delayed (TIMEOUT, &end_badly,
@@ -409,10 +405,8 @@ peers_started_callback (void *cls, const struct GNUNET_PeerIdentity *id,
409 405
410 if (peers_left == 0) 406 if (peers_left == 0)
411 { 407 {
412#if VERBOSE
413 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 408 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
414 "All %d daemons started, now connecting peers!\n", num_peers); 409 "All %d daemons started, now connecting peers!\n", num_peers);
415#endif
416 GNUNET_SCHEDULER_cancel (die_task); 410 GNUNET_SCHEDULER_cancel (die_task);
417 /* Set up task in case topology creation doesn't finish 411 /* Set up task in case topology creation doesn't finish
418 * within a reasonable amount of time */ 412 * within a reasonable amount of time */
@@ -466,9 +460,6 @@ check ()
466 char *const argv[] = { "test-dht-twopeer", 460 char *const argv[] = { "test-dht-twopeer",
467 "-c", 461 "-c",
468 "test_dht_twopeer_data.conf", 462 "test_dht_twopeer_data.conf",
469#if VERBOSE
470 "-L", "DEBUG",
471#endif
472 NULL 463 NULL
473 }; 464 };
474 struct GNUNET_GETOPT_CommandLineOption options[] = { 465 struct GNUNET_GETOPT_CommandLineOption options[] = {
@@ -491,11 +482,7 @@ main (int argc, char *argv[])
491 int ret; 482 int ret;
492 483
493 GNUNET_log_setup ("test-dht-twopeer", 484 GNUNET_log_setup ("test-dht-twopeer",
494#if VERBOSE
495 "DEBUG",
496#else
497 "WARNING", 485 "WARNING",
498#endif
499 NULL); 486 NULL);
500 ret = check (); 487 ret = check ();
501 /** 488 /**
diff --git a/src/dht/test_dht_twopeer_get_put.c b/src/dht/test_dht_twopeer_get_put.c
index 4de4d6459..b32428bb4 100644
--- a/src/dht/test_dht_twopeer_get_put.c
+++ b/src/dht/test_dht_twopeer_get_put.c
@@ -391,29 +391,23 @@ topology_callback (void *cls, const struct GNUNET_PeerIdentity *first,
391 if (emsg == NULL) 391 if (emsg == NULL)
392 { 392 {
393 total_connections++; 393 total_connections++;
394#if VERBOSE
395 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 394 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
396 "connected peer %s to peer %s, distance %u\n", 395 "connected peer %s to peer %s, distance %u\n",
397 first_daemon->shortname, second_daemon->shortname, distance); 396 first_daemon->shortname, second_daemon->shortname, distance);
398#endif
399 } 397 }
400#if VERBOSE
401 else 398 else
402 { 399 {
403 failed_connections++; 400 failed_connections++;
404 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 401 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
405 "Failed to connect peer %s to peer %s with error :\n%s\n", 402 "Failed to connect peer %s to peer %s with error :\n%s\n",
406 first_daemon->shortname, second_daemon->shortname, emsg); 403 first_daemon->shortname, second_daemon->shortname, emsg);
407 } 404 }
408#endif
409 405
410 if (total_connections == expected_connections) 406 if (total_connections == expected_connections)
411 { 407 {
412#if VERBOSE
413 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 408 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
414 "Created %d total connections, which is our target number! Starting next phase of testing.\n", 409 "Created %d total connections, which is our target number! Starting next phase of testing.\n",
415 total_connections); 410 total_connections);
416#endif
417 GNUNET_SCHEDULER_cancel (die_task); 411 GNUNET_SCHEDULER_cancel (die_task);
418 die_task = 412 die_task =
419 GNUNET_SCHEDULER_add_delayed (TIMEOUT, &end_badly, "from test gets"); 413 GNUNET_SCHEDULER_add_delayed (TIMEOUT, &end_badly, "from test gets");
@@ -482,10 +476,8 @@ peers_started_callback (void *cls, const struct GNUNET_PeerIdentity *id,
482 476
483 if (peers_left == 0) /* Indicates all peers started */ 477 if (peers_left == 0) /* Indicates all peers started */
484 { 478 {
485#if VERBOSE
486 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 479 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
487 "All %d daemons started, now connecting peers!\n", num_peers); 480 "All %d daemons started, now connecting peers!\n", num_peers);
488#endif
489 expected_connections = -1; 481 expected_connections = -1;
490 if ((pg != NULL)) /* Sanity check */ 482 if ((pg != NULL)) /* Sanity check */
491 { 483 {
@@ -556,9 +548,6 @@ check ()
556 char *const argv[] = { "test-dht-twopeer-get-put", /* Name to give running binary */ 548 char *const argv[] = { "test-dht-twopeer-get-put", /* Name to give running binary */
557 "-c", 549 "-c",
558 "test_dht_twopeer_data.conf", /* Config file to use */ 550 "test_dht_twopeer_data.conf", /* Config file to use */
559#if VERBOSE
560 "-L", "DEBUG",
561#endif
562 NULL 551 NULL
563 }; 552 };
564 struct GNUNET_GETOPT_CommandLineOption options[] = { 553 struct GNUNET_GETOPT_CommandLineOption options[] = {
@@ -583,11 +572,7 @@ main (int argc, char *argv[])
583 int ret; 572 int ret;
584 573
585 GNUNET_log_setup ("test-dht-twopeer", 574 GNUNET_log_setup ("test-dht-twopeer",
586#if VERBOSE
587 "DEBUG",
588#else
589 "WARNING", 575 "WARNING",
590#endif
591 NULL); 576 NULL);
592 ret = check (); 577 ret = check ();
593 /** 578 /**
diff --git a/src/dht/test_dht_twopeer_put_get.c b/src/dht/test_dht_twopeer_put_get.c
index b2dd5a70b..e40848291 100644
--- a/src/dht/test_dht_twopeer_put_get.c
+++ b/src/dht/test_dht_twopeer_put_get.c
@@ -312,29 +312,23 @@ topology_callback (void *cls, const struct GNUNET_PeerIdentity *first,
312 if (emsg == NULL) 312 if (emsg == NULL)
313 { 313 {
314 total_connections++; 314 total_connections++;
315#if VERBOSE
316 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 315 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
317 "connected peer %s to peer %s, distance %u\n", 316 "connected peer %s to peer %s, distance %u\n",
318 first_daemon->shortname, second_daemon->shortname, distance); 317 first_daemon->shortname, second_daemon->shortname, distance);
319#endif
320 } 318 }
321#if VERBOSE
322 else 319 else
323 { 320 {
324 failed_connections++; 321 failed_connections++;
325 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 322 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
326 "Failed to connect peer %s to peer %s with error :\n%s\n", 323 "Failed to connect peer %s to peer %s with error :\n%s\n",
327 first_daemon->shortname, second_daemon->shortname, emsg); 324 first_daemon->shortname, second_daemon->shortname, emsg);
328 } 325 }
329#endif
330 326
331 if (total_connections == expected_connections) 327 if (total_connections == expected_connections)
332 { 328 {
333#if VERBOSE
334 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 329 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
335 "Created %d total connections, which is our target number! Starting next phase of testing.\n", 330 "Created %d total connections, which is our target number! Starting next phase of testing.\n",
336 total_connections); 331 total_connections);
337#endif
338 GNUNET_SCHEDULER_cancel (die_task); 332 GNUNET_SCHEDULER_cancel (die_task);
339 die_task = 333 die_task =
340 GNUNET_SCHEDULER_add_delayed (TIMEOUT, &end_badly, "from test gets"); 334 GNUNET_SCHEDULER_add_delayed (TIMEOUT, &end_badly, "from test gets");
@@ -402,10 +396,8 @@ peers_started_callback (void *cls, const struct GNUNET_PeerIdentity *id,
402 396
403 if (peers_left == 0) /* Indicates all peers started */ 397 if (peers_left == 0) /* Indicates all peers started */
404 { 398 {
405#if VERBOSE
406 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 399 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
407 "All %d daemons started, now connecting peers!\n", num_peers); 400 "All %d daemons started, now connecting peers!\n", num_peers);
408#endif
409 expected_connections = -1; 401 expected_connections = -1;
410 if ((pg != NULL)) /* Sanity check */ 402 if ((pg != NULL)) /* Sanity check */
411 { 403 {
@@ -476,9 +468,6 @@ check ()
476 char *const argv[] = { "test-dht-twopeer-put-get", /* Name to give running binary */ 468 char *const argv[] = { "test-dht-twopeer-put-get", /* Name to give running binary */
477 "-c", 469 "-c",
478 "test_dht_twopeer_data.conf", /* Config file to use */ 470 "test_dht_twopeer_data.conf", /* Config file to use */
479#if VERBOSE
480 "-L", "DEBUG",
481#endif
482 NULL 471 NULL
483 }; 472 };
484 struct GNUNET_GETOPT_CommandLineOption options[] = { 473 struct GNUNET_GETOPT_CommandLineOption options[] = {
@@ -503,11 +492,7 @@ main (int argc, char *argv[])
503 int ret; 492 int ret;
504 493
505 GNUNET_log_setup ("test-dht-twopeer", 494 GNUNET_log_setup ("test-dht-twopeer",
506#if VERBOSE
507 "DEBUG",
508#else
509 "WARNING", 495 "WARNING",
510#endif
511 NULL); 496 NULL);
512 ret = check (); 497 ret = check ();
513 /** 498 /**