-ensure external symbols have proper prefix for conversation service
[oweals/gnunet.git] / src / arm / test_arm_api.c
index 271746e6b503289a8a7540e4a5f5731f595c4c91..a36d5939bafd4e381ec18414ae95b09eaf4ff9b7 100644 (file)
  * @brief testcase for arm_api.c
  */
 #include "platform.h"
-#include "gnunet_common.h"
+#include "gnunet_util_lib.h"
 #include "gnunet_arm_service.h"
-#include "gnunet_client_lib.h"
-#include "gnunet_configuration_lib.h"
-#include "gnunet_getopt_lib.h"
-#include "gnunet_program_lib.h"
 #include "gnunet_resolver_service.h"
 
 #define LOG(...) GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, __VA_ARGS__)
@@ -47,19 +43,25 @@ static int ok = 1;
 static int phase = 0;
 
 static void
-arm_stop_cb (void *cls, struct GNUNET_ARM_Handle *h, enum GNUNET_ARM_RequestStatus status, const char *servicename, enum GNUNET_ARM_Result result)
+arm_stop_cb (void *cls, 
+            enum GNUNET_ARM_RequestStatus status, 
+            const char *servicename, 
+            enum GNUNET_ARM_Result result)
 {
   /* (6), a stop request should be sent to ARM successfully */
   /* ARM should report that it is stopping */
   GNUNET_break (status == GNUNET_ARM_REQUEST_SENT_OK);
-  GNUNET_break (result == GNUNET_ARM_RESULT_STOPPING);
+  GNUNET_break (result == GNUNET_ARM_RESULT_STOPPED);
   GNUNET_break (phase == 6);
   phase++;
   LOG ("Sent 'STOP' request for arm to ARM %s\n", (status == GNUNET_ARM_REQUEST_SENT_OK) ? "successfully" : "unsuccessfully");
 }
 
+
 static void
-resolver_stop_cb (void *cls, struct GNUNET_ARM_Handle *h, enum GNUNET_ARM_RequestStatus status, const char *servicename, enum GNUNET_ARM_Result result)
+resolver_stop_cb (void *cls, 
+                 enum GNUNET_ARM_RequestStatus status, 
+                 const char *servicename, enum GNUNET_ARM_Result result)
 {
   /* (5), a stop request should be sent to ARM successfully.
    * ARM should report that resolver is stopped.
@@ -77,6 +79,7 @@ resolver_stop_cb (void *cls, struct GNUNET_ARM_Handle *h, enum GNUNET_ARM_Reques
 #endif
 }
 
+
 static void
 dns_notify (void *cls, const struct sockaddr *addr, socklen_t addrlen)
 {
@@ -99,8 +102,12 @@ dns_notify (void *cls, const struct sockaddr *addr, socklen_t addrlen)
   ok = 0;
 }
 
+
 static void
-resolver_start_cb (void *cls, struct GNUNET_ARM_Handle *h, enum GNUNET_ARM_RequestStatus status, const char *servicename, enum GNUNET_ARM_Result result)
+resolver_start_cb (void *cls, 
+                  enum GNUNET_ARM_RequestStatus status, 
+                  const char *servicename, 
+                  enum GNUNET_ARM_Result result)
 {
   /* (2), the start request for resolver should be sent successfully
    * ARM should report that resolver service is starting.
@@ -113,6 +120,7 @@ resolver_start_cb (void *cls, struct GNUNET_ARM_Handle *h, enum GNUNET_ARM_Reque
   GNUNET_RESOLVER_ip_get ("localhost", AF_INET, TIMEOUT, &dns_notify, NULL);
 }
 
+
 static void
 trigger_disconnect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
 {
@@ -122,7 +130,6 @@ trigger_disconnect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
 
 static void
 arm_conn (void *cls, 
-         struct GNUNET_ARM_Handle *arm, 
          int connected)
 {
   if (GNUNET_SYSERR == connected)
@@ -155,27 +162,8 @@ arm_conn (void *cls,
 }
 
 
-static void
-srv_status (void *cls, const char *service, enum GNUNET_ARM_ServiceStatus status)
-{
-  LOG ("Service %s is %u\n", service, status);
-  switch (phase)
-  {
-  default:
-    LOG ("Unexpectedly got status %u for service %s\n", status,
-        service);
-    GNUNET_break (0);
-    ok = 2;
-#if START_ARM
-    GNUNET_ARM_request_service_stop (arm, "arm", TIMEOUT, NULL, NULL);
-#endif
-  }
-}
-
-
 static void
 arm_start_cb (void *cls, 
-             struct GNUNET_ARM_Handle *h, 
              enum GNUNET_ARM_RequestStatus status, 
              const char *servicename, 
              enum GNUNET_ARM_Result result)