From: Christian Grothoff Date: Sat, 23 Mar 2013 19:58:15 +0000 (+0000) Subject: -simplify X-Git-Tag: initial-import-from-subversion-38251~9502 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=856ce6820e23c219d58816dd12b5a99a59b9e667;p=oweals%2Fgnunet.git -simplify --- diff --git a/src/core/test_core_api.c b/src/core/test_core_api.c index c7865dd11..9aaecea10 100644 --- a/src/core/test_core_api.c +++ b/src/core/test_core_api.c @@ -349,8 +349,8 @@ stop_arm (struct PeerContext *p) } -static int -check () +int +main (int argc, char *argv[]) { char *const argv[] = { "test-core-api", "-c", @@ -361,26 +361,17 @@ check () GNUNET_GETOPT_OPTION_END }; ok = 1; + GNUNET_log_setup ("test-core-api", + "WARNING", + NULL); GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1, argv, "test-core-api", "nohelp", options, &run, &ok); stop_arm (&p1); stop_arm (&p2); - return ok; -} - -int -main (int argc, char *argv[]) -{ - int ret; - - GNUNET_log_setup ("test-core-api", - "WARNING", - NULL); - ret = check (); GNUNET_DISK_directory_remove ("/tmp/test-gnunet-core-peer-1"); GNUNET_DISK_directory_remove ("/tmp/test-gnunet-core-peer-2"); - return ret; + return ok; } /* end of test_core_api.c */ diff --git a/src/core/test_core_api_reliability.c b/src/core/test_core_api_reliability.c index 47ade350c..5e9267096 100644 --- a/src/core/test_core_api_reliability.c +++ b/src/core/test_core_api_reliability.c @@ -461,8 +461,9 @@ stop_arm (struct PeerContext *p) GNUNET_CONFIGURATION_destroy (p->cfg); } -static int -check () + +int +main (int argc, char *argv[]) { char *const argv[] = { "test-core-api-reliability", "-c", @@ -473,28 +474,18 @@ check () GNUNET_GETOPT_OPTION_END }; ok = 1; + GNUNET_log_setup ("test-core-api", + "WARNING", + NULL); GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1, argv, "test-core-api-reliability", "nohelp", options, &run, &ok); stop_arm (&p1); stop_arm (&p2); - return ok; -} - - -int -main (int argc, char *argv[]) -{ - int ret; - - GNUNET_log_setup ("test-core-api", - "WARNING", - NULL); - ret = check (); GNUNET_DISK_directory_remove ("/tmp/test-gnunet-core-peer-1"); GNUNET_DISK_directory_remove ("/tmp/test-gnunet-core-peer-2"); - return ret; + return ok; } /* end of test_core_api_reliability.c */