aboutsummaryrefslogtreecommitdiff
path: root/src/util/test_service.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-06-13 15:18:35 +0000
committerChristian Grothoff <christian@grothoff.org>2012-06-13 15:18:35 +0000
commit2742cca3d2180b4f615c40609fccf10a806f05c8 (patch)
tree7a59d0d43951cec4f0edd903f02ead3dbe037a2f /src/util/test_service.c
parent832d12049add37805697104b9f8eaae420eef406 (diff)
downloadgnunet-2742cca3d2180b4f615c40609fccf10a806f05c8.tar.gz
gnunet-2742cca3d2180b4f615c40609fccf10a806f05c8.zip
-cleaning up VERBOSE and check nonsense in util tests
Diffstat (limited to 'src/util/test_service.c')
-rw-r--r--src/util/test_service.c32
1 files changed, 4 insertions, 28 deletions
diff --git a/src/util/test_service.c b/src/util/test_service.c
index 554724972..be49d1877 100644
--- a/src/util/test_service.c
+++ b/src/util/test_service.c
@@ -31,8 +31,6 @@
31#include "gnunet_time_lib.h" 31#include "gnunet_time_lib.h"
32 32
33 33
34#define VERBOSE GNUNET_NO
35
36#define PORT 12435 34#define PORT 12435
37 35
38#define MY_TYPE 256 36#define MY_TYPE 256
@@ -148,17 +146,11 @@ check ()
148 "test_service", 146 "test_service",
149 "-c", 147 "-c",
150 "test_service_data.conf", 148 "test_service_data.conf",
151 "-L",
152#if VERBOSE
153 "DEBUG",
154#else
155 "WARNING",
156#endif
157 NULL 149 NULL
158 }; 150 };
159 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Starting service\n"); 151 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Starting service\n");
160 GNUNET_assert (GNUNET_OK == 152 GNUNET_assert (GNUNET_OK ==
161 GNUNET_SERVICE_run (5, argv, "test_service", 153 GNUNET_SERVICE_run (3, argv, "test_service",
162 GNUNET_SERVICE_OPTION_NONE, &runner, &ok)); 154 GNUNET_SERVICE_OPTION_NONE, &runner, &ok));
163 GNUNET_assert (0 == ok); 155 GNUNET_assert (0 == ok);
164 return ok; 156 return ok;
@@ -201,17 +193,11 @@ check6 ()
201 "test_service6", 193 "test_service6",
202 "-c", 194 "-c",
203 "test_service_data.conf", 195 "test_service_data.conf",
204 "-L",
205#if VERBOSE
206 "DEBUG",
207#else
208 "WARNING",
209#endif
210 NULL 196 NULL
211 }; 197 };
212 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Starting v6 service\n"); 198 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Starting v6 service\n");
213 GNUNET_assert (GNUNET_OK == 199 GNUNET_assert (GNUNET_OK ==
214 GNUNET_SERVICE_run (5, argv, "test_service6", 200 GNUNET_SERVICE_run (3, argv, "test_service6",
215 GNUNET_SERVICE_OPTION_NONE, &runner6, 201 GNUNET_SERVICE_OPTION_NONE, &runner6,
216 &ok)); 202 &ok));
217 GNUNET_assert (0 == ok); 203 GNUNET_assert (0 == ok);
@@ -241,12 +227,6 @@ check_start_stop ()
241 "test-service-program", 227 "test-service-program",
242 "-c", 228 "-c",
243 "test_service_data.conf", 229 "test_service_data.conf",
244 "-L",
245#if VERBOSE
246 "DEBUG",
247#else
248 "WARNING",
249#endif
250 NULL 230 NULL
251 }; 231 };
252 const struct GNUNET_GETOPT_CommandLineOption options[] = { 232 const struct GNUNET_GETOPT_CommandLineOption options[] = {
@@ -255,9 +235,9 @@ check_start_stop ()
255 int ret = 1; 235 int ret = 1;
256 236
257 GNUNET_assert (GNUNET_OK == 237 GNUNET_assert (GNUNET_OK ==
258 GNUNET_PROGRAM_run (5, argv, "test-service-program", "no help", 238 GNUNET_PROGRAM_run (3, argv, "test-service-program", "no help",
259 options, &start_stop_main, &ret)); 239 options, &start_stop_main, &ret));
260 240
261 GNUNET_break (0 == ret); 241 GNUNET_break (0 == ret);
262 return ret; 242 return ret;
263} 243}
@@ -270,11 +250,7 @@ main (int argc, char *argv[])
270 struct GNUNET_NETWORK_Handle *s = NULL; 250 struct GNUNET_NETWORK_Handle *s = NULL;
271 251
272 GNUNET_log_setup ("test-service", 252 GNUNET_log_setup ("test-service",
273#if VERBOSE
274 "DEBUG",
275#else
276 "WARNING", 253 "WARNING",
277#endif
278 NULL); 254 NULL);
279 ret += check (); 255 ret += check ();
280 ret += check (); 256 ret += check ();