aboutsummaryrefslogtreecommitdiff
path: root/src/mesh/test_mesh_api.c
diff options
context:
space:
mode:
authorBart Polot <bart@net.in.tum.de>2011-09-07 14:38:59 +0000
committerBart Polot <bart@net.in.tum.de>2011-09-07 14:38:59 +0000
commit381046a7d5c92f5ec1b9bf4566eecacfde269099 (patch)
tree07d321493db8f960f4aa2f20218f3dfb1a20fdef /src/mesh/test_mesh_api.c
parent6838672013100731f5bc5451f4157878080beb2d (diff)
downloadgnunet-381046a7d5c92f5ec1b9bf4566eecacfde269099.tar.gz
gnunet-381046a7d5c92f5ec1b9bf4566eecacfde269099.zip
Added new test for multiple clients on one peer
Fixed dumb obvious bug in api
Diffstat (limited to 'src/mesh/test_mesh_api.c')
-rw-r--r--src/mesh/test_mesh_api.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/mesh/test_mesh_api.c b/src/mesh/test_mesh_api.c
index 060db9c8a..ada8e10e7 100644
--- a/src/mesh/test_mesh_api.c
+++ b/src/mesh/test_mesh_api.c
@@ -34,9 +34,10 @@
34 34
35static struct GNUNET_OS_Process *arm_pid; 35static struct GNUNET_OS_Process *arm_pid;
36static struct GNUNET_MESH_Handle *mesh; 36static struct GNUNET_MESH_Handle *mesh;
37static struct GNUNET_MESH_Tunnel *t;
37static int result; 38static int result;
38GNUNET_SCHEDULER_TaskIdentifier abort_task; 39static GNUNET_SCHEDULER_TaskIdentifier abort_task;
39GNUNET_SCHEDULER_TaskIdentifier test_task; 40static GNUNET_SCHEDULER_TaskIdentifier test_task;
40 41
41/** 42/**
42 * Function is called whenever a message is received. 43 * Function is called whenever a message is received.
@@ -101,26 +102,26 @@ test (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
101 struct GNUNET_CONFIGURATION_Handle *cfg = cls; 102 struct GNUNET_CONFIGURATION_Handle *cfg = cls;
102 static const GNUNET_MESH_ApplicationType app[] = 103 static const GNUNET_MESH_ApplicationType app[] =
103 { 1, 2, 3, 4, 5, 6, 7, 8, 0 }; 104 { 1, 2, 3, 4, 5, 6, 7, 8, 0 };
104 struct GNUNET_MESH_Tunnel *t;
105 105
106 test_task = (GNUNET_SCHEDULER_TaskIdentifier) 0; 106 test_task = (GNUNET_SCHEDULER_TaskIdentifier) 0;
107 mesh = GNUNET_MESH_connect (cfg, 10, NULL, NULL, NULL, handlers, app); 107 mesh = GNUNET_MESH_connect (cfg, 10, NULL, NULL, NULL, handlers, app);
108 if (NULL == mesh) 108 if (NULL == mesh)
109 { 109 {
110 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Couldn't connect to mesh :(\n"); 110 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "test: Couldn't connect to mesh :(\n");
111 return; 111 return;
112 } 112 }
113 else 113 else
114 { 114 {
115 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "YAY! CONNECTED TO MESH :D\n"); 115 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: YAY! CONNECTED TO MESH :D\n");
116 } 116 }
117 117
118 t = GNUNET_MESH_tunnel_create (mesh, NULL, NULL, NULL, NULL); 118 t = GNUNET_MESH_tunnel_create (mesh, NULL, NULL, NULL, NULL);
119 if (NULL != t)
120 {
121 GNUNET_MESH_tunnel_destroy (t);
122 }
119 123
120 GNUNET_MESH_tunnel_destroy (t); 124 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS, &do_shutdown,
121
122 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply
123 (GNUNET_TIME_UNIT_SECONDS, 1), &do_shutdown,
124 NULL); 125 NULL);
125} 126}
126 127