diff options
author | Bart Polot <bart@net.in.tum.de> | 2011-06-17 00:00:24 +0000 |
---|---|---|
committer | Bart Polot <bart@net.in.tum.de> | 2011-06-17 00:00:24 +0000 |
commit | 75369ac52bede0b6873f7a915a3af8a15c6f83ac (patch) | |
tree | b7fbce5cc3b0ed5142dec5dfb884f1f78a73dd22 /src/mesh/test_mesh_api.c | |
parent | 37c18a5e933bd7e0a4596bbc8459050244501d97 (diff) | |
download | gnunet-75369ac52bede0b6873f7a915a3af8a15c6f83ac.tar.gz gnunet-75369ac52bede0b6873f7a915a3af8a15c6f83ac.zip |
WiP (peer route creation)
Diffstat (limited to 'src/mesh/test_mesh_api.c')
-rw-r--r-- | src/mesh/test_mesh_api.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/mesh/test_mesh_api.c b/src/mesh/test_mesh_api.c index c2a03d3b5..08a3b1c3c 100644 --- a/src/mesh/test_mesh_api.c +++ b/src/mesh/test_mesh_api.c | |||
@@ -29,6 +29,9 @@ | |||
29 | #include "gnunet_dht_service.h" | 29 | #include "gnunet_dht_service.h" |
30 | #include "gnunet_mesh_service_new.h" | 30 | #include "gnunet_mesh_service_new.h" |
31 | 31 | ||
32 | #define VERBOSE 1 | ||
33 | #define VERBOSE_ARM 0 | ||
34 | |||
32 | static struct GNUNET_MESH_MessageHandler handlers[] = {{NULL, 0, 0}}; | 35 | static struct GNUNET_MESH_MessageHandler handlers[] = {{NULL, 0, 0}}; |
33 | static struct GNUNET_OS_Process *arm_pid; | 36 | static struct GNUNET_OS_Process *arm_pid; |
34 | static struct GNUNET_MESH_Handle *mesh; | 37 | static struct GNUNET_MESH_Handle *mesh; |
@@ -94,7 +97,9 @@ run (void *cls, | |||
94 | arm_pid = GNUNET_OS_start_process (NULL, NULL, | 97 | arm_pid = GNUNET_OS_start_process (NULL, NULL, |
95 | "gnunet-service-arm", | 98 | "gnunet-service-arm", |
96 | "gnunet-service-arm", | 99 | "gnunet-service-arm", |
100 | #if VERBOSE_ARM | ||
97 | "-L", "DEBUG", | 101 | "-L", "DEBUG", |
102 | #endif | ||
98 | "-c", "test_mesh.conf", | 103 | "-c", "test_mesh.conf", |
99 | NULL); | 104 | NULL); |
100 | 105 | ||
@@ -116,25 +121,33 @@ main (int argc, char *argv[]) | |||
116 | int ret; | 121 | int ret; |
117 | char *const argv2[] = {"test-mesh-api", | 122 | char *const argv2[] = {"test-mesh-api", |
118 | "-c", "test_mesh.conf", | 123 | "-c", "test_mesh.conf", |
124 | #if VERBOSE | ||
119 | "-L", "DEBUG", | 125 | "-L", "DEBUG", |
126 | #endif | ||
120 | NULL | 127 | NULL |
121 | }; | 128 | }; |
122 | struct GNUNET_GETOPT_CommandLineOption options[] = { | 129 | struct GNUNET_GETOPT_CommandLineOption options[] = { |
123 | GNUNET_GETOPT_OPTION_END | 130 | GNUNET_GETOPT_OPTION_END |
124 | }; | 131 | }; |
125 | GNUNET_log_setup ("test-dht-api","DEBUG", NULL); | 132 | GNUNET_log_setup ("test-mesh-api", |
133 | #if VERBOSE | ||
134 | "DEBUG", | ||
135 | #else | ||
136 | "WARNING", | ||
137 | #endif | ||
138 | NULL); | ||
126 | ret = GNUNET_PROGRAM_run ((sizeof (argv2) / sizeof (char *)) - 1, | 139 | ret = GNUNET_PROGRAM_run ((sizeof (argv2) / sizeof (char *)) - 1, |
127 | argv2, "test-mesh-api", "nohelp", | 140 | argv2, "test-mesh-api", "nohelp", |
128 | options, &run, NULL); | 141 | options, &run, NULL); |
129 | 142 | ||
130 | if ( GNUNET_OK != ret ) { | 143 | if ( GNUNET_OK != ret ) { |
131 | GNUNET_log(GNUNET_ERROR_TYPE_WARNING, | 144 | GNUNET_log(GNUNET_ERROR_TYPE_WARNING, |
132 | "test-mesh-api': run failed with error code %d\n", ret); | 145 | "run failed with error code %d\n", ret); |
133 | return 1; | 146 | return 1; |
134 | } | 147 | } |
135 | if ( GNUNET_SYSERR == result ) { | 148 | if ( GNUNET_SYSERR == result ) { |
136 | GNUNET_log(GNUNET_ERROR_TYPE_WARNING, | 149 | GNUNET_log(GNUNET_ERROR_TYPE_WARNING, |
137 | "test-mesh-api': test failed\n"); | 150 | "test failed\n"); |
138 | return 1; | 151 | return 1; |
139 | } | 152 | } |
140 | return 0; | 153 | return 0; |