diff options
Diffstat (limited to 'src/testing/test_testing_peergroup.c')
-rw-r--r-- | src/testing/test_testing_peergroup.c | 55 |
1 files changed, 25 insertions, 30 deletions
diff --git a/src/testing/test_testing_peergroup.c b/src/testing/test_testing_peergroup.c index 6359af754..f06864036 100644 --- a/src/testing/test_testing_peergroup.c +++ b/src/testing/test_testing_peergroup.c | |||
@@ -46,37 +46,35 @@ void | |||
46 | shutdown_callback (void *cls, const char *emsg) | 46 | shutdown_callback (void *cls, const char *emsg) |
47 | { | 47 | { |
48 | if (emsg != NULL) | 48 | if (emsg != NULL) |
49 | { | 49 | { |
50 | #if VERBOSE | 50 | #if VERBOSE |
51 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Shutdown of peers failed!\n"); | 51 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Shutdown of peers failed!\n"); |
52 | #endif | 52 | #endif |
53 | if (ok == 0) | 53 | if (ok == 0) |
54 | ok = 666; | 54 | ok = 666; |
55 | } | 55 | } |
56 | else | 56 | else |
57 | { | 57 | { |
58 | #if VERBOSE | 58 | #if VERBOSE |
59 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 59 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "All peers successfully shut down!\n"); |
60 | "All peers successfully shut down!\n"); | ||
61 | #endif | 60 | #endif |
62 | ok = 0; | 61 | ok = 0; |
63 | } | 62 | } |
64 | } | 63 | } |
65 | 64 | ||
66 | 65 | ||
67 | static void | 66 | static void |
68 | my_cb (void *cls, | 67 | my_cb (void *cls, const char *emsg) |
69 | const char *emsg) | ||
70 | { | 68 | { |
71 | if (emsg != NULL) | 69 | if (emsg != NULL) |
72 | { | 70 | { |
73 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 71 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
74 | "Peergroup callback called with error, aborting test!\n"); | 72 | "Peergroup callback called with error, aborting test!\n"); |
75 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Error from testing: `%s'\n"); | 73 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Error from testing: `%s'\n"); |
76 | ok = 1; | 74 | ok = 1; |
77 | GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL); | 75 | GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL); |
78 | return; | 76 | return; |
79 | } | 77 | } |
80 | 78 | ||
81 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 79 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
82 | "Peer Group started successfully, ending test!\n"); | 80 | "Peer Group started successfully, ending test!\n"); |
@@ -106,22 +104,19 @@ run (void *cls, | |||
106 | const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *cfg) | 104 | const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *cfg) |
107 | { | 105 | { |
108 | struct GNUNET_CONFIGURATION_Handle *testing_cfg; | 106 | struct GNUNET_CONFIGURATION_Handle *testing_cfg; |
107 | |||
109 | ok = 1; | 108 | ok = 1; |
110 | testing_cfg = GNUNET_CONFIGURATION_create(); | 109 | testing_cfg = GNUNET_CONFIGURATION_create (); |
111 | GNUNET_assert(GNUNET_OK == GNUNET_CONFIGURATION_load(testing_cfg, cfgfile)); | 110 | GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (testing_cfg, cfgfile)); |
112 | #if VERBOSE | 111 | #if VERBOSE |
113 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Starting daemons.\n"); | 112 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Starting daemons.\n"); |
114 | GNUNET_CONFIGURATION_set_value_string (testing_cfg, "testing", | 113 | GNUNET_CONFIGURATION_set_value_string (testing_cfg, "testing", |
115 | "use_progressbars", | 114 | "use_progressbars", "YES"); |
116 | "YES"); | ||
117 | #endif | 115 | #endif |
118 | peers_left = NUM_PEERS; | 116 | peers_left = NUM_PEERS; |
119 | pg = GNUNET_TESTING_peergroup_start(testing_cfg, | 117 | pg = GNUNET_TESTING_peergroup_start (testing_cfg, |
120 | peers_left, | 118 | peers_left, |
121 | TIMEOUT, | 119 | TIMEOUT, NULL, &my_cb, NULL, NULL); |
122 | NULL, | ||
123 | &my_cb, NULL, | ||
124 | NULL); | ||
125 | GNUNET_assert (pg != NULL); | 120 | GNUNET_assert (pg != NULL); |
126 | } | 121 | } |
127 | 122 | ||