aboutsummaryrefslogtreecommitdiff
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
parentc0c97de5adc9bc6922d001b53b4492038d23baa3 (diff)
downloadgnunet-a1d7d541d65b18b86c0e316b0a34de4168bf8b8c.tar.gz
gnunet-a1d7d541d65b18b86c0e316b0a34de4168bf8b8c.zip
-code cleanup
-rw-r--r--src/fs/test_fs_search_probes.c32
-rw-r--r--src/fs/test_fs_test_lib.c7
2 files changed, 8 insertions, 31 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);
diff --git a/src/fs/test_fs_test_lib.c b/src/fs/test_fs_test_lib.c
index 589abb3fb..29d5fe47f 100644
--- a/src/fs/test_fs_test_lib.c
+++ b/src/fs/test_fs_test_lib.c
@@ -138,9 +138,6 @@ main (int argc, char *argv[])
138 "test-fs-test-lib", 138 "test-fs-test-lib",
139 "-c", 139 "-c",
140 "fs_test_lib_data.conf", 140 "fs_test_lib_data.conf",
141#if VERBOSE
142 "-L", "DEBUG",
143#endif
144 NULL 141 NULL
145 }; 142 };
146 struct GNUNET_GETOPT_CommandLineOption options[] = { 143 struct GNUNET_GETOPT_CommandLineOption options[] = {
@@ -149,11 +146,7 @@ main (int argc, char *argv[])
149 146
150 GNUNET_DISK_directory_remove ("/tmp/gnunet-test-fs-lib/"); 147 GNUNET_DISK_directory_remove ("/tmp/gnunet-test-fs-lib/");
151 GNUNET_log_setup ("test_fs_test_lib", 148 GNUNET_log_setup ("test_fs_test_lib",
152#if VERBOSE
153 "DEBUG",
154#else
155 "WARNING", 149 "WARNING",
156#endif
157 NULL); 150 NULL);
158 GNUNET_PROGRAM_run ((sizeof (argvx) / sizeof (char *)) - 1, argvx, 151 GNUNET_PROGRAM_run ((sizeof (argvx) / sizeof (char *)) - 1, argvx,
159 "test-fs-test-lib", "nohelp", options, &run, NULL); 152 "test-fs-test-lib", "nohelp", options, &run, NULL);