aboutsummaryrefslogtreecommitdiff
path: root/src/fs/test_fs_search_probes.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-05-16 11:22:58 +0000
committerChristian Grothoff <christian@grothoff.org>2012-05-16 11:22:58 +0000
commita1d7d541d65b18b86c0e316b0a34de4168bf8b8c (patch)
treecd4ca36b68a952e754ade7c475cb00e5cd9981d2 /src/fs/test_fs_search_probes.c
parentc0c97de5adc9bc6922d001b53b4492038d23baa3 (diff)
downloadgnunet-a1d7d541d65b18b86c0e316b0a34de4168bf8b8c.tar.gz
gnunet-a1d7d541d65b18b86c0e316b0a34de4168bf8b8c.zip
-code cleanup
Diffstat (limited to 'src/fs/test_fs_search_probes.c')
-rw-r--r--src/fs/test_fs_search_probes.c32
1 files changed, 8 insertions, 24 deletions
diff --git a/src/fs/test_fs_search_probes.c b/src/fs/test_fs_search_probes.c
index 6f57ea8b0..b81659899 100644
--- a/src/fs/test_fs_search_probes.c
+++ b/src/fs/test_fs_search_probes.c
@@ -23,14 +23,11 @@
23 * @brief simple testcase for publish + search operation with probes 23 * @brief simple testcase for publish + search operation with probes
24 * @author Christian Grothoff 24 * @author Christian Grothoff
25 */ 25 */
26
27#include "platform.h" 26#include "platform.h"
28#include "gnunet_util_lib.h" 27#include "gnunet_util_lib.h"
29#include "gnunet_arm_service.h" 28#include "gnunet_arm_service.h"
30#include "gnunet_fs_service.h" 29#include "gnunet_fs_service.h"
31 30
32#define VERBOSE GNUNET_YES
33
34#define START_ARM GNUNET_YES 31#define START_ARM GNUNET_YES
35 32
36/** 33/**
@@ -96,14 +93,13 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event)
96 switch (event->status) 93 switch (event->status)
97 { 94 {
98 case GNUNET_FS_STATUS_PUBLISH_PROGRESS: 95 case GNUNET_FS_STATUS_PUBLISH_PROGRESS:
99#if VERBOSE 96 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
100 printf ("Publish is progressing (%llu/%llu at level %u off %llu)...\n", 97 "Publish is progressing (%llu/%llu at level %u off %llu)...\n",
101 (unsigned long long) event->value.publish.completed, 98 (unsigned long long) event->value.publish.completed,
102 (unsigned long long) event->value.publish.size, 99 (unsigned long long) event->value.publish.size,
103 event->value.publish.specifics.progress.depth, 100 event->value.publish.specifics.progress.depth,
104 (unsigned long long) event->value.publish.specifics. 101 (unsigned long long) event->value.publish.specifics.
105 progress.offset); 102 progress.offset);
106#endif
107 break; 103 break;
108 case GNUNET_FS_STATUS_PUBLISH_COMPLETED: 104 case GNUNET_FS_STATUS_PUBLISH_COMPLETED:
109 kuri = GNUNET_FS_uri_ksk_create_from_args (1, keywords); 105 kuri = GNUNET_FS_uri_ksk_create_from_args (1, keywords);
@@ -115,9 +111,7 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event)
115 GNUNET_assert (search != NULL); 111 GNUNET_assert (search != NULL);
116 break; 112 break;
117 case GNUNET_FS_STATUS_SEARCH_RESULT: 113 case GNUNET_FS_STATUS_SEARCH_RESULT:
118#if VERBOSE 114 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Search complete.\n");
119 printf ("Search complete.\n");
120#endif
121 break; 115 break;
122 case GNUNET_FS_STATUS_PUBLISH_ERROR: 116 case GNUNET_FS_STATUS_PUBLISH_ERROR:
123 FPRINTF (stderr, "Error publishing file: %s\n", 117 FPRINTF (stderr, "Error publishing file: %s\n",
@@ -179,9 +173,6 @@ setup_peer (struct PeerContext *p, const char *cfgname)
179 p->arm_proc = 173 p->arm_proc =
180 GNUNET_OS_start_process (GNUNET_YES, NULL, NULL, "gnunet-service-arm", 174 GNUNET_OS_start_process (GNUNET_YES, NULL, NULL, "gnunet-service-arm",
181 "gnunet-service-arm", 175 "gnunet-service-arm",
182#if VERBOSE
183 "-L", "DEBUG",
184#endif
185 "-c", cfgname, NULL); 176 "-c", cfgname, NULL);
186#endif 177#endif
187 GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname)); 178 GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname));
@@ -258,9 +249,6 @@ main (int argc, char *argv[])
258 "test-fs-search-probes", 249 "test-fs-search-probes",
259 "-c", 250 "-c",
260 "test_fs_search_data.conf", 251 "test_fs_search_data.conf",
261#if VERBOSE
262 "-L", "DEBUG",
263#endif
264 NULL 252 NULL
265 }; 253 };
266 struct GNUNET_GETOPT_CommandLineOption options[] = { 254 struct GNUNET_GETOPT_CommandLineOption options[] = {
@@ -268,11 +256,7 @@ main (int argc, char *argv[])
268 }; 256 };
269 257
270 GNUNET_log_setup ("test_fs_search_probes", 258 GNUNET_log_setup ("test_fs_search_probes",
271#if VERBOSE
272 "DEBUG",
273#else
274 "WARNING", 259 "WARNING",
275#endif
276 NULL); 260 NULL);
277 GNUNET_PROGRAM_run ((sizeof (argvx) / sizeof (char *)) - 1, argvx, 261 GNUNET_PROGRAM_run ((sizeof (argvx) / sizeof (char *)) - 1, argvx,
278 "test-fs-search", "nohelp", options, &run, NULL); 262 "test-fs-search", "nohelp", options, &run, NULL);