aboutsummaryrefslogtreecommitdiff
path: root/src/hostlist/test_gnunet_daemon_hostlist_reconnect.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2013-05-22 10:25:45 +0000
committerChristian Grothoff <christian@grothoff.org>2013-05-22 10:25:45 +0000
commit6a50917d68918635a232b7a27a8c41195d8d5a8d (patch)
treee85b8dfac593b875106bd0b9370daf9432a23272 /src/hostlist/test_gnunet_daemon_hostlist_reconnect.c
parent73fd3edc250a6f7df402c63820774b5cbd1a73b1 (diff)
downloadgnunet-6a50917d68918635a232b7a27a8c41195d8d5a8d.tar.gz
gnunet-6a50917d68918635a232b7a27a8c41195d8d5a8d.zip
-simplify
Diffstat (limited to 'src/hostlist/test_gnunet_daemon_hostlist_reconnect.c')
-rw-r--r--src/hostlist/test_gnunet_daemon_hostlist_reconnect.c31
1 files changed, 11 insertions, 20 deletions
diff --git a/src/hostlist/test_gnunet_daemon_hostlist_reconnect.c b/src/hostlist/test_gnunet_daemon_hostlist_reconnect.c
index 199040346..3b1107e62 100644
--- a/src/hostlist/test_gnunet_daemon_hostlist_reconnect.c
+++ b/src/hostlist/test_gnunet_daemon_hostlist_reconnect.c
@@ -198,29 +198,17 @@ run (void *cls, char *const *args, const char *cfgfile,
198} 198}
199 199
200 200
201static int 201int
202check () 202main (int argc, char *argv[])
203{ 203{
204 char *const argv[] = { "test-gnunet-daemon-hostlist", 204 static char *const argv[] = {
205 "test-gnunet-daemon-hostlist",
205 "-c", "test_gnunet_daemon_hostlist_data.conf", 206 "-c", "test_gnunet_daemon_hostlist_data.conf",
206 NULL 207 NULL
207 }; 208 };
208 struct GNUNET_GETOPT_CommandLineOption options[] = { 209 static struct GNUNET_GETOPT_CommandLineOption options[] = {
209 GNUNET_GETOPT_OPTION_END 210 GNUNET_GETOPT_OPTION_END
210 }; 211 };
211 ok = 1;
212 GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1, argv,
213 "test-gnunet-daemon-hostlist", "nohelp", options, &run,
214 &ok);
215 return ok;
216}
217
218
219int
220main (int argc, char *argv[])
221{
222
223 int ret;
224 212
225 GNUNET_DISK_directory_remove ("/tmp/test-gnunet-hostlist-peer-1"); 213 GNUNET_DISK_directory_remove ("/tmp/test-gnunet-hostlist-peer-1");
226 GNUNET_DISK_directory_remove ("/tmp/test-gnunet-hostlist-peer-2"); 214 GNUNET_DISK_directory_remove ("/tmp/test-gnunet-hostlist-peer-2");
@@ -228,8 +216,11 @@ main (int argc, char *argv[])
228 GNUNET_log_setup ("test-gnunet-daemon-hostlist", 216 GNUNET_log_setup ("test-gnunet-daemon-hostlist",
229 "WARNING", 217 "WARNING",
230 NULL); 218 NULL);
231 ret = check (); 219 ok = 1;
232 if (ret == 0) 220 GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1, argv,
221 "test-gnunet-daemon-hostlist", "nohelp", options, &run,
222 &ok);
223 if (0 == ok)
233 { 224 {
234 FPRINTF (stderr, "%s", "."); 225 FPRINTF (stderr, "%s", ".");
235 /* now do it again */ 226 /* now do it again */
@@ -239,7 +230,7 @@ main (int argc, char *argv[])
239 GNUNET_DISK_directory_remove ("/tmp/test-gnunet-hostlist-peer-1"); 230 GNUNET_DISK_directory_remove ("/tmp/test-gnunet-hostlist-peer-1");
240 GNUNET_DISK_directory_remove ("/tmp/test-gnunet-hostlist-peer-2"); 231 GNUNET_DISK_directory_remove ("/tmp/test-gnunet-hostlist-peer-2");
241 GNUNET_DISK_directory_remove ("/tmp/test-gnunet-hostlist-peer-3"); 232 GNUNET_DISK_directory_remove ("/tmp/test-gnunet-hostlist-peer-3");
242 return ret; 233 return ok;
243} 234}
244 235
245/* end of test_gnunet_daemon_hostlist_reconnect.c */ 236/* end of test_gnunet_daemon_hostlist_reconnect.c */