From ab3e0cc14cfb7a2fc0b2f71cd5bd3c1a10a47646 Mon Sep 17 00:00:00 2001 From: Bart Polot Date: Tue, 11 Jun 2013 13:45:43 +0000 Subject: - Adapt new testing lib to mesh2 --- src/mesh/mesh2_test_lib.c | 32 ++++++-------------------------- src/mesh/mesh2_test_lib.h | 4 ++-- 2 files changed, 8 insertions(+), 28 deletions(-) diff --git a/src/mesh/mesh2_test_lib.c b/src/mesh/mesh2_test_lib.c index 828c09460..95de93edd 100644 --- a/src/mesh/mesh2_test_lib.c +++ b/src/mesh/mesh2_test_lib.c @@ -24,7 +24,7 @@ */ #include "platform.h" #include "gnunet_util_lib.h" -#include "mesh_test_lib.h" +#include "mesh2_test_lib.h" #include "gnunet_mesh2_service.h" /** @@ -78,9 +78,9 @@ struct GNUNET_MESH_TEST_Context struct GNUNET_MESH_MessageHandler* handlers; /** - * Application types. + * Application ports. */ - const GNUNET_MESH_ApplicationType* stypes; + const uint32_t *ports; }; @@ -125,7 +125,7 @@ mesh_connect_adapter (void *cls, ctx->new_tunnel, ctx->cleaner, ctx->handlers, - ctx->stypes); + ctx->ports); return h; } @@ -190,11 +190,6 @@ mesh_connect_cb (void *cls, } -/** - * Clean up the testbed. - * - * @param ctx handle for the testbed - */ void GNUNET_MESH_TEST_cleanup (struct GNUNET_MESH_TEST_Context *ctx) { @@ -255,21 +250,6 @@ mesh_test_run (void *cls, } -/** - * Run a test using the given name, configuration file and number of - * peers. - * All mesh callbacks will receive the peer number as the closure. - * - * @param testname Name of the test (for logging). - * @param cfgname Name of the configuration file. - * @param num_peers Number of peers to start. - * @param tmain Main function to run once the testbed is ready. - * @param tmain_cls Closure for 'tmain'. - * @param new_tunnel Handler for incoming tunnels. - * @param cleaner Cleaner for destroyed incoming tunnels. - * @param handlers Message handlers. - * @param stypes Application types. - */ void GNUNET_MESH_TEST_run (const char *testname, const char *cfgname, @@ -279,7 +259,7 @@ GNUNET_MESH_TEST_run (const char *testname, GNUNET_MESH_InboundTunnelNotificationHandler new_tunnel, GNUNET_MESH_TunnelEndHandler cleaner, struct GNUNET_MESH_MessageHandler* handlers, - const GNUNET_MESH_ApplicationType* stypes) + const uint32_t *ports) { struct GNUNET_MESH_TEST_Context *ctx; @@ -292,7 +272,7 @@ GNUNET_MESH_TEST_run (const char *testname, ctx->new_tunnel = new_tunnel; ctx->cleaner = cleaner; ctx->handlers = handlers; - ctx->stypes = stypes; + ctx->ports = ports; GNUNET_TESTBED_test_run (testname, cfgname, num_peers, diff --git a/src/mesh/mesh2_test_lib.h b/src/mesh/mesh2_test_lib.h index f1822617b..096c0ebc1 100644 --- a/src/mesh/mesh2_test_lib.h +++ b/src/mesh/mesh2_test_lib.h @@ -71,7 +71,7 @@ typedef void (*GNUNET_MESH_TEST_AppMain) (void *cls, * @param new_tunnel Handler for incoming tunnels. * @param cleaner Cleaner for destroyed incoming tunnels. * @param handlers Message handlers. - * @param stypes Application types. + * @param ports Ports the peers offer. */ void GNUNET_MESH_TEST_run (const char *testname, @@ -82,7 +82,7 @@ GNUNET_MESH_TEST_run (const char *testname, GNUNET_MESH_InboundTunnelNotificationHandler new_tunnel, GNUNET_MESH_TunnelEndHandler cleaner, struct GNUNET_MESH_MessageHandler* handlers, - const GNUNET_MESH_ApplicationType* stypes); + const uint32_t* ports); /** -- cgit v1.2.3