From 297ee1c85e3b8a1745193c854df2dec1126b7b99 Mon Sep 17 00:00:00 2001 From: t3sserakt Date: Mon, 29 Nov 2021 13:24:29 +0100 Subject: - added number of unintentional connects to connect cmd, fixed bugs in tcp communicator and tng service, added method to get a cmd not restricted to future or past cmds --- src/testing/testing.c | 6 +++++- src/testing/testing_api_loop.c | 22 ++++++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) (limited to 'src/testing') diff --git a/src/testing/testing.c b/src/testing/testing.c index 9e664292b..7474d9b5f 100644 --- a/src/testing/testing.c +++ b/src/testing/testing.c @@ -2312,10 +2312,14 @@ GNUNET_TESTING_get_address (struct GNUNET_TESTING_NodeConnection *connection, { template = KNOWN_CONNECT_ADDRESS_TEMPLATE; } - else + else if (1 == connection->node_n) { template = ROUTER_CONNECT_ADDRESS_TEMPLATE; } + else + { + return NULL; + } if (0 == strcmp (PREFIX_TCP, prefix)) { diff --git a/src/testing/testing_api_loop.c b/src/testing/testing_api_loop.c index e82ec33ab..290311c59 100644 --- a/src/testing/testing_api_loop.c +++ b/src/testing/testing_api_loop.c @@ -191,6 +191,28 @@ GNUNET_TESTING_interpreter_lookup_command ( } +/** + * Lookup command by label. + * All commands, first into the past, then into the furture are looked up. + * + * @param is interpreter to lookup command in + * @param label label of the command to lookup. + * @return the command, if it is found, or NULL. + */ +const struct GNUNET_TESTING_Command * +GNUNET_TESTING_interpreter_lookup_command_all ( + struct GNUNET_TESTING_Interpreter *is, + const char *label) +{ + const struct GNUNET_TESTING_Command *cmd; + + cmd = get_command (is, label, GNUNET_NO); + if (NULL == cmd) + cmd = get_command (is, label, GNUNET_YES); + return cmd; +} + + /** * Finish the test run, return the final result. * -- cgit v1.2.3