gnunet-svn
[Top][All Lists]
Advanced

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

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


From: gnunet
Subject: [GNUnet-SVN] r15958 - gnunet/src/transport
Date: Thu, 14 Jul 2011 17:29:28 +0200

Author: wachs
Date: 2011-07-14 17:29:28 +0200 (Thu, 14 Jul 2011)
New Revision: 15958

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


Modified: gnunet/src/transport/test_transport_api_reliability.c
===================================================================
--- gnunet/src/transport/test_transport_api_reliability.c       2011-07-14 
15:24:23 UTC (rev 15957)
+++ gnunet/src/transport/test_transport_api_reliability.c       2011-07-14 
15:29:28 UTC (rev 15958)
@@ -80,6 +80,8 @@
 
 static int connected;
 
+static int test_failed;
+
 static unsigned long long total_bytes;
 
 static struct GNUNET_TIME_Absolute start_time;
@@ -163,14 +165,18 @@
 
 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);
+  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;
@@ -187,6 +193,7 @@
 }
 
 
+
 struct TestMessage
 {
   struct GNUNET_MessageHeader header;
@@ -233,6 +240,7 @@
                  ntohl (hdr->num));
       if (die_task != GNUNET_SCHEDULER_NO_TASK)
         GNUNET_SCHEDULER_cancel (die_task);
+      test_failed = GNUNET_YES;
       die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
       return;
     }
@@ -245,6 +253,7 @@
                  ntohl (hdr->num));
       if (die_task != GNUNET_SCHEDULER_NO_TASK)
         GNUNET_SCHEDULER_cancel (die_task);
+      test_failed = GNUNET_YES;
       die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
       return;
     }
@@ -258,6 +267,7 @@
                  n, (unsigned char) n);
       if (die_task != GNUNET_SCHEDULER_NO_TASK)
         GNUNET_SCHEDULER_cancel (die_task);
+      test_failed = GNUNET_YES;
       die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
       return;
     }
@@ -844,6 +854,8 @@
 {
   int ret;
 
+  test_failed = GNUNET_NO;
+
   if (strstr(argv[0], "tcp_nat") != NULL)
     {
       is_tcp_nat = GNUNET_YES;




reply via email to

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