aboutsummaryrefslogtreecommitdiff
path: root/src/conversation/test_conversation_api.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2016-06-27 13:48:21 +0000
committerChristian Grothoff <christian@grothoff.org>2016-06-27 13:48:21 +0000
commitbeae62bfc73edc1784efbcbb8efd74c07a057865 (patch)
tree953a0890b0d2bbdea5427e57fa91c72ffee2b018 /src/conversation/test_conversation_api.c
parent9db237899dd8db104328221e6911fcbbf9d0f3cf (diff)
downloadgnunet-beae62bfc73edc1784efbcbb8efd74c07a057865.tar.gz
gnunet-beae62bfc73edc1784efbcbb8efd74c07a057865.zip
handle failures more gracefully in test
Diffstat (limited to 'src/conversation/test_conversation_api.c')
-rw-r--r--src/conversation/test_conversation_api.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/conversation/test_conversation_api.c b/src/conversation/test_conversation_api.c
index f8159115b..fd9327805 100644
--- a/src/conversation/test_conversation_api.c
+++ b/src/conversation/test_conversation_api.c
@@ -67,9 +67,9 @@ static GNUNET_MICROPHONE_RecordedDataCallback call_rdc;
67 67
68static void *call_rdc_cls; 68static void *call_rdc_cls;
69 69
70static struct GNUNET_SCHEDULER_Task * phone_task; 70static struct GNUNET_SCHEDULER_Task *phone_task;
71 71
72static struct GNUNET_SCHEDULER_Task * call_task; 72static struct GNUNET_SCHEDULER_Task *call_task;
73 73
74 74
75static void 75static void
@@ -347,11 +347,14 @@ phone_event_handler (void *cls,
347 case GNUNET_CONVERSATION_EC_PHONE_HUNG_UP: 347 case GNUNET_CONVERSATION_EC_PHONE_HUNG_UP:
348 GNUNET_break (caller == active_caller); 348 GNUNET_break (caller == active_caller);
349 active_caller = NULL; 349 active_caller = NULL;
350 ok = 0; 350 if (1 == ok)
351 ok = 0;
351 GNUNET_SCHEDULER_shutdown (); 352 GNUNET_SCHEDULER_shutdown ();
352 break; 353 break;
353 default: 354 default:
354 fprintf (stderr, "Unexpected phone code: %d\n", code); 355 fprintf (stderr,
356 "Unexpected phone code: %d\n",
357 code);
355 break; 358 break;
356 } 359 }
357} 360}
@@ -376,12 +379,21 @@ call_event_handler (void *cls,
376 case GNUNET_CONVERSATION_EC_CALL_GNS_FAIL: 379 case GNUNET_CONVERSATION_EC_CALL_GNS_FAIL:
377 case GNUNET_CONVERSATION_EC_CALL_HUNG_UP: 380 case GNUNET_CONVERSATION_EC_CALL_HUNG_UP:
378 call = NULL; 381 call = NULL;
382 ok = 2;
383 GNUNET_break (0);
379 fprintf (stderr, "Unexpected call code: %d\n", code); 384 fprintf (stderr, "Unexpected call code: %d\n", code);
380 break; 385 break;
381 case GNUNET_CONVERSATION_EC_CALL_SUSPENDED: 386 case GNUNET_CONVERSATION_EC_CALL_SUSPENDED:
382 case GNUNET_CONVERSATION_EC_CALL_RESUMED: 387 case GNUNET_CONVERSATION_EC_CALL_RESUMED:
388 GNUNET_break (0);
389 fprintf (stderr, "Unexpected call code: %d\n", code);
390 ok = 2;
391 break;
383 case GNUNET_CONVERSATION_EC_CALL_ERROR: 392 case GNUNET_CONVERSATION_EC_CALL_ERROR:
393 GNUNET_break (0);
384 fprintf (stderr, "Unexpected call code: %d\n", code); 394 fprintf (stderr, "Unexpected call code: %d\n", code);
395 call = NULL;
396 ok = 2;
385 break; 397 break;
386 } 398 }
387} 399}