diff options
author | grothoff <grothoff@140774ce-b5e7-0310-ab8b-a85725594a96> | 2012-05-06 01:12:57 +0000 |
---|---|---|
committer | grothoff <grothoff@140774ce-b5e7-0310-ab8b-a85725594a96> | 2012-05-06 01:12:57 +0000 |
commit | 1b166f13e6f6d5ee66a5dd1966dde96056a80de7 (patch) | |
tree | 82740a981b7f6ae973d915aa77797acd9db668b2 /src/peerinfo | |
parent | 58642f8d0e0b8f1f7117a1e5bf6c93e5da0cdea2 (diff) |
-removing legacy ifdefs, fixing log statements
git-svn-id: https://gnunet.org/svn/gnunet@21285 140774ce-b5e7-0310-ab8b-a85725594a96
Diffstat (limited to 'src/peerinfo')
-rwxr-xr-x | src/peerinfo/perf_peerinfo_api.c | 29 | ||||
-rw-r--r-- | src/peerinfo/test_peerinfo_api.c | 10 |
2 files changed, 3 insertions, 36 deletions
diff --git a/src/peerinfo/perf_peerinfo_api.c b/src/peerinfo/perf_peerinfo_api.c index 1492e07892..8ad79b5b5e 100755 --- a/src/peerinfo/perf_peerinfo_api.c +++ b/src/peerinfo/perf_peerinfo_api.c @@ -53,12 +53,11 @@ static int check_it (void *cls, const struct GNUNET_HELLO_Address *address, struct GNUNET_TIME_Absolute expiration) { -#if DEBUG if (addrlen > 0) { - FPRINTF (stderr, "name: %s, addr: %s\n", tname, (const char *) addr); + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + "name: %s, addr: %s\n", tname, (const char *) addr); } -#endif return GNUNET_OK; } @@ -107,17 +106,8 @@ static void process (void *cls, const struct GNUNET_PeerIdentity *peer, const struct GNUNET_HELLO_Message *hello, const char *err_msg) { - if (peer == NULL) + if (NULL != peer) { -#if DEBUG - FPRINTF (stderr, "Process received NULL response\n"); -#endif - } - else - { -#if DEBUG - FPRINTF (stderr, "Processed a peer\n"); -#endif numpeers++; if (0 && (hello != NULL)) GNUNET_HELLO_iterate_addresses (hello, GNUNET_NO, &check_it, NULL); @@ -153,11 +143,7 @@ check () char *const argv[] = { "perf-peerinfo-api", "-c", "test_peerinfo_api_data.conf", -#if DEBUG_PEERINFO - "-L", "DEBUG", -#else "-L", "ERROR", -#endif NULL }; #if START_SERVICE @@ -169,11 +155,7 @@ check () proc = GNUNET_OS_start_process (GNUNET_YES, NULL, NULL, "gnunet-service-peerinfo", "gnunet-service-peerinfo", -#if DEBUG_PEERINFO - "-L", "DEBUG", -#else "-L", "ERROR", -#endif "-c", "test_peerinfo_api_data.conf", NULL); #endif GNUNET_assert (NULL != proc); @@ -191,7 +173,6 @@ check () GNUNET_OS_process_wait (proc); GNUNET_OS_process_close (proc); proc = NULL; - #endif return ok; } @@ -203,11 +184,7 @@ main (int argc, char *argv[]) int ret = 0; GNUNET_log_setup ("perf_peerinfo_api", -#if DEBUG_PEERINFO - "DEBUG", -#else "ERROR", -#endif NULL); ret = check (); GNUNET_DISK_directory_remove ("/tmp/test-gnunet-peerinfo"); diff --git a/src/peerinfo/test_peerinfo_api.c b/src/peerinfo/test_peerinfo_api.c index e4eb7d4805..ebb12b5057 100644 --- a/src/peerinfo/test_peerinfo_api.c +++ b/src/peerinfo/test_peerinfo_api.c @@ -170,9 +170,6 @@ check () char *const argv[] = { "test-peerinfo-api", "-c", "test_peerinfo_api_data.conf", -#if DEBUG_PEERINFO - "-L", "DEBUG", -#endif NULL }; struct GNUNET_GETOPT_CommandLineOption options[] = { @@ -181,9 +178,6 @@ check () proc = GNUNET_OS_start_process (GNUNET_YES, NULL, NULL, "gnunet-service-peerinfo", "gnunet-service-peerinfo", -#if DEBUG_PEERINFO - "-L", "DEBUG", -#endif "-c", "test_peerinfo_api_data.conf", NULL); GNUNET_assert (NULL != proc); GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1, argv, @@ -206,11 +200,7 @@ main (int argc, char *argv[]) int ret = 0; GNUNET_log_setup ("test_peerinfo_api", -#if DEBUG_PEERINFO - "DEBUG", -#else "WARNING", -#endif NULL); ret = check (); GNUNET_DISK_directory_remove ("/tmp/test-gnunet-peerinfo"); |