fix
[oweals/gnunet.git] / src / core / test_core_api_start_only.c
index 5ca750664b9175edc221e675544ccf3ad635de56..b55d3c972771820a22045c90356b8809b7c2bfb5 100644 (file)
@@ -4,7 +4,7 @@
 
      GNUnet is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published
-     by the Free Software Foundation; either version 2, or (at your
+     by the Free Software Foundation; either version 3, or (at your
      option) any later version.
 
      GNUnet is distributed in the hope that it will be useful, but
@@ -39,7 +39,7 @@
 /**
  * How long until we give up on transmitting the message?
  */
-#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 30)
+#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 120)
 
 #define MTYPE 12345
 
@@ -71,7 +71,9 @@ static int ok;
 
 static void
 connect_notify (void *cls,
-                const struct GNUNET_PeerIdentity *peer)
+                const struct GNUNET_PeerIdentity *peer,
+               struct GNUNET_TIME_Relative latency,
+               uint32_t distance)
 {
 }
 
@@ -83,20 +85,12 @@ disconnect_notify (void *cls,
 }
 
 
-static unsigned int
-bfc_callback (void *cls,
-              const struct GNUNET_PeerIdentity *receiver,
-              void *position, 
-             size_t padding)
-{
-  return 0;
-}
-
-
 static int
 inbound_notify (void *cls,
                 const struct GNUNET_PeerIdentity *other,
-                const struct GNUNET_MessageHeader *message)
+                const struct GNUNET_MessageHeader *message,
+               struct GNUNET_TIME_Relative latency,
+               uint32_t distance)
 {
   return GNUNET_OK;
 }
@@ -105,7 +99,9 @@ inbound_notify (void *cls,
 static int
 outbound_notify (void *cls,
                  const struct GNUNET_PeerIdentity *other,
-                 const struct GNUNET_MessageHeader *message)
+                 const struct GNUNET_MessageHeader *message,
+                struct GNUNET_TIME_Relative latency,
+                uint32_t distance)
 {
   return GNUNET_OK;
 }
@@ -134,10 +130,10 @@ init_notify (void *cls,
                            p2.cfg,
                            TIMEOUT,
                            &p2,
-                           &init_notify,
+                           &init_notify,                        
                            &connect_notify,
                            &disconnect_notify,
-                           &bfc_callback,
+                          NULL,
                            &inbound_notify,
                            GNUNET_YES,
                            &outbound_notify, GNUNET_YES, handlers);
@@ -147,9 +143,6 @@ init_notify (void *cls,
       GNUNET_assert (cls == &p2);
       GNUNET_CORE_disconnect (p1.ch);
       GNUNET_CORE_disconnect (p2.ch);
-      GNUNET_ARM_stop_services (p1.cfg, sched, "core", NULL);
-      GNUNET_ARM_stop_services (p2.cfg, sched, "core", NULL);
-
       ok = 0;
     }
 }
@@ -160,7 +153,7 @@ setup_peer (struct PeerContext *p, const char *cfgname)
 {
   p->cfg = GNUNET_CONFIGURATION_create ();
 #if START_ARM
-  p->arm_pid = GNUNET_OS_start_process ("gnunet-service-arm",
+  p->arm_pid = GNUNET_OS_start_process (NULL, NULL, "gnunet-service-arm",
                                         "gnunet-service-arm",
 #if VERBOSE
                                         "-L", "DEBUG",
@@ -168,7 +161,6 @@ setup_peer (struct PeerContext *p, const char *cfgname)
                                         "-c", cfgname, NULL);
 #endif
   GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname));
-  GNUNET_ARM_start_services (p->cfg, sched, "core", NULL);
 }
 
 
@@ -189,9 +181,9 @@ run (void *cls,
                        TIMEOUT,
                        &p1,
                        &init_notify,
-                       &connect_notify,
+                      &connect_notify,
                        &disconnect_notify,
-                       &bfc_callback,
+                      NULL,
                        &inbound_notify,
                        GNUNET_YES, &outbound_notify, GNUNET_YES, handlers);
 }
@@ -215,7 +207,7 @@ stop_arm (struct PeerContext *p)
 static int
 check ()
 {
-  char *const argv[] = { "test-core-api",
+  char *const argv[] = { "test-core-api-start-only",
     "-c",
     "test_core_api_data.conf",
 #if VERBOSE
@@ -229,7 +221,7 @@ check ()
 
   ok = 1;
   GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1,
-                      argv, "test-core-api", "nohelp", options, &run, &ok);
+                      argv, "test-core-api-start-only", "nohelp", options, &run, &ok);
   stop_arm (&p1);
   stop_arm (&p2);
   return ok;
@@ -240,7 +232,7 @@ main (int argc, char *argv[])
 {
   int ret;
 
-  GNUNET_log_setup ("test-core-api",
+  GNUNET_log_setup ("test-core-api-start-only",
 #if VERBOSE
                     "DEBUG",
 #else