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.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/src/transport/test_transport_address_switch.c b/src/transport/test_transport_address_switch.c
index bf36c5bea..73047f89c 100644
--- a/src/transport/test_transport_address_switch.c
+++ b/src/transport/test_transport_address_switch.c
@@ -325,7 +325,6 @@ clean_up ()
325 GNUNET_TRANSPORT_TESTING_stop_peer (tth, p2); 325 GNUNET_TRANSPORT_TESTING_stop_peer (tth, p2);
326 p2 = NULL; 326 p2 = NULL;
327 } 327 }
328
329} 328}
330 329
331 330
@@ -368,7 +367,7 @@ end ()
368 if (p2_switch_success != p2_switch_attempts) 367 if (p2_switch_success != p2_switch_attempts)
369 { 368 {
370 GNUNET_break (0); 369 GNUNET_break (0);
371 result ++; 370 result++;
372 } 371 }
373 } 372 }
374 else if (p2_addresses_avail > 1) 373 else if (p2_addresses_avail > 1)
@@ -383,14 +382,14 @@ end ()
383 { 382 {
384 FPRINTF (stderr, "No data sent after switching!\n"); 383 FPRINTF (stderr, "No data sent after switching!\n");
385 GNUNET_break (0); 384 GNUNET_break (0);
386 res ++; 385 res++;
387 } 386 }
388 if ( ((p1_switch_attempts > 0) || (p2_switch_attempts > 0)) && 387 if ( ((p1_switch_attempts > 0) || (p2_switch_attempts > 0)) &&
389 (bytes_recv_after_switch == 0) ) 388 (bytes_recv_after_switch == 0) )
390 { 389 {
391 FPRINTF (stderr, "No data received after switching!\n"); 390 FPRINTF (stderr, "No data received after switching!\n");
392 GNUNET_break (0); 391 GNUNET_break (0);
393 res ++; 392 res++;
394 } 393 }
395 394
396 clean_up(); 395 clean_up();
@@ -403,16 +402,25 @@ static void
403end_badly () 402end_badly ()
404{ 403{
405 die_task = NULL; 404 die_task = NULL;
406 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 405 clean_up();
407 "Fail (timeout)! Stopping peers\n"); 406 if (0 == p1_switch_attempts + p2_switch_attempts)
407 {
408 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
409 "Test did not work, as peers didn't switch (flawed testcase)!\n");
410 res = 0;
411 }
412 else
413 {
414 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
415 "Fail (timeout)! No transmission after switch! Stopping peers\n");
416 res = GNUNET_YES;
417 }
408 if (test_connected == GNUNET_YES) 418 if (test_connected == GNUNET_YES)
409 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 419 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
410 "Peers got connected\n"); 420 "Peers got connected\n");
411 else 421 else
412 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 422 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
413 "Peers got NOT EVEN connected\n"); 423 "Peers got NOT EVEN connected\n");
414 clean_up();
415 res = GNUNET_YES;
416} 424}
417 425
418 426