diff options
Diffstat (limited to 'src/testing/test_testing_reconnect.c')
-rw-r--r-- | src/testing/test_testing_reconnect.c | 32 |
1 files changed, 13 insertions, 19 deletions
diff --git a/src/testing/test_testing_reconnect.c b/src/testing/test_testing_reconnect.c index 1e028779f..480bafdc6 100644 --- a/src/testing/test_testing_reconnect.c +++ b/src/testing/test_testing_reconnect.c | |||
@@ -113,8 +113,7 @@ finish_testing (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
113 | 113 | ||
114 | 114 | ||
115 | static void | 115 | static void |
116 | my_connect_complete (void *cls, | 116 | my_connect_complete (void *cls, const struct GNUNET_PeerIdentity *first, |
117 | const struct GNUNET_PeerIdentity *first, | ||
118 | const struct GNUNET_PeerIdentity *second, | 117 | const struct GNUNET_PeerIdentity *second, |
119 | unsigned int distance, | 118 | unsigned int distance, |
120 | const struct GNUNET_CONFIGURATION_Handle *first_cfg, | 119 | const struct GNUNET_CONFIGURATION_Handle *first_cfg, |
@@ -134,32 +133,29 @@ my_connect_complete (void *cls, | |||
134 | 133 | ||
135 | 134 | ||
136 | static void | 135 | static void |
137 | my_cb2 (void *cls, | 136 | my_cb2 (void *cls, const struct GNUNET_PeerIdentity *id, |
138 | const struct GNUNET_PeerIdentity *id, | ||
139 | const struct GNUNET_CONFIGURATION_Handle *cfg, | 137 | const struct GNUNET_CONFIGURATION_Handle *cfg, |
140 | struct GNUNET_TESTING_Daemon *d, const char *emsg) | 138 | struct GNUNET_TESTING_Daemon *d, const char *emsg) |
141 | { | 139 | { |
142 | GNUNET_assert (id != NULL); | 140 | GNUNET_assert (id != NULL); |
143 | #if VERBOSE | 141 | #if VERBOSE |
144 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 142 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Daemon `%s' started.\n", |
145 | "Daemon `%s' started.\n", GNUNET_i2s (id)); | 143 | GNUNET_i2s (id)); |
146 | #endif | 144 | #endif |
147 | GNUNET_TESTING_daemons_connect (d1, d2, | 145 | GNUNET_TESTING_daemons_connect (d1, d2, TIMEOUT, CONNECT_ATTEMPTS, GNUNET_YES, |
148 | TIMEOUT, CONNECT_ATTEMPTS, | 146 | &my_connect_complete, NULL); |
149 | GNUNET_YES, &my_connect_complete, NULL); | ||
150 | } | 147 | } |
151 | 148 | ||
152 | 149 | ||
153 | static void | 150 | static void |
154 | my_cb1 (void *cls, | 151 | my_cb1 (void *cls, const struct GNUNET_PeerIdentity *id, |
155 | const struct GNUNET_PeerIdentity *id, | ||
156 | const struct GNUNET_CONFIGURATION_Handle *cfg, | 152 | const struct GNUNET_CONFIGURATION_Handle *cfg, |
157 | struct GNUNET_TESTING_Daemon *d, const char *emsg) | 153 | struct GNUNET_TESTING_Daemon *d, const char *emsg) |
158 | { | 154 | { |
159 | GNUNET_assert (id != NULL); | 155 | GNUNET_assert (id != NULL); |
160 | #if VERBOSE | 156 | #if VERBOSE |
161 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 157 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Daemon `%s' started.\n", |
162 | "Daemon `%s' started.\n", GNUNET_i2s (id)); | 158 | GNUNET_i2s (id)); |
163 | #endif | 159 | #endif |
164 | d2 = GNUNET_TESTING_daemon_start (c2, TIMEOUT, GNUNET_NO, NULL, NULL, 0, NULL, | 160 | d2 = GNUNET_TESTING_daemon_start (c2, TIMEOUT, GNUNET_NO, NULL, NULL, 0, NULL, |
165 | NULL, NULL, &my_cb2, NULL); | 161 | NULL, NULL, &my_cb2, NULL); |
@@ -168,9 +164,8 @@ my_cb1 (void *cls, | |||
168 | 164 | ||
169 | 165 | ||
170 | static void | 166 | static void |
171 | run (void *cls, | 167 | run (void *cls, char *const *args, const char *cfgfile, |
172 | char *const *args, | 168 | const struct GNUNET_CONFIGURATION_Handle *cfg) |
173 | const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *cfg) | ||
174 | { | 169 | { |
175 | ok = 1; | 170 | ok = 1; |
176 | #if VERBOSE | 171 | #if VERBOSE |
@@ -206,9 +201,8 @@ check () | |||
206 | struct GNUNET_GETOPT_CommandLineOption options[] = { | 201 | struct GNUNET_GETOPT_CommandLineOption options[] = { |
207 | GNUNET_GETOPT_OPTION_END | 202 | GNUNET_GETOPT_OPTION_END |
208 | }; | 203 | }; |
209 | GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1, | 204 | GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1, argv, |
210 | argv, "test-testing-reconnect", "nohelp", | 205 | "test-testing-reconnect", "nohelp", options, &run, &ok); |
211 | options, &run, &ok); | ||
212 | return ok; | 206 | return ok; |
213 | } | 207 | } |
214 | 208 | ||