aboutsummaryrefslogtreecommitdiff
path: root/src/transport
diff options
context:
space:
mode:
Diffstat (limited to 'src/transport')
-rw-r--r--src/transport/test_transport_address_switch.c24
-rw-r--r--src/transport/test_transport_api_reliability.c17
2 files changed, 27 insertions, 14 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
diff --git a/src/transport/test_transport_api_reliability.c b/src/transport/test_transport_api_reliability.c
index 28594bbe3..91ef81868 100644
--- a/src/transport/test_transport_api_reliability.c
+++ b/src/transport/test_transport_api_reliability.c
@@ -227,14 +227,17 @@ end ()
227static void 227static void
228end_badly () 228end_badly ()
229{ 229{
230 int i; 230 unsigned int i;
231 die_task = NULL;
232 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Fail! Stopping peers\n");
233 231
232 die_task = NULL;
233 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
234 "Fail! Stopping peers\n");
234 if (test_connected == GNUNET_YES) 235 if (test_connected == GNUNET_YES)
235 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Peers got connected\n"); 236 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
237 "Peers got connected\n");
236 else 238 else
237 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Peers got NOT connected\n"); 239 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
240 "Peers got NOT connected\n");
238 241
239 if (test_sending == GNUNET_NO) 242 if (test_sending == GNUNET_NO)
240 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 243 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
@@ -246,7 +249,9 @@ end_badly ()
246 { 249 {
247 if (get_bit (bitmap, i) == 0) 250 if (get_bit (bitmap, i) == 0)
248 { 251 {
249 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Did not receive message %d\n", i); 252 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
253 "Did not receive message %u\n",
254 i);
250 ok = -1; 255 ok = -1;
251 } 256 }
252 } 257 }