GNUnet 0.21.1
testing_api_cmd_system_destroy.c File Reference

cmd to destroy a testing system handle. More...

Include dependency graph for testing_api_cmd_system_destroy.c:

Go to the source code of this file.

Data Structures

struct  TestSystemState
 Struct to hold information for callbacks. More...
 

Functions

static void system_destroy_run (void *cls, struct GNUNET_TESTING_Interpreter *is)
 The run method of this cmd will remove the test environment for a node. More...
 
static void system_destroy_cleanup (void *cls)
 The cleanup function of this cmd frees resources the cmd allocated. More...
 
static enum GNUNET_GenericReturnValue system_destroy_traits (void *cls, const void **ret, const char *trait, unsigned int index)
 Trait function of this cmd does nothing. More...
 
struct GNUNET_TESTING_Command GNUNET_TESTING_cmd_system_destroy (const char *label, const char *create_label)
 Create command. More...
 

Detailed Description

cmd to destroy a testing system handle.

Author
t3sserakt

Definition in file testing_api_cmd_system_destroy.c.

Function Documentation

◆ system_destroy_run()

static void system_destroy_run ( void *  cls,
struct GNUNET_TESTING_Interpreter is 
)
static

The run method of this cmd will remove the test environment for a node.

Definition at line 50 of file testing_api_cmd_system_destroy.c.

52{
53 struct TestSystemState *tss = cls;
54 const struct GNUNET_TESTING_Command *system_cmd;
55 const struct GNUNET_TESTING_System *tl_system;
56
58 tss->create_label);
60 &tl_system);
63}
struct GNUNET_TESTING_Interpreter * is
const struct GNUNET_TESTING_Command * GNUNET_TESTING_interpreter_lookup_command(struct GNUNET_TESTING_Interpreter *is, const char *label)
Lookup command by label.
enum GNUNET_GenericReturnValue GNUNET_TESTING_get_trait_test_system(const struct GNUNET_TESTING_Command *cmd, const struct GNUNET_TESTING_System **ret)
@ GNUNET_YES
void GNUNET_TESTING_system_destroy(struct GNUNET_TESTING_System *system, int remove_paths)
Free system resources.
Definition: testing.c:557
A command to be run by the interpreter.
Handle for a system on which GNUnet peers are executed; a system is used for reserving unique paths a...
Definition: testing.c:122
Struct to hold information for callbacks.

References TestSystemState::create_label, GNUNET_TESTING_get_trait_test_system(), GNUNET_TESTING_interpreter_lookup_command(), GNUNET_TESTING_system_destroy(), GNUNET_YES, and is.

Referenced by GNUNET_TESTING_cmd_system_destroy().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ system_destroy_cleanup()

static void system_destroy_cleanup ( void *  cls)
static

The cleanup function of this cmd frees resources the cmd allocated.

Definition at line 71 of file testing_api_cmd_system_destroy.c.

72{
73 struct TestSystemState *tss = cls;
74
75 GNUNET_free (tss);
76}
#define GNUNET_free(ptr)
Wrapper around free.

References GNUNET_free.

Referenced by GNUNET_TESTING_cmd_system_destroy().

Here is the caller graph for this function:

◆ system_destroy_traits()

static enum GNUNET_GenericReturnValue system_destroy_traits ( void *  cls,
const void **  ret,
const char *  trait,
unsigned int  index 
)
static

Trait function of this cmd does nothing.

Definition at line 84 of file testing_api_cmd_system_destroy.c.

88{
89 return GNUNET_OK;
90}
@ GNUNET_OK

References GNUNET_OK.

Referenced by GNUNET_TESTING_cmd_system_destroy().

Here is the caller graph for this function:

◆ GNUNET_TESTING_cmd_system_destroy()

struct GNUNET_TESTING_Command GNUNET_TESTING_cmd_system_destroy ( const char *  label,
const char *  create_label 
)

Create command.

This command destroys the ressources allocated for the test system setup.

Parameters
labelname for command.
create_labelLabel of the cmd which started the test system.
Returns
command.

Definition at line 101 of file testing_api_cmd_system_destroy.c.

103{
104 struct TestSystemState *tss;
105
106 tss = GNUNET_new (struct TestSystemState);
110 &system_destroy_traits, NULL);
111}
struct GNUNET_TESTING_Command GNUNET_TESTING_command_new(void *cls, const char *label, GNUNET_TESTING_CommandRunRoutine run, GNUNET_TESTING_CommandCleanupRoutine cleanup, GNUNET_TESTING_CommandGetTraits traits, struct GNUNET_TESTING_AsyncContext *ac)
Create a new command.
#define GNUNET_new(type)
Allocate a struct or union of the given type.
static void system_destroy_cleanup(void *cls)
The cleanup function of this cmd frees resources the cmd allocated.
static void system_destroy_run(void *cls, struct GNUNET_TESTING_Interpreter *is)
The run method of this cmd will remove the test environment for a node.
static enum GNUNET_GenericReturnValue system_destroy_traits(void *cls, const void **ret, const char *trait, unsigned int index)
Trait function of this cmd does nothing.

References TestSystemState::create_label, GNUNET_new, GNUNET_TESTING_command_new(), system_destroy_cleanup(), system_destroy_run(), and system_destroy_traits().

Here is the call graph for this function: