fix memory leak
[oweals/gnunet.git] / src / dv / test_transport_blacklist.c
index 1eaf95f05928836c76cae644c89104be68452db9..e40418a42048a79a30157b6123eaa0d66dbb0242 100644 (file)
@@ -1,6 +1,6 @@
 /*
      This file is part of GNUnet.
-     (C) 2009, 2013 Christian Grothoff (and other contributing authors)
+     Copyright (C) 2009, 2013 GNUnet e.V.
 
      GNUnet is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published
@@ -14,8 +14,8 @@
 
      You should have received a copy of the GNU General Public License
      along with GNUnet; see the file COPYING.  If not, write to the
-     Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-     Boston, MA 02111-1307, USA.
+     Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+     Boston, MA 02110-1301, USA.
 */
 /**
  * @file dv/test_transport_blacklist.c
@@ -33,16 +33,23 @@ static int ok;
 
 static void
 test_connection (void *cls,
+                 struct GNUNET_TESTBED_RunHandle *h,
                 unsigned int num_peers,
-                struct GNUNET_TESTBED_Peer **peers)
+                struct GNUNET_TESTBED_Peer **peers,
+                 unsigned int links_succeeded,
+                 unsigned int links_failed)
 {
-  if (4 != num_peers)
+  GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Links successful %u / %u failed\n", links_succeeded, links_failed);
+  if ( (4 == num_peers) && (0 == links_failed) )
   {
-    ok = 0;
+    GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+               "Testbed connect peers despite blacklist!\n");
+    ok = 1;
   }
   else
   {
-    fprintf (stderr, "Testbed connect peers despite blacklist!\n");
+    GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+               "Note that getting a message about a timeout during setup is expected for this test.\n");
   }
   GNUNET_SCHEDULER_shutdown ();
 }
@@ -51,7 +58,6 @@ test_connection (void *cls,
 int
 main (int argc, char *argv[])
 {
-  ok = 1;
   (void) GNUNET_TESTBED_test_run ("test-transport-blacklist",
                                  "test_transport_blacklist_data.conf",
                                  4,