Boston, MA 02111-1307, USA.
*/
/**
- * @file arm/test_gnunet_service_arm.c
+ * @file arm/test_gnunet_service_arm.c
* @brief testcase for gnunet-service-arm.c; tests ARM by making it start the resolver
* @author Safey
* @author Christian Grothoff
static void
-arm_stop_cb (void *cls,
- enum GNUNET_ARM_RequestStatus status,
- const char *servicename,
+arm_stop_cb (void *cls,
+ enum GNUNET_ARM_RequestStatus status,
+ const char *servicename,
enum GNUNET_ARM_Result result)
{
GNUNET_break (status == GNUNET_ARM_REQUEST_SENT_OK);
static void
-service_list (void *cls,
+service_list (void *cls,
enum GNUNET_ARM_RequestStatus rs,
unsigned int count, const char *const*list)
{
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "%u services are are currently running\n",
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "%u services are are currently running\n",
count);
- GNUNET_break (count == 1);
- GNUNET_break (0 == strcasecmp (list[0], "resolver (gnunet-service-resolver)"));
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Got service list, now stopping arm\n");
- ret = 0;
+ if (GNUNET_ARM_REQUEST_SENT_OK != rs)
+ goto stop_arm;
+ if (1 == count)
+ {
+ GNUNET_break (0 == strcasecmp (list[0], "resolver (gnunet-service-resolver)"));
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Got service list, now stopping arm\n");
+ ret = 0;
+ }
+
+ stop_arm:
GNUNET_ARM_request_service_stop (arm, "arm", TIMEOUT, arm_stop_cb, NULL);
}
static void
-arm_start_cb (void *cls,
- enum GNUNET_ARM_RequestStatus status,
- const char *servicename,
+arm_start_cb (void *cls,
+ enum GNUNET_ARM_RequestStatus status,
+ const char *servicename,
enum GNUNET_ARM_Result result)
{
GNUNET_break (status == GNUNET_ARM_REQUEST_SENT_OK);