/*
This file is part of GNUnet.
- (C) 2009, 2011 Christian Grothoff (and other contributing authors)
+ Copyright (C) 2009, 2011 Christian Grothoff (and other contributing authors)
GNUnet is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
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 arm/test_arm_api.c
* @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__)
static int phase = 0;
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)
{
/* (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,
- enum GNUNET_ARM_RequestStatus status,
+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.
static void
-resolver_start_cb (void *cls,
- enum GNUNET_ARM_RequestStatus status,
- const char *servicename,
+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
static void
-arm_conn (void *cls,
+arm_conn (void *cls,
int connected)
{
if (GNUNET_SYSERR == connected)
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)
{
/* (0) The request should be "sent" successfully
task (void *cls, char *const *args, const char *cfgfile,
const struct GNUNET_CONFIGURATION_Handle *c)
{
- char *armconfig;
cfg = c;
- if (NULL != cfgfile)
- {
- if (GNUNET_OK !=
- GNUNET_CONFIGURATION_get_value_filename (cfg, "arm", "CONFIG",
- &armconfig))
- {
- GNUNET_CONFIGURATION_set_value_string ((struct GNUNET_CONFIGURATION_Handle
- *) cfg, "arm", "CONFIG",
- cfgfile);
- }
- else
- GNUNET_free (armconfig);
- }
arm = GNUNET_ARM_connect (cfg, &arm_conn, NULL);
if (NULL == arm)
return;