/*
* This file is part of GNUnet
* Copyright (C) 2013 GNUnet e.V.
*
* 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 3, or (at your
* option) any later version.
*
* GNUnet is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* 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., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
/**
* @file social/test_social.c
* @brief Tests for the Social API.
* @author Gabor X Toth
*/
#include <inttypes.h>
#include "platform.h"
#include "gnunet_crypto_lib.h"
#include "gnunet_common.h"
#include "gnunet_util_lib.h"
#include "gnunet_testing_lib.h"
#include "gnunet_psyc_util_lib.h"
#include "gnunet_social_service.h"
#include "gnunet_core_service.h"
#include "gnunet_identity_service.h"
#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 30)
#define DATA2ARG(data) data, sizeof (data)
/**
* Return value from 'main'.
*/
int res;
struct GNUNET_SOCIAL_App *app;
const char *app_id = "test";
/**
* Handle for task for timeout termination.
*/
struct GNUNET_SCHEDULER_Task * end_badly_task;
const struct GNUNET_CONFIGURATION_Handle *cfg;
struct GNUNET_CORE_Handle *core;
struct GNUNET_PeerIdentity this_peer;
struct GNUNET_IDENTITY_Handle *id;
const struct GNUNET_SOCIAL_Ego *host_ego;
const struct GNUNET_SOCIAL_Ego *guest_ego;
const char *host_name = "Host One";
const char *guest_name = "Guest One";
struct GNUNET_CRYPTO_EddsaPrivateKey *place_key;
struct GNUNET_CRYPTO_EcdsaPrivateKey *guest_key;
struct GNUNET_CRYPTO_EddsaPublicKey place_pub_key;
struct GNUNET_HashCode place_pub_hash;
struct GNUNET_CRYPTO_EcdsaPublicKey guest_pub_key;
struct GNUNET_CRYPTO_EcdsaPublicKey host_pub_key;
struct GNUNET_PSYC_Slicer *host_slicer;
struct GNUNET_PSYC_Slicer *guest_slicer;
struct GNUNET_SOCIAL_Host *hst;
struct GNUNET_SOCIAL_Guest *gst;
struct GNUNET_SOCIAL_Place *hst_plc;
struct GNUNET_SOCIAL_Place *gst_plc;
struct GNUNET_SOCIAL_Nym *nym_eject;
struct GuestEnterMessage
{
struct GNUNET_PSYC_Message *msg;
const char *method_name;
struct GNUNET_PSYC_Environment *env;
void *data;
uint16_t data_size;
} guest_enter_msg;
struct TransmitClosure
{
struct GNUNET_SOCIAL_Announcement *host_ann;
struct GNUNET_SOCIAL_TalkRequest *guest_talk;
struct GNUNET_PSYC_Environment *env;
char *data[16];
uint8_t data_delay[16];
uint8_t data_count;
uint8