commit 4b6bd62e33a875531e5f21428d38af21e223ee0d
parent e7b082de7fcdb394deecde4a098aa927bcd72fdb
Author: Martin Schanzenbach <schanzen@gnunet.org>
Date: Wed, 14 Dec 2022 14:50:30 +0900
-TestState can become private
Diffstat:
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
@@ -344,39 +344,6 @@ GNUNET_TESTING_calculate_num (struct
GNUNET_TESTING_NodeConnection *node_connection,
struct GNUNET_TESTING_NetjailTopology *topology);
-// FIXME this was not namespaced. Is this correct here? Why are the cmd_helpers
-// defined in _plugin??
-struct GNUNET_TESTING_TestState
-{
- /**
- * Callback to write messages to the master loop.
- *
- */
- GNUNET_TESTING_cmd_helper_write_cb write_message;
-
- /**
- * Callback to notify the helper test case has finished.
- */
- GNUNET_TESTING_cmd_helper_finish_cb finished_cb;
-
- /**
- * The name for a specific test environment directory.
- *
- */
- char *testdir;
-
- /**
- * The name for the configuration file of the specific node.
- *
- */
- char *cfgname;
-
- /**
- * The complete topology information.
- */
- struct GNUNET_TESTING_NetjailTopology *topology;
-};
-
/**
* FIXME: This was also not namespaces.
* 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
@@ -140,7 +140,7 @@ static void
handle_result (void *cls,
enum GNUNET_GenericReturnValue rv)
{
- struct GNUNET_TESTING_TestState *ts = cls;
+ struct TestState *ts = cls;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Local test exits with status %d\n",
@@ -222,7 +222,7 @@ start_testcase (GNUNET_TESTING_cmd_helper_write_cb write_message,
unsigned int m_int;
unsigned int local_m_int;
unsigned int num;
- struct GNUNET_TESTING_TestState *ts = GNUNET_new (struct GNUNET_TESTING_TestState);
+ struct TestState *ts = GNUNET_new (struct TestState);
struct GNUNET_TESTING_NetjailTopology *topology;
unsigned int sscanf_ret = 0;
diff --git 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
handle_result (void *cls,
enum GNUNET_GenericReturnValue rv)
{
- struct GNUNET_TESTING_TestState *ts = cls;
+ struct TestState *ts = cls;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Local test exits with status %d\n",
@@ -206,7 +206,7 @@ start_testcase (GNUNET_TESTING_cmd_helper_write_cb write_message,
unsigned int m_int;
unsigned int local_m_int;
unsigned int num;
- struct GNUNET_TESTING_TestState *ts = GNUNET_new (struct GNUNET_TESTING_TestState);
+ struct TestState *ts = GNUNET_new (struct TestState);
struct GNUNET_TESTING_NetjailTopology *topology;
unsigned int sscanf_ret = 0;
diff --git 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
handle_result (void *cls,
enum GNUNET_GenericReturnValue rv)
{
- struct GNUNET_TESTING_TestState *ts = cls;
+ struct TestState *ts = cls;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Local test exits with status %d\n",
@@ -238,7 +238,7 @@ start_testcase (GNUNET_TESTING_cmd_helper_write_cb write_message,
unsigned int m_int;
unsigned int local_m_int;
unsigned int num;
- struct GNUNET_TESTING_TestState *ts = GNUNET_new (struct GNUNET_TESTING_TestState);
+ struct TestState *ts = GNUNET_new (struct TestState);
struct GNUNET_TESTING_NetjailTopology *topology;
unsigned int sscanf_ret = 0;
diff --git 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
handle_result (void *cls,
enum GNUNET_GenericReturnValue rv)
{
- struct GNUNET_TESTING_TestState *ts = cls;
+ struct TestState *ts = cls;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Local test exits with status %d\n",
@@ -261,7 +261,7 @@ start_testcase (GNUNET_TESTING_cmd_helper_write_cb write_message,
unsigned int m_int;
unsigned int local_m_int;
unsigned int num;
- struct GNUNET_TESTING_TestState *ts = GNUNET_new (struct GNUNET_TESTING_TestState);
+ struct TestState *ts = GNUNET_new (struct TestState);
struct GNUNET_TESTING_NetjailTopology *topology;
struct GNUNET_MQ_MessageHandler handlers[] = {
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
@@ -122,7 +122,7 @@ static void
handle_result (void *cls,
enum GNUNET_GenericReturnValue rv)
{
- struct GNUNET_TESTING_TestState *ts = cls;
+ struct TestState *ts = cls;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Local test exits with status %d\n",
@@ -199,7 +199,7 @@ start_testcase (GNUNET_TESTING_cmd_helper_write_cb write_message,
unsigned int m_int;
unsigned int local_m_int;
unsigned int num;
- struct GNUNET_TESTING_TestState *ts = GNUNET_new (struct GNUNET_TESTING_TestState);
+ struct TestState *ts = GNUNET_new (struct TestState);
struct GNUNET_TESTING_NetjailTopology *topology;
unsigned int sscanf_ret = 0;
diff --git a/src/transport/transport-testing-cmds.h b/src/transport/transport-testing-cmds.h
@@ -27,7 +27,7 @@
#ifndef TRANSPORT_TESTING_CMDS_H
#define TRANSPORT_TESTING_CMDS_H
#include "gnunet_testing_ng_lib.h"
-
+#include "gnunet_testing_plugin.h"
typedef void *
(*GNUNET_TRANSPORT_notify_connect_cb) (struct GNUNET_TESTING_Interpreter *is,
@@ -193,6 +193,37 @@ struct StartPeerState
enum GNUNET_GenericReturnValue broadcast;
};
+struct TestState
+{
+ /**
+ * Callback to write messages to the master loop.
+ *
+ */
+ GNUNET_TESTING_cmd_helper_write_cb write_message;
+
+ /**
+ * Callback to notify the helper test case has finished.
+ */
+ GNUNET_TESTING_cmd_helper_finish_cb finished_cb;
+
+ /**
+ * The name for a specific test environment directory.
+ *
+ */
+ char *testdir;
+
+ /**
+ * The name for the configuration file of the specific node.
+ *
+ */
+ char *cfgname;
+
+ /**
+ * The complete topology information.
+ */
+ struct GNUNET_TESTING_NetjailTopology *topology;
+};
+
/**
* Create command.