diff options
author | Bart Polot <bart@net.in.tum.de> | 2011-05-06 17:05:44 +0000 |
---|---|---|
committer | Bart Polot <bart@net.in.tum.de> | 2011-05-06 17:05:44 +0000 |
commit | 6ed107622e537d73eb5462feedc7700dfeba5b5b (patch) | |
tree | 49a047f289d7aa3072c7bac649e22020e1bfb6e2 /src/mesh/test_mesh_api.c | |
parent | 3812cf28795be58bce2eabccfd8b6e004e6be291 (diff) | |
download | gnunet-6ed107622e537d73eb5462feedc7700dfeba5b5b.tar.gz gnunet-6ed107622e537d73eb5462feedc7700dfeba5b5b.zip |
WiP
Diffstat (limited to 'src/mesh/test_mesh_api.c')
-rw-r--r-- | src/mesh/test_mesh_api.c | 37 |
1 files changed, 36 insertions, 1 deletions
diff --git a/src/mesh/test_mesh_api.c b/src/mesh/test_mesh_api.c index 63a62a1e1..04e3a4388 100644 --- a/src/mesh/test_mesh_api.c +++ b/src/mesh/test_mesh_api.c | |||
@@ -1,3 +1,38 @@ | |||
1 | #include "platform.h" | ||
2 | #include "gnunet_util_lib.h" | ||
3 | #include "gnunet_mesh_service_new.h" | ||
4 | |||
5 | static struct GNUNET_MESH_MessageHandler handlers[] = { | ||
6 | {NULL, 0, 0} | ||
7 | }; | ||
8 | |||
1 | int main (int argc, char *argv[]) { | 9 | int main (int argc, char *argv[]) { |
2 | return 0; | 10 | struct GNUNET_OS_Process *arm_pid; |
11 | struct GNUNET_MESH_Handle *mesh; | ||
12 | // struct GNUNET_MESH_Tunnel *t; | ||
13 | struct GNUNET_CONFIGURATION_Handle *cfg; | ||
14 | |||
15 | cfg = GNUNET_CONFIGURATION_create(); | ||
16 | |||
17 | arm_pid = GNUNET_OS_start_process (NULL, NULL, | ||
18 | "gnunet-service-arm", | ||
19 | "gnunet-service-arm", | ||
20 | "-L", "DEBUG", | ||
21 | NULL); | ||
22 | mesh = GNUNET_MESH_connect(cfg, NULL, NULL, handlers, NULL); | ||
23 | if(NULL == mesh) { | ||
24 | fprintf(stderr, "Couldn't connect to mesh :(\n"); | ||
25 | // return 1; // succeed anyway | ||
26 | } | ||
27 | mesh = realloc(mesh, 0); // don't complain about *mesh | ||
28 | // printf("MESH TEST\n"); | ||
29 | // t = GNUNET_MESH_tunnel_create(mesh, ); | ||
30 | |||
31 | /* do real test work here */ | ||
32 | if (0 != GNUNET_OS_process_kill (arm_pid, SIGTERM)) | ||
33 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); | ||
34 | GNUNET_assert (GNUNET_OK == GNUNET_OS_process_wait (arm_pid)); | ||
35 | GNUNET_OS_process_close (arm_pid); | ||
36 | |||
37 | return 0; | ||
3 | } | 38 | } |