-code cleanup
authorChristian Grothoff <christian@grothoff.org>
Wed, 16 May 2012 11:22:58 +0000 (11:22 +0000)
committerChristian Grothoff <christian@grothoff.org>
Wed, 16 May 2012 11:22:58 +0000 (11:22 +0000)
src/fs/test_fs_search_probes.c
src/fs/test_fs_test_lib.c

index 6f57ea8b0edba35eb8e5c4384178f3ee51018fbc..b816598996480491efc1020b091cff917eaf771a 100644 (file)
  * @brief simple testcase for publish + search operation with probes
  * @author Christian Grothoff
  */
-
 #include "platform.h"
 #include "gnunet_util_lib.h"
 #include "gnunet_arm_service.h"
 #include "gnunet_fs_service.h"
 
-#define VERBOSE GNUNET_YES
-
 #define START_ARM GNUNET_YES
 
 /**
@@ -96,14 +93,13 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event)
   switch (event->status)
   {
   case GNUNET_FS_STATUS_PUBLISH_PROGRESS:
-#if VERBOSE
-    printf ("Publish is progressing (%llu/%llu at level %u off %llu)...\n",
-            (unsigned long long) event->value.publish.completed,
-            (unsigned long long) event->value.publish.size,
-            event->value.publish.specifics.progress.depth,
-            (unsigned long long) event->value.publish.specifics.
-            progress.offset);
-#endif
+    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+               "Publish is progressing (%llu/%llu at level %u off %llu)...\n",
+               (unsigned long long) event->value.publish.completed,
+               (unsigned long long) event->value.publish.size,
+               event->value.publish.specifics.progress.depth,
+               (unsigned long long) event->value.publish.specifics.
+               progress.offset);
     break;
   case GNUNET_FS_STATUS_PUBLISH_COMPLETED:
     kuri = GNUNET_FS_uri_ksk_create_from_args (1, keywords);
@@ -115,9 +111,7 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event)
     GNUNET_assert (search != NULL);
     break;
   case GNUNET_FS_STATUS_SEARCH_RESULT:
-#if VERBOSE
-    printf ("Search complete.\n");
-#endif
+    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Search complete.\n");
     break;
   case GNUNET_FS_STATUS_PUBLISH_ERROR:
     FPRINTF (stderr, "Error publishing file: %s\n",
@@ -179,9 +173,6 @@ setup_peer (struct PeerContext *p, const char *cfgname)
   p->arm_proc =
       GNUNET_OS_start_process (GNUNET_YES, NULL, NULL, "gnunet-service-arm",
                                "gnunet-service-arm",
-#if VERBOSE
-                               "-L", "DEBUG",
-#endif
                                "-c", cfgname, NULL);
 #endif
   GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname));
@@ -258,9 +249,6 @@ main (int argc, char *argv[])
     "test-fs-search-probes",
     "-c",
     "test_fs_search_data.conf",
-#if VERBOSE
-    "-L", "DEBUG",
-#endif
     NULL
   };
   struct GNUNET_GETOPT_CommandLineOption options[] = {
@@ -268,11 +256,7 @@ main (int argc, char *argv[])
   };
 
   GNUNET_log_setup ("test_fs_search_probes",
-#if VERBOSE
-                    "DEBUG",
-#else
                     "WARNING",
-#endif
                     NULL);
   GNUNET_PROGRAM_run ((sizeof (argvx) / sizeof (char *)) - 1, argvx,
                       "test-fs-search", "nohelp", options, &run, NULL);
index 589abb3fbbc3aaae53ddbbd73e866f17ee950e24..29d5fe47f2306b237dc1f672f09a91f91f5a0a8e 100644 (file)
@@ -138,9 +138,6 @@ main (int argc, char *argv[])
     "test-fs-test-lib",
     "-c",
     "fs_test_lib_data.conf",
-#if VERBOSE
-    "-L", "DEBUG",
-#endif
     NULL
   };
   struct GNUNET_GETOPT_CommandLineOption options[] = {
@@ -149,11 +146,7 @@ main (int argc, char *argv[])
 
   GNUNET_DISK_directory_remove ("/tmp/gnunet-test-fs-lib/");
   GNUNET_log_setup ("test_fs_test_lib",
-#if VERBOSE
-                    "DEBUG",
-#else
                     "WARNING",
-#endif
                     NULL);
   GNUNET_PROGRAM_run ((sizeof (argvx) / sizeof (char *)) - 1, argvx,
                       "test-fs-test-lib", "nohelp", options, &run, NULL);