gnunet-svn
[Top][All Lists]
Advanced

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

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


From: gnunet
Subject: [GNUnet-SVN] r35200 - gnunet/src/transport
Date: Mon, 9 Feb 2015 17:06:10 +0100

Author: grothoff
Date: 2015-02-09 17:06:10 +0100 (Mon, 09 Feb 2015)
New Revision: 35200

Modified:
   gnunet/src/transport/test_transport_address_switch.c
   gnunet/src/transport/test_transport_api_reliability.c
Log:
-report if testcase failure is because switching is not enforced, then do not 
fail hard

Modified: gnunet/src/transport/test_transport_address_switch.c
===================================================================
--- gnunet/src/transport/test_transport_address_switch.c        2015-02-09 
15:56:11 UTC (rev 35199)
+++ gnunet/src/transport/test_transport_address_switch.c        2015-02-09 
16:06:10 UTC (rev 35200)
@@ -325,7 +325,6 @@
     GNUNET_TRANSPORT_TESTING_stop_peer (tth, p2);
     p2 = NULL;
   }
-
 }
 
 
@@ -368,7 +367,7 @@
     if (p2_switch_success != p2_switch_attempts)
     {
       GNUNET_break (0);
-      result ++;
+      result++;
     }
   }
   else if (p2_addresses_avail > 1)
@@ -383,14 +382,14 @@
   {
     FPRINTF (stderr, "No data sent after switching!\n");
     GNUNET_break (0);
-    res ++;
+    res++;
   }
   if ( ((p1_switch_attempts > 0) || (p2_switch_attempts > 0)) &&
        (bytes_recv_after_switch == 0) )
   {
     FPRINTF (stderr, "No data received after switching!\n");
     GNUNET_break (0);
-    res ++;
+    res++;
   }
 
   clean_up();
@@ -403,16 +402,25 @@
 end_badly ()
 {
   die_task = NULL;
-  GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-              "Fail (timeout)! Stopping peers\n");
+  clean_up();
+  if (0 == p1_switch_attempts + p2_switch_attempts)
+  {
+    GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+                "Test did not work, as peers didn't switch (flawed 
testcase)!\n");
+    res = 0;
+  }
+  else
+  {
+    GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+              "Fail (timeout)! No transmission after switch! Stopping 
peers\n");
+    res = GNUNET_YES;
+  }
   if (test_connected == GNUNET_YES)
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                 "Peers got connected\n");
   else
     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
                 "Peers got NOT EVEN connected\n");
-  clean_up();
-  res = GNUNET_YES;
 }
 
 

Modified: gnunet/src/transport/test_transport_api_reliability.c
===================================================================
--- gnunet/src/transport/test_transport_api_reliability.c       2015-02-09 
15:56:11 UTC (rev 35199)
+++ gnunet/src/transport/test_transport_api_reliability.c       2015-02-09 
16:06:10 UTC (rev 35200)
@@ -227,14 +227,17 @@
 static void
 end_badly ()
 {
-  int i;
+  unsigned int i;
+
   die_task = NULL;
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Fail! Stopping peers\n");
-
+  GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+              "Fail! Stopping peers\n");
   if (test_connected == GNUNET_YES)
-    GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Peers got connected\n");
+    GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+                "Peers got connected\n");
   else
-    GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Peers got NOT connected\n");
+    GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+                "Peers got NOT connected\n");
 
   if (test_sending == GNUNET_NO)
     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
@@ -246,7 +249,9 @@
   {
     if (get_bit (bitmap, i) == 0)
     {
-      GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Did not receive message %d\n", i);
+      GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+                  "Did not receive message %u\n",
+                  i);
       ok = -1;
     }
   }




reply via email to

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