static int p1_hello_canceled;
static int p2_hello_canceled;
+static int test_failed;
+
/**
* Sets a bit active in the bitmap.
*
static void
end_badly (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+ const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- "Reliability failed: Last message sent %u Next message scheduled %u Last message received %u Message expected %u\n",
- msg_sent,
- msg_scheduled,
- msg_recv,
- msg_recv_expected);
- GNUNET_break (0);
-
+ if (test_failed == GNUNET_NO)
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Testcase timeout\n");
+ else
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Reliability failed: Last message sent %u, Next message scheduled %u, Last message received %u, Message expected %u\n",
+ msg_sent,
+ msg_scheduled,
+ msg_recv,
+ msg_recv_expected);
if (th_p2 != NULL)
GNUNET_TRANSPORT_notify_transmit_ready_cancel(th_p2);
th_p2 = NULL;
+ GNUNET_break (0);
GNUNET_TRANSPORT_disconnect (p1.th);
GNUNET_TRANSPORT_disconnect (p2.th);
-
if (GNUNET_SCHEDULER_NO_TASK != tct)
{
GNUNET_SCHEDULER_cancel (tct);
}
+
struct TestMessage
{
struct GNUNET_MessageHeader header;
ntohl (hdr->num));
if (GNUNET_SCHEDULER_NO_TASK != die_task)
GNUNET_SCHEDULER_cancel (die_task);
+ test_failed = GNUNET_YES;
die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
return;
}
ntohl(hdr->num), (unsigned char) n);
if (GNUNET_SCHEDULER_NO_TASK != die_task)
GNUNET_SCHEDULER_cancel (die_task);
+ test_failed = GNUNET_YES;
die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
return;
}
fprintf (stderr, ".");
if (GNUNET_SCHEDULER_NO_TASK != die_task)
GNUNET_SCHEDULER_cancel (die_task);
+ test_failed = GNUNET_YES;
die_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT,
&end_badly,
NULL);
return GNUNET_SYSERR;
#endif
+ test_failed = GNUNET_NO;
+
GNUNET_DISK_directory_remove ("/tmp/test-gnunetd-transport-peer-1");
GNUNET_DISK_directory_remove ("/tmp/test-gnunetd-transport-peer-2");