gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r15960 - gnunet/src/transport


From: gnunet
Subject: [GNUnet-SVN] r15960 - gnunet/src/transport
Date: Thu, 14 Jul 2011 17:33:20 +0200

Author: wachs
Date: 2011-07-14 17:33:20 +0200 (Thu, 14 Jul 2011)
New Revision: 15960

Modified:
   gnunet/src/transport/test_transport_api_unreliability.c
Log:


Modified: gnunet/src/transport/test_transport_api_unreliability.c
===================================================================
--- gnunet/src/transport/test_transport_api_unreliability.c     2011-07-14 
15:30:07 UTC (rev 15959)
+++ gnunet/src/transport/test_transport_api_unreliability.c     2011-07-14 
15:33:20 UTC (rev 15960)
@@ -111,6 +111,8 @@
 static int p1_hello_canceled;
 static int p2_hello_canceled;
 
+static int test_failed;
+
 /**
  * Sets a bit active in the bitmap.
  *
@@ -257,23 +259,25 @@
 
 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);
@@ -283,6 +287,7 @@
 }
 
 
+
 struct TestMessage
 {
   struct GNUNET_MessageHeader header;
@@ -331,6 +336,7 @@
                  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;
     }
@@ -345,6 +351,7 @@
                  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;
     }
@@ -364,6 +371,7 @@
       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);
@@ -868,6 +876,8 @@
   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");
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]