aboutsummaryrefslogtreecommitdiff
path: root/src/transport/test_transport_address_switch.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/transport/test_transport_address_switch.c')
-rw-r--r--src/transport/test_transport_address_switch.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/transport/test_transport_address_switch.c b/src/transport/test_transport_address_switch.c
index 21dd417bf..fcbd798d0 100644
--- a/src/transport/test_transport_address_switch.c
+++ b/src/transport/test_transport_address_switch.c
@@ -228,9 +228,11 @@ clean_up ()
228 if (NULL != p1_stat) 228 if (NULL != p1_stat)
229 { 229 {
230 GNUNET_STATISTICS_watch_cancel (p1_stat, "transport", 230 GNUNET_STATISTICS_watch_cancel (p1_stat, "transport",
231 "# Attempts to switch addresses", stat_start_attempt_cb, p1); 231 "# Attempts to switch addresses",
232 stat_start_attempt_cb, p1);
232 GNUNET_STATISTICS_watch_cancel (p1_stat, "transport", 233 GNUNET_STATISTICS_watch_cancel (p1_stat, "transport",
233 "# Successful attempts to switch addresses", stat_success_attempt_cb, p1); 234 "# Successful attempts to switch addresses",
235 stat_success_attempt_cb, p1);
234 GNUNET_STATISTICS_watch_cancel (p1_stat, "transport", 236 GNUNET_STATISTICS_watch_cancel (p1_stat, "transport",
235 "# Failed attempts to switch addresses (failed to send CONNECT CONT)", 237 "# Failed attempts to switch addresses (failed to send CONNECT CONT)",
236 stat_fail_attempt_cb, p1); 238 stat_fail_attempt_cb, p1);
@@ -261,9 +263,9 @@ clean_up ()
261 GNUNET_STATISTICS_watch_cancel (p2_stat, "transport", 263 GNUNET_STATISTICS_watch_cancel (p2_stat, "transport",
262 "# Failed attempts to switch addresses (no response)", 264 "# Failed attempts to switch addresses (no response)",
263 stat_fail_attempt_cb, p2); 265 stat_fail_attempt_cb, p2);
264 GNUNET_STATISTICS_watch (p1_stat, "transport", 266 GNUNET_STATISTICS_watch (p2_stat, "transport",
265 "# transport addresses", 267 "# transport addresses",
266 stat_addresses_available, p1); 268 stat_addresses_available, p2);
267 GNUNET_STATISTICS_destroy (p2_stat, GNUNET_NO); 269 GNUNET_STATISTICS_destroy (p2_stat, GNUNET_NO);
268 p2_stat = NULL; 270 p2_stat = NULL;
269 } 271 }
@@ -313,7 +315,10 @@ end ()
313 FPRINTF (stderr, "Peer 1 tried %u times to switch and succeeded %u times, failed %u times\n", 315 FPRINTF (stderr, "Peer 1 tried %u times to switch and succeeded %u times, failed %u times\n",
314 p1_switch_attempts, p1_switch_success, p1_switch_fail); 316 p1_switch_attempts, p1_switch_success, p1_switch_fail);
315 if (p1_switch_success != p1_switch_attempts) 317 if (p1_switch_success != p1_switch_attempts)
318 {
319 GNUNET_break (0);
316 result ++; 320 result ++;
321 }
317 } 322 }
318 else 323 else
319 { 324 {
@@ -325,7 +330,10 @@ end ()
325 FPRINTF (stderr, "Peer 2 tried %u times to switch and succeeded %u times, failed %u times\n", 330 FPRINTF (stderr, "Peer 2 tried %u times to switch and succeeded %u times, failed %u times\n",
326 p2_switch_attempts, p2_switch_success, p2_switch_fail); 331 p2_switch_attempts, p2_switch_success, p2_switch_fail);
327 if (p2_switch_success != p2_switch_attempts) 332 if (p2_switch_success != p2_switch_attempts)
333 {
334 GNUNET_break (0);
328 result ++; 335 result ++;
336 }
329 } 337 }
330 else 338 else
331 { 339 {
@@ -337,12 +345,14 @@ end ()
337 (bytes_sent_after_switch == 0) ) 345 (bytes_sent_after_switch == 0) )
338 { 346 {
339 FPRINTF (stderr, "No data sent after switching!\n"); 347 FPRINTF (stderr, "No data sent after switching!\n");
348 GNUNET_break (0);
340 res ++; 349 res ++;
341 } 350 }
342 if ( ((p1_switch_attempts > 0) || (p2_switch_attempts > 0)) && 351 if ( ((p1_switch_attempts > 0) || (p2_switch_attempts > 0)) &&
343 (bytes_recv_after_switch == 0) ) 352 (bytes_recv_after_switch == 0) )
344 { 353 {
345 FPRINTF (stderr, "No data received after switching!\n"); 354 FPRINTF (stderr, "No data received after switching!\n");
355 GNUNET_break (0);
346 res ++; 356 res ++;
347 } 357 }
348 358