From 856ce6820e23c219d58816dd12b5a99a59b9e667 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sat, 23 Mar 2013 19:58:15 +0000 Subject: [PATCH] -simplify --- src/core/test_core_api.c | 21 ++++++--------------- src/core/test_core_api_reliability.c | 23 +++++++---------------- 2 files changed, 13 insertions(+), 31 deletions(-) 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 */ -- 2.25.1