aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBart Polot <bart@net.in.tum.de>2013-06-11 13:45:43 +0000
committerBart Polot <bart@net.in.tum.de>2013-06-11 13:45:43 +0000
commitab3e0cc14cfb7a2fc0b2f71cd5bd3c1a10a47646 (patch)
tree08649c50420aa8f25e5ebd14e07abb0627973e30
parent8ee4ad79af4d0db83c5fd60027bb5f8f11e27ef3 (diff)
downloadgnunet-ab3e0cc14cfb7a2fc0b2f71cd5bd3c1a10a47646.tar.gz
gnunet-ab3e0cc14cfb7a2fc0b2f71cd5bd3c1a10a47646.zip
- Adapt new testing lib to mesh2
-rw-r--r--src/mesh/mesh2_test_lib.c32
-rw-r--r--src/mesh/mesh2_test_lib.h4
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 @@
24 */ 24 */
25#include "platform.h" 25#include "platform.h"
26#include "gnunet_util_lib.h" 26#include "gnunet_util_lib.h"
27#include "mesh_test_lib.h" 27#include "mesh2_test_lib.h"
28#include "gnunet_mesh2_service.h" 28#include "gnunet_mesh2_service.h"
29 29
30/** 30/**
@@ -78,9 +78,9 @@ struct GNUNET_MESH_TEST_Context
78 struct GNUNET_MESH_MessageHandler* handlers; 78 struct GNUNET_MESH_MessageHandler* handlers;
79 79
80 /** 80 /**
81 * Application types. 81 * Application ports.
82 */ 82 */
83 const GNUNET_MESH_ApplicationType* stypes; 83 const uint32_t *ports;
84 84
85}; 85};
86 86
@@ -125,7 +125,7 @@ mesh_connect_adapter (void *cls,
125 ctx->new_tunnel, 125 ctx->new_tunnel,
126 ctx->cleaner, 126 ctx->cleaner,
127 ctx->handlers, 127 ctx->handlers,
128 ctx->stypes); 128 ctx->ports);
129 return h; 129 return h;
130} 130}
131 131
@@ -190,11 +190,6 @@ mesh_connect_cb (void *cls,
190} 190}
191 191
192 192
193/**
194 * Clean up the testbed.
195 *
196 * @param ctx handle for the testbed
197 */
198void 193void
199GNUNET_MESH_TEST_cleanup (struct GNUNET_MESH_TEST_Context *ctx) 194GNUNET_MESH_TEST_cleanup (struct GNUNET_MESH_TEST_Context *ctx)
200{ 195{
@@ -255,21 +250,6 @@ mesh_test_run (void *cls,
255} 250}
256 251
257 252
258/**
259 * Run a test using the given name, configuration file and number of
260 * peers.
261 * All mesh callbacks will receive the peer number as the closure.
262 *
263 * @param testname Name of the test (for logging).
264 * @param cfgname Name of the configuration file.
265 * @param num_peers Number of peers to start.
266 * @param tmain Main function to run once the testbed is ready.
267 * @param tmain_cls Closure for 'tmain'.
268 * @param new_tunnel Handler for incoming tunnels.
269 * @param cleaner Cleaner for destroyed incoming tunnels.
270 * @param handlers Message handlers.
271 * @param stypes Application types.
272 */
273void 253void
274GNUNET_MESH_TEST_run (const char *testname, 254GNUNET_MESH_TEST_run (const char *testname,
275 const char *cfgname, 255 const char *cfgname,
@@ -279,7 +259,7 @@ GNUNET_MESH_TEST_run (const char *testname,
279 GNUNET_MESH_InboundTunnelNotificationHandler new_tunnel, 259 GNUNET_MESH_InboundTunnelNotificationHandler new_tunnel,
280 GNUNET_MESH_TunnelEndHandler cleaner, 260 GNUNET_MESH_TunnelEndHandler cleaner,
281 struct GNUNET_MESH_MessageHandler* handlers, 261 struct GNUNET_MESH_MessageHandler* handlers,
282 const GNUNET_MESH_ApplicationType* stypes) 262 const uint32_t *ports)
283{ 263{
284 struct GNUNET_MESH_TEST_Context *ctx; 264 struct GNUNET_MESH_TEST_Context *ctx;
285 265
@@ -292,7 +272,7 @@ GNUNET_MESH_TEST_run (const char *testname,
292 ctx->new_tunnel = new_tunnel; 272 ctx->new_tunnel = new_tunnel;
293 ctx->cleaner = cleaner; 273 ctx->cleaner = cleaner;
294 ctx->handlers = handlers; 274 ctx->handlers = handlers;
295 ctx->stypes = stypes; 275 ctx->ports = ports;
296 GNUNET_TESTBED_test_run (testname, 276 GNUNET_TESTBED_test_run (testname,
297 cfgname, 277 cfgname,
298 num_peers, 278 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,
71 * @param new_tunnel Handler for incoming tunnels. 71 * @param new_tunnel Handler for incoming tunnels.
72 * @param cleaner Cleaner for destroyed incoming tunnels. 72 * @param cleaner Cleaner for destroyed incoming tunnels.
73 * @param handlers Message handlers. 73 * @param handlers Message handlers.
74 * @param stypes Application types. 74 * @param ports Ports the peers offer.
75 */ 75 */
76void 76void
77GNUNET_MESH_TEST_run (const char *testname, 77GNUNET_MESH_TEST_run (const char *testname,
@@ -82,7 +82,7 @@ GNUNET_MESH_TEST_run (const char *testname,
82 GNUNET_MESH_InboundTunnelNotificationHandler new_tunnel, 82 GNUNET_MESH_InboundTunnelNotificationHandler new_tunnel,
83 GNUNET_MESH_TunnelEndHandler cleaner, 83 GNUNET_MESH_TunnelEndHandler cleaner,
84 struct GNUNET_MESH_MessageHandler* handlers, 84 struct GNUNET_MESH_MessageHandler* handlers,
85 const GNUNET_MESH_ApplicationType* stypes); 85 const uint32_t* ports);
86 86
87 87
88/** 88/**