gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r22498 - gnunet/src/mesh


From: gnunet
Subject: [GNUnet-SVN] r22498 - gnunet/src/mesh
Date: Thu, 5 Jul 2012 16:23:13 +0200

Author: bartpolot
Date: 2012-07-05 16:23:13 +0200 (Thu, 05 Jul 2012)
New Revision: 22498

Modified:
   gnunet/src/mesh/test_mesh_regex.c
Log:
- simplified checks for success

Modified: gnunet/src/mesh/test_mesh_regex.c
===================================================================
--- gnunet/src/mesh/test_mesh_regex.c   2012-07-05 13:55:50 UTC (rev 22497)
+++ gnunet/src/mesh/test_mesh_regex.c   2012-07-05 14:23:13 UTC (rev 22498)
@@ -117,7 +117,7 @@
   {
     GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
                 "test: Shutdown of peers failed! (%s)\n", emsg);
-    ok--;
+    ok = GNUNET_NO;
   }
 #if VERBOSE
   else
@@ -156,7 +156,9 @@
 static void
 disconnect_peers (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
 {
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: disconnecting peers\n");
+    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+              "************************************************\n");
+    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: disconnecting peers\n");
 
   GNUNET_MESH_tunnel_destroy (t);
   GNUNET_MESH_disconnect (h1);
@@ -226,9 +228,9 @@
               GNUNET_i2s (peer));
 
   if (i != 1L || peer == NULL)
-    ok = 0;
+    ok = GNUNET_NO;
   else
-    ok = 1;
+    ok = GNUNET_OK;
   if (GNUNET_SCHEDULER_NO_TASK != disconnect_task)
   {
     GNUNET_SCHEDULER_cancel (disconnect_task);
@@ -256,7 +258,7 @@
   GNUNET_log (GNUNET_ERROR_TYPE_INFO,
               "Incoming tunnel from %s to peer %d\n",
               GNUNET_i2s (initiator), (long) cls);
-  ok++;
+//   ok++;
   GNUNET_log (GNUNET_ERROR_TYPE_INFO, " ok: %d\n", ok);
   if ((long) cls == 2L)
     incoming_t = tunnel;
@@ -321,7 +323,7 @@
                 "test: Peergroup callback called with error, aborting 
test!\n");
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: Error from testing: `%s'\n",
                 emsg);
-    ok--;
+    ok = GNUNET_NO;
     GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL);
     return;
   }
@@ -337,13 +339,12 @@
   peers_running = GNUNET_TESTING_daemons_running (pg);
   if (0 < failed_connections)
   {
-    ok = GNUNET_SYSERR;
+    ok = GNUNET_NO;
     GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "test: %u connections have FAILED!\n",
                 failed_connections);
     disconnect_task = GNUNET_SCHEDULER_add_now (&disconnect_peers, NULL);
     return;
   }
-  ok = 0;
   disconnect_task =
     GNUNET_SCHEDULER_add_delayed (TIMEOUT, &disconnect_peers, NULL);
   d1 = GNUNET_TESTING_daemon_get (pg, 1);
@@ -374,7 +375,7 @@
               
"************************************************************\n");
   GNUNET_log (GNUNET_ERROR_TYPE_INFO,
               "Create tunnel\n");
-  t = GNUNET_MESH_tunnel_create (h1, NULL, &ch, &dh, NULL);
+  t = GNUNET_MESH_tunnel_create (h1, NULL, &ch, &dh, (void *) 1L);
   GNUNET_log (GNUNET_ERROR_TYPE_INFO,
               
"************************************************************\n");
   GNUNET_log (GNUNET_ERROR_TYPE_INFO,
@@ -515,7 +516,7 @@
 #endif
   if (GNUNET_OK != ok)
   {
-    GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "test: FAILED!\n");
+    GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "test: FAILED! (ok = %d)\n", ok);
     return 1;
   }
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: success\n");




reply via email to

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