removing fprintfs -- with bad %fmt statements giving warnings
[oweals/gnunet.git] / src / transport / test_transport_api.c
index e429ad7a7391ca797f2cb981197f59f4e6314b06..1f9c56974984f11daa0facfae5ee61d9954001df 100644 (file)
@@ -82,6 +82,8 @@ static int is_http;
 
 static int is_https;
 
+static int is_multi_protocol;
+
 static  GNUNET_SCHEDULER_TaskIdentifier die_task;
 
 static char * key_file_p1;
@@ -140,8 +142,7 @@ static void
 notify_receive (void *cls,
                 const struct GNUNET_PeerIdentity *peer,
                 const struct GNUNET_MessageHeader *message,
-                struct GNUNET_TIME_Relative latency,
-               uint32_t distance)
+                const struct GNUNET_TRANSPORT_ATS_Information *ats, uint32_t ats_count)
 {
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "ok is (%d)!\n",
               ok);
@@ -186,8 +187,7 @@ notify_ready (void *cls, size_t size, void *buf)
 static void
 notify_connect (void *cls,
                 const struct GNUNET_PeerIdentity *peer,
-                struct GNUNET_TIME_Relative latency,
-               uint32_t distance)
+                const struct GNUNET_TRANSPORT_ATS_Information *ats, uint32_t ats_count)
 {
   if (cls == &p1)
     {
@@ -346,6 +346,12 @@ run (void *cls,
   die_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT,
                                           &end_badly, NULL);
 
+  if (is_multi_protocol)
+    {
+      setup_peer (&p1, "test_transport_api_multi_peer1.conf");
+      setup_peer (&p2, "test_transport_api_multi_peer2.conf");
+    }
+
   if (is_udp)
     {
       setup_peer (&p1, "test_transport_api_udp_peer1.conf");
@@ -561,10 +567,22 @@ main (int argc, char *argv[])
     {
       is_http = GNUNET_YES;
     }
+  else if (strstr(argv[0], "multi") != NULL)
+    {
+         is_multi_protocol = GNUNET_YES;
+    }
 
   ret = check ();
-  GNUNET_DISK_directory_remove ("/tmp/test-gnunetd-transport-peer-1");
-  GNUNET_DISK_directory_remove ("/tmp/test-gnunetd-transport-peer-2");
+  if (is_multi_protocol)
+  {
+         GNUNET_DISK_directory_remove ("/tmp/test-gnunetd-transport-multi-peer-1/");
+         GNUNET_DISK_directory_remove ("/tmp/test-gnunetd-transport-multi-peer-2/");
+  }
+  else
+  {
+         GNUNET_DISK_directory_remove ("/tmp/test-gnunetd-transport-peer-1");
+         GNUNET_DISK_directory_remove ("/tmp/test-gnunetd-transport-peer-2");
+  }
   return ret;
 }