aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMartin Schanzenbach <schanzen@gnunet.org>2022-12-14 14:50:30 +0900
committerMartin Schanzenbach <schanzen@gnunet.org>2022-12-14 14:50:30 +0900
commit4b6bd62e33a875531e5f21428d38af21e223ee0d (patch)
tree67b61b5961d9d0bdea014ca74b0a5709166e3d98 /src
parente7b082de7fcdb394deecde4a098aa927bcd72fdb (diff)
downloadgnunet-4b6bd62e33a875531e5f21428d38af21e223ee0d.tar.gz
gnunet-4b6bd62e33a875531e5f21428d38af21e223ee0d.zip
-TestState can become private
Diffstat (limited to 'src')
-rw-r--r--src/include/gnunet_testing_netjail_lib.h33
-rw-r--r--src/transport/test_transport_plugin_cmd_nat_upnp.c4
-rw-r--r--src/transport/test_transport_plugin_cmd_simple_send.c4
-rw-r--r--src/transport/test_transport_plugin_cmd_simple_send_broadcast.c4
-rw-r--r--src/transport/test_transport_plugin_cmd_simple_send_dv.c4
-rw-r--r--src/transport/test_transport_plugin_cmd_udp_backchannel.c4
-rw-r--r--src/transport/transport-testing-cmds.h33
7 files changed, 42 insertions, 44 deletions
diff --git a/src/include/gnunet_testing_netjail_lib.h b/src/include/gnunet_testing_netjail_lib.h
index ada8b4754..a2f2e056a 100644
--- a/src/include/gnunet_testing_netjail_lib.h
+++ b/src/include/gnunet_testing_netjail_lib.h
@@ -344,39 +344,6 @@ GNUNET_TESTING_calculate_num (struct
344 GNUNET_TESTING_NodeConnection *node_connection, 344 GNUNET_TESTING_NodeConnection *node_connection,
345 struct GNUNET_TESTING_NetjailTopology *topology); 345 struct GNUNET_TESTING_NetjailTopology *topology);
346 346
347// FIXME this was not namespaced. Is this correct here? Why are the cmd_helpers
348// defined in _plugin??
349struct GNUNET_TESTING_TestState
350{
351 /**
352 * Callback to write messages to the master loop.
353 *
354 */
355 GNUNET_TESTING_cmd_helper_write_cb write_message;
356
357 /**
358 * Callback to notify the helper test case has finished.
359 */
360 GNUNET_TESTING_cmd_helper_finish_cb finished_cb;
361
362 /**
363 * The name for a specific test environment directory.
364 *
365 */
366 char *testdir;
367
368 /**
369 * The name for the configuration file of the specific node.
370 *
371 */
372 char *cfgname;
373
374 /**
375 * The complete topology information.
376 */
377 struct GNUNET_TESTING_NetjailTopology *topology;
378};
379
380/** 347/**
381 * FIXME: This was also not namespaces. 348 * FIXME: This was also not namespaces.
382 * Struct with information for callbacks. 349 * Struct with information for callbacks.
diff --git a/src/transport/test_transport_plugin_cmd_nat_upnp.c b/src/transport/test_transport_plugin_cmd_nat_upnp.c
index b02673d04..91255a9fe 100644
--- a/src/transport/test_transport_plugin_cmd_nat_upnp.c
+++ b/src/transport/test_transport_plugin_cmd_nat_upnp.c
@@ -140,7 +140,7 @@ static void
140handle_result (void *cls, 140handle_result (void *cls,
141 enum GNUNET_GenericReturnValue rv) 141 enum GNUNET_GenericReturnValue rv)
142{ 142{
143 struct GNUNET_TESTING_TestState *ts = cls; 143 struct TestState *ts = cls;
144 144
145 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 145 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
146 "Local test exits with status %d\n", 146 "Local test exits with status %d\n",
@@ -222,7 +222,7 @@ start_testcase (GNUNET_TESTING_cmd_helper_write_cb write_message,
222 unsigned int m_int; 222 unsigned int m_int;
223 unsigned int local_m_int; 223 unsigned int local_m_int;
224 unsigned int num; 224 unsigned int num;
225 struct GNUNET_TESTING_TestState *ts = GNUNET_new (struct GNUNET_TESTING_TestState); 225 struct TestState *ts = GNUNET_new (struct TestState);
226 struct GNUNET_TESTING_NetjailTopology *topology; 226 struct GNUNET_TESTING_NetjailTopology *topology;
227 unsigned int sscanf_ret = 0; 227 unsigned int sscanf_ret = 0;
228 228
diff --git a/src/transport/test_transport_plugin_cmd_simple_send.c b/src/transport/test_transport_plugin_cmd_simple_send.c
index 83f9d62b8..632c522c9 100644
--- a/src/transport/test_transport_plugin_cmd_simple_send.c
+++ b/src/transport/test_transport_plugin_cmd_simple_send.c
@@ -124,7 +124,7 @@ static void
124handle_result (void *cls, 124handle_result (void *cls,
125 enum GNUNET_GenericReturnValue rv) 125 enum GNUNET_GenericReturnValue rv)
126{ 126{
127 struct GNUNET_TESTING_TestState *ts = cls; 127 struct TestState *ts = cls;
128 128
129 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 129 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
130 "Local test exits with status %d\n", 130 "Local test exits with status %d\n",
@@ -206,7 +206,7 @@ start_testcase (GNUNET_TESTING_cmd_helper_write_cb write_message,
206 unsigned int m_int; 206 unsigned int m_int;
207 unsigned int local_m_int; 207 unsigned int local_m_int;
208 unsigned int num; 208 unsigned int num;
209 struct GNUNET_TESTING_TestState *ts = GNUNET_new (struct GNUNET_TESTING_TestState); 209 struct TestState *ts = GNUNET_new (struct TestState);
210 struct GNUNET_TESTING_NetjailTopology *topology; 210 struct GNUNET_TESTING_NetjailTopology *topology;
211 unsigned int sscanf_ret = 0; 211 unsigned int sscanf_ret = 0;
212 212
diff --git a/src/transport/test_transport_plugin_cmd_simple_send_broadcast.c b/src/transport/test_transport_plugin_cmd_simple_send_broadcast.c
index 9f028e260..2f84b8213 100644
--- a/src/transport/test_transport_plugin_cmd_simple_send_broadcast.c
+++ b/src/transport/test_transport_plugin_cmd_simple_send_broadcast.c
@@ -126,7 +126,7 @@ static void
126handle_result (void *cls, 126handle_result (void *cls,
127 enum GNUNET_GenericReturnValue rv) 127 enum GNUNET_GenericReturnValue rv)
128{ 128{
129 struct GNUNET_TESTING_TestState *ts = cls; 129 struct TestState *ts = cls;
130 130
131 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 131 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
132 "Local test exits with status %d\n", 132 "Local test exits with status %d\n",
@@ -238,7 +238,7 @@ start_testcase (GNUNET_TESTING_cmd_helper_write_cb write_message,
238 unsigned int m_int; 238 unsigned int m_int;
239 unsigned int local_m_int; 239 unsigned int local_m_int;
240 unsigned int num; 240 unsigned int num;
241 struct GNUNET_TESTING_TestState *ts = GNUNET_new (struct GNUNET_TESTING_TestState); 241 struct TestState *ts = GNUNET_new (struct TestState);
242 struct GNUNET_TESTING_NetjailTopology *topology; 242 struct GNUNET_TESTING_NetjailTopology *topology;
243 unsigned int sscanf_ret = 0; 243 unsigned int sscanf_ret = 0;
244 244
diff --git a/src/transport/test_transport_plugin_cmd_simple_send_dv.c b/src/transport/test_transport_plugin_cmd_simple_send_dv.c
index 3f4ae735c..4da03d155 100644
--- a/src/transport/test_transport_plugin_cmd_simple_send_dv.c
+++ b/src/transport/test_transport_plugin_cmd_simple_send_dv.c
@@ -178,7 +178,7 @@ static void
178handle_result (void *cls, 178handle_result (void *cls,
179 enum GNUNET_GenericReturnValue rv) 179 enum GNUNET_GenericReturnValue rv)
180{ 180{
181 struct GNUNET_TESTING_TestState *ts = cls; 181 struct TestState *ts = cls;
182 182
183 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 183 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
184 "Local test exits with status %d\n", 184 "Local test exits with status %d\n",
@@ -261,7 +261,7 @@ start_testcase (GNUNET_TESTING_cmd_helper_write_cb write_message,
261 unsigned int m_int; 261 unsigned int m_int;
262 unsigned int local_m_int; 262 unsigned int local_m_int;
263 unsigned int num; 263 unsigned int num;
264 struct GNUNET_TESTING_TestState *ts = GNUNET_new (struct GNUNET_TESTING_TestState); 264 struct TestState *ts = GNUNET_new (struct TestState);
265 struct GNUNET_TESTING_NetjailTopology *topology; 265 struct GNUNET_TESTING_NetjailTopology *topology;
266 struct GNUNET_MQ_MessageHandler handlers[] = { 266 struct GNUNET_MQ_MessageHandler handlers[] = {
267 GNUNET_MQ_hd_var_size (test, 267 GNUNET_MQ_hd_var_size (test,
diff --git a/src/transport/test_transport_plugin_cmd_udp_backchannel.c b/src/transport/test_transport_plugin_cmd_udp_backchannel.c
index 524250590..7a26a89d8 100644
--- a/src/transport/test_transport_plugin_cmd_udp_backchannel.c
+++ b/src/transport/test_transport_plugin_cmd_udp_backchannel.c
@@ -122,7 +122,7 @@ static void
122handle_result (void *cls, 122handle_result (void *cls,
123 enum GNUNET_GenericReturnValue rv) 123 enum GNUNET_GenericReturnValue rv)
124{ 124{
125 struct GNUNET_TESTING_TestState *ts = cls; 125 struct TestState *ts = cls;
126 126
127 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 127 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
128 "Local test exits with status %d\n", 128 "Local test exits with status %d\n",
@@ -199,7 +199,7 @@ start_testcase (GNUNET_TESTING_cmd_helper_write_cb write_message,
199 unsigned int m_int; 199 unsigned int m_int;
200 unsigned int local_m_int; 200 unsigned int local_m_int;
201 unsigned int num; 201 unsigned int num;
202 struct GNUNET_TESTING_TestState *ts = GNUNET_new (struct GNUNET_TESTING_TestState); 202 struct TestState *ts = GNUNET_new (struct TestState);
203 struct GNUNET_TESTING_NetjailTopology *topology; 203 struct GNUNET_TESTING_NetjailTopology *topology;
204 unsigned int sscanf_ret = 0; 204 unsigned int sscanf_ret = 0;
205 205
diff --git a/src/transport/transport-testing-cmds.h b/src/transport/transport-testing-cmds.h
index 26933a575..1088f2e5b 100644
--- a/src/transport/transport-testing-cmds.h
+++ b/src/transport/transport-testing-cmds.h
@@ -27,7 +27,7 @@
27#ifndef TRANSPORT_TESTING_CMDS_H 27#ifndef TRANSPORT_TESTING_CMDS_H
28#define TRANSPORT_TESTING_CMDS_H 28#define TRANSPORT_TESTING_CMDS_H
29#include "gnunet_testing_ng_lib.h" 29#include "gnunet_testing_ng_lib.h"
30 30#include "gnunet_testing_plugin.h"
31 31
32typedef void * 32typedef void *
33(*GNUNET_TRANSPORT_notify_connect_cb) (struct GNUNET_TESTING_Interpreter *is, 33(*GNUNET_TRANSPORT_notify_connect_cb) (struct GNUNET_TESTING_Interpreter *is,
@@ -193,6 +193,37 @@ struct StartPeerState
193 enum GNUNET_GenericReturnValue broadcast; 193 enum GNUNET_GenericReturnValue broadcast;
194}; 194};
195 195
196struct TestState
197{
198 /**
199 * Callback to write messages to the master loop.
200 *
201 */
202 GNUNET_TESTING_cmd_helper_write_cb write_message;
203
204 /**
205 * Callback to notify the helper test case has finished.
206 */
207 GNUNET_TESTING_cmd_helper_finish_cb finished_cb;
208
209 /**
210 * The name for a specific test environment directory.
211 *
212 */
213 char *testdir;
214
215 /**
216 * The name for the configuration file of the specific node.
217 *
218 */
219 char *cfgname;
220
221 /**
222 * The complete topology information.
223 */
224 struct GNUNET_TESTING_NetjailTopology *topology;
225};
226
196 227
197/** 228/**
198 * Create command. 229 * Create command.