diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-08-15 21:54:06 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-08-15 21:54:06 +0000 |
commit | 5746309cb4be2073d550ad7a6885e918631dbc38 (patch) | |
tree | 89455bc4aadf977816b38df13f990372cd81d71a /src/fs/test_fs_namespace.c | |
parent | 6fd3e715cae09fa6e657c96f1c6f9711ee51f42f (diff) | |
download | gnunet-5746309cb4be2073d550ad7a6885e918631dbc38.tar.gz gnunet-5746309cb4be2073d550ad7a6885e918631dbc38.zip |
indentation
Diffstat (limited to 'src/fs/test_fs_namespace.c')
-rw-r--r-- | src/fs/test_fs_namespace.c | 48 |
1 files changed, 20 insertions, 28 deletions
diff --git a/src/fs/test_fs_namespace.c b/src/fs/test_fs_namespace.c index 96caa8dfa..ae2f77806 100644 --- a/src/fs/test_fs_namespace.c +++ b/src/fs/test_fs_namespace.c | |||
@@ -66,12 +66,13 @@ setup_peer (struct PeerContext *p, const char *cfgname) | |||
66 | { | 66 | { |
67 | p->cfg = GNUNET_CONFIGURATION_create (); | 67 | p->cfg = GNUNET_CONFIGURATION_create (); |
68 | #if START_ARM | 68 | #if START_ARM |
69 | p->arm_proc = GNUNET_OS_start_process (NULL, NULL, "gnunet-service-arm", | 69 | p->arm_proc = |
70 | "gnunet-service-arm", | 70 | GNUNET_OS_start_process (NULL, NULL, "gnunet-service-arm", |
71 | "gnunet-service-arm", | ||
71 | #if VERBOSE | 72 | #if VERBOSE |
72 | "-L", "DEBUG", | 73 | "-L", "DEBUG", |
73 | #endif | 74 | #endif |
74 | "-c", cfgname, NULL); | 75 | "-c", cfgname, NULL); |
75 | #endif | 76 | #endif |
76 | GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname)); | 77 | GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname)); |
77 | } | 78 | } |
@@ -87,8 +88,7 @@ stop_arm (struct PeerContext *p) | |||
87 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); | 88 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); |
88 | if (GNUNET_OS_process_wait (p->arm_proc) != GNUNET_OK) | 89 | if (GNUNET_OS_process_wait (p->arm_proc) != GNUNET_OK) |
89 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "waitpid"); | 90 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "waitpid"); |
90 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 91 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "ARM process %u stopped\n", |
91 | "ARM process %u stopped\n", | ||
92 | GNUNET_OS_process_get_pid (p->arm_proc)); | 92 | GNUNET_OS_process_get_pid (p->arm_proc)); |
93 | GNUNET_OS_process_close (p->arm_proc); | 93 | GNUNET_OS_process_close (p->arm_proc); |
94 | p->arm_proc = NULL; | 94 | p->arm_proc = NULL; |
@@ -155,8 +155,8 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) | |||
155 | case GNUNET_FS_STATUS_SEARCH_RESULT: | 155 | case GNUNET_FS_STATUS_SEARCH_RESULT: |
156 | if (sks_search == event->value.search.sc) | 156 | if (sks_search == event->value.search.sc) |
157 | { | 157 | { |
158 | if (!GNUNET_FS_uri_test_equal (sks_expect_uri, | 158 | if (!GNUNET_FS_uri_test_equal |
159 | event->value.search.specifics.result.uri)) | 159 | (sks_expect_uri, event->value.search.specifics.result.uri)) |
160 | { | 160 | { |
161 | fprintf (stderr, "Wrong result for sks search!\n"); | 161 | fprintf (stderr, "Wrong result for sks search!\n"); |
162 | err = 1; | 162 | err = 1; |
@@ -167,14 +167,13 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) | |||
167 | } | 167 | } |
168 | else if (ksk_search == event->value.search.sc) | 168 | else if (ksk_search == event->value.search.sc) |
169 | { | 169 | { |
170 | if (!GNUNET_FS_uri_test_equal (ksk_expect_uri, | 170 | if (!GNUNET_FS_uri_test_equal |
171 | event->value.search.specifics.result.uri)) | 171 | (ksk_expect_uri, event->value.search.specifics.result.uri)) |
172 | { | 172 | { |
173 | fprintf (stderr, "Wrong result for ksk search!\n"); | 173 | fprintf (stderr, "Wrong result for ksk search!\n"); |
174 | err = 1; | 174 | err = 1; |
175 | } | 175 | } |
176 | GNUNET_SCHEDULER_add_continuation (&abort_ksk_search_task, | 176 | GNUNET_SCHEDULER_add_continuation (&abort_ksk_search_task, NULL, |
177 | NULL, | ||
178 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); | 177 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); |
179 | } | 178 | } |
180 | else | 179 | else |
@@ -184,16 +183,13 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) | |||
184 | } | 183 | } |
185 | break; | 184 | break; |
186 | case GNUNET_FS_STATUS_SEARCH_ERROR: | 185 | case GNUNET_FS_STATUS_SEARCH_ERROR: |
187 | fprintf (stderr, | 186 | fprintf (stderr, "Error searching file: %s\n", |
188 | "Error searching file: %s\n", | ||
189 | event->value.search.specifics.error.message); | 187 | event->value.search.specifics.error.message); |
190 | if (sks_search == event->value.search.sc) | 188 | if (sks_search == event->value.search.sc) |
191 | GNUNET_SCHEDULER_add_continuation (&abort_sks_search_task, | 189 | GNUNET_SCHEDULER_add_continuation (&abort_sks_search_task, NULL, |
192 | NULL, | ||
193 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); | 190 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); |
194 | else if (ksk_search == event->value.search.sc) | 191 | else if (ksk_search == event->value.search.sc) |
195 | GNUNET_SCHEDULER_add_continuation (&abort_ksk_search_task, | 192 | GNUNET_SCHEDULER_add_continuation (&abort_ksk_search_task, NULL, |
196 | NULL, | ||
197 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); | 193 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); |
198 | else | 194 | else |
199 | GNUNET_break (0); | 195 | GNUNET_break (0); |
@@ -365,15 +361,12 @@ testNamespace () | |||
365 | 361 | ||
366 | 362 | ||
367 | static void | 363 | static void |
368 | run (void *cls, | 364 | run (void *cls, char *const *args, const char *cfgfile, |
369 | char *const *args, | 365 | const struct GNUNET_CONFIGURATION_Handle *cfg) |
370 | const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *cfg) | ||
371 | { | 366 | { |
372 | setup_peer (&p1, "test_fs_namespace_data.conf"); | 367 | setup_peer (&p1, "test_fs_namespace_data.conf"); |
373 | fs = GNUNET_FS_start (cfg, | 368 | fs = GNUNET_FS_start (cfg, "test-fs-namespace", &progress_cb, NULL, |
374 | "test-fs-namespace", | 369 | GNUNET_FS_FLAGS_NONE, GNUNET_FS_OPTIONS_END); |
375 | &progress_cb, | ||
376 | NULL, GNUNET_FS_FLAGS_NONE, GNUNET_FS_OPTIONS_END); | ||
377 | testNamespace (); | 370 | testNamespace (); |
378 | } | 371 | } |
379 | 372 | ||
@@ -401,9 +394,8 @@ main (int argc, char *argv[]) | |||
401 | "WARNING", | 394 | "WARNING", |
402 | #endif | 395 | #endif |
403 | NULL); | 396 | NULL); |
404 | GNUNET_PROGRAM_run ((sizeof (argvx) / sizeof (char *)) - 1, | 397 | GNUNET_PROGRAM_run ((sizeof (argvx) / sizeof (char *)) - 1, argvx, |
405 | argvx, "test-fs-namespace", | 398 | "test-fs-namespace", "nohelp", options, &run, NULL); |
406 | "nohelp", options, &run, NULL); | ||
407 | stop_arm (&p1); | 399 | stop_arm (&p1); |
408 | if (GNUNET_YES != update_started) | 400 | if (GNUNET_YES != update_started) |
409 | { | 401 | { |