A simple test-case setup for the messenger service.
- Author
- Tobias Frisch
Definition in file testing_messenger_setup.h.
int GNUNET_run_messenger_setup |
( |
const char * |
test_name, |
|
|
const struct test_configuration * |
cfg |
|
) |
| |
Definition at line 521 of file testing_messenger_setup.c.
525 memset(&properties, 0,
sizeof(properties));
527 properties.cfg =
cfg;
530 for (
unsigned int i = 0; i <
cfg->count; i++)
531 if (0 != (
cfg->stages[i] & 0x11))
532 properties.num_hosts++;
534 properties.status = 1;
546 return properties.status;
static const struct GNUNET_CONFIGURATION_Handle * cfg
Configuration we are using.
#define GNUNET_new_array(n, type)
Allocate a size n array with structs or unions of the given type.
#define GNUNET_free(ptr)
Wrapper around free.
int GNUNET_TESTBED_test_run(const char *testname, const char *cfg_filename, unsigned int num_peers, uint64_t event_mask, GNUNET_TESTBED_ControllerCallback cc, void *cc_cls, GNUNET_TESTBED_TestMaster test_master, void *test_master_cls)
Convenience method for running a "simple" test on the local system with a single call from 'main'.
@ GNUNET_TESTBED_ET_PEER_START
A peer has been started.
struct GNUNET_BarrierHandle * GNUNET_init_barrier(unsigned int requirement, GNUNET_BarrierStatusCallback cb, void *cb_cls)
Initialise a pseudo-barrier and call the given callback when the required amount of peers (requiremen...
static void barrier_cb(void *cls, struct GNUNET_BarrierHandle *barrier, int status)
static void run(void *cls, const struct GNUNET_TESTBED_EventInformation *event)
Main function for a peer of the testcase.
static void init(void *cls, struct GNUNET_TESTBED_RunHandle *h, unsigned int num_peers, struct GNUNET_TESTBED_Peer **peers, unsigned int links_succeeded, unsigned int links_failed)
References test_properties::barrier, barrier_cb(), cfg, test_properties::cfg, GNUNET_free, GNUNET_init_barrier(), GNUNET_new_array, GNUNET_OK, GNUNET_TESTBED_ET_PEER_START, GNUNET_TESTBED_test_run(), init(), test_properties::num_hosts, test_properties::peers, run(), and test_properties::status.