aboutsummaryrefslogtreecommitdiff
path: root/src/testing/testing_api_cmd_system_create.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/testing/testing_api_cmd_system_create.c')
-rw-r--r--src/testing/testing_api_cmd_system_create.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/src/testing/testing_api_cmd_system_create.c b/src/testing/testing_api_cmd_system_create.c
index 2007b4ef3..f3a0b1a4c 100644
--- a/src/testing/testing_api_cmd_system_create.c
+++ b/src/testing/testing_api_cmd_system_create.c
@@ -28,6 +28,10 @@
28#include "gnunet_testing_ng_lib.h" 28#include "gnunet_testing_ng_lib.h"
29#include "gnunet_testing_lib.h" 29#include "gnunet_testing_lib.h"
30 30
31/**
32 * Struct to hold information for callbacks.
33 *
34 */
31struct TestSystemState 35struct TestSystemState
32{ 36{
33 struct GNUNET_TESTING_System *test_system; 37 struct GNUNET_TESTING_System *test_system;
@@ -36,6 +40,10 @@ struct TestSystemState
36}; 40};
37 41
38 42
43/**
44 * The run method of this cmd will setup a test environment for a node.
45 *
46 */
39static void 47static void
40system_create_run (void *cls, 48system_create_run (void *cls,
41 const struct GNUNET_TESTING_Command *cmd, 49 const struct GNUNET_TESTING_Command *cmd,
@@ -54,6 +62,11 @@ system_create_run (void *cls,
54 "system created\n"); 62 "system created\n");
55} 63}
56 64
65
66/**
67 * This function prepares an array with traits.
68 *
69 */
57static int 70static int
58system_create_traits (void *cls, 71system_create_traits (void *cls,
59 const void **ret, 72 const void **ret,
@@ -79,6 +92,12 @@ system_create_traits (void *cls,
79} 92}
80 93
81 94
95/**
96 * Function to get the trait with struct GNUNET_TESTING_System
97 *
98 * @param[out] test_system The struct GNUNET_TESTING_System.
99 * @return #GNUNET_OK if no error occurred, #GNUNET_SYSERR otherwise.
100 */
82int 101int
83GNUNET_TESTING_get_trait_test_system (const struct 102GNUNET_TESTING_get_trait_test_system (const struct
84 GNUNET_TESTING_Command *cmd, 103 GNUNET_TESTING_Command *cmd,
@@ -91,13 +110,16 @@ GNUNET_TESTING_get_trait_test_system (const struct
91} 110}
92 111
93 112
113/**
114 * The cleanup function of this cmd frees resources the cmd allocated.
115 *
116 */
94static void 117static void
95system_create_cleanup (void *cls, 118system_create_cleanup (void *cls,
96 const struct GNUNET_TESTING_Command *cmd) 119 const struct GNUNET_TESTING_Command *cmd)
97{ 120{
98 struct TestSystemState *tss = cls; 121 struct TestSystemState *tss = cls;
99 122
100 GNUNET_free (tss->test_system);
101 GNUNET_free (tss); 123 GNUNET_free (tss);
102} 124}
103 125
@@ -106,6 +128,7 @@ system_create_cleanup (void *cls,
106 * Create command. 128 * Create command.
107 * 129 *
108 * @param label name for command. 130 * @param label name for command.
131 * @param label name for the test environment directory.
109 * @return command. 132 * @return command.
110 */ 133 */
111struct GNUNET_TESTING_Command 134struct GNUNET_TESTING_Command