diff options
author | Christian Grothoff <christian@grothoff.org> | 2010-03-29 17:51:49 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2010-03-29 17:51:49 +0000 |
commit | a8e90a359a36b28bc73bd3709332cef607d139fa (patch) | |
tree | 587f60f42c4a21155a80cded9f349f6c95f91457 /src/fs/test_fs_namespace.c | |
parent | 481d9421fcb761679daea807e94dd147d35ea7a0 (diff) | |
download | gnunet-a8e90a359a36b28bc73bd3709332cef607d139fa.tar.gz gnunet-a8e90a359a36b28bc73bd3709332cef607d139fa.zip |
fixes
Diffstat (limited to 'src/fs/test_fs_namespace.c')
-rw-r--r-- | src/fs/test_fs_namespace.c | 36 |
1 files changed, 22 insertions, 14 deletions
diff --git a/src/fs/test_fs_namespace.c b/src/fs/test_fs_namespace.c index 6014e4394..2284f3cef 100644 --- a/src/fs/test_fs_namespace.c +++ b/src/fs/test_fs_namespace.c | |||
@@ -23,6 +23,9 @@ | |||
23 | * @brief Test for fs_namespace.c | 23 | * @brief Test for fs_namespace.c |
24 | * @author Christian Grothoff | 24 | * @author Christian Grothoff |
25 | * | 25 | * |
26 | * | ||
27 | * FIXME: | ||
28 | * - child search of "sks" search (the "next" identifier) is not stopped => no termination! | ||
26 | * TODO: | 29 | * TODO: |
27 | * - add timeout task | 30 | * - add timeout task |
28 | */ | 31 | */ |
@@ -105,7 +108,10 @@ abort_ksk_search_task (void *cls, | |||
105 | GNUNET_FS_search_stop (ksk_search); | 108 | GNUNET_FS_search_stop (ksk_search); |
106 | ksk_search = NULL; | 109 | ksk_search = NULL; |
107 | if (sks_search == NULL) | 110 | if (sks_search == NULL) |
108 | GNUNET_FS_stop (fs); | 111 | { |
112 | fprintf (stderr, "initiating shutdown\n"); | ||
113 | GNUNET_FS_stop (fs); | ||
114 | } | ||
109 | } | 115 | } |
110 | } | 116 | } |
111 | 117 | ||
@@ -116,16 +122,18 @@ abort_sks_search_task (void *cls, | |||
116 | { | 122 | { |
117 | struct GNUNET_FS_Namespace *ns; | 123 | struct GNUNET_FS_Namespace *ns; |
118 | 124 | ||
119 | if (sks_search != NULL) | 125 | if (sks_search == NULL) |
126 | return; | ||
127 | GNUNET_FS_search_stop (sks_search); | ||
128 | sks_search = NULL; | ||
129 | ns = GNUNET_FS_namespace_create (fs, | ||
130 | "testNamespace"); | ||
131 | GNUNET_assert (GNUNET_OK == GNUNET_FS_namespace_delete (ns, GNUNET_YES)); | ||
132 | if (ksk_search == NULL) | ||
120 | { | 133 | { |
121 | GNUNET_FS_search_stop (sks_search); | 134 | fprintf (stderr, "initiating shutdown\n"); |
122 | sks_search = NULL; | 135 | GNUNET_FS_stop (fs); |
123 | ns = GNUNET_FS_namespace_create (fs, | 136 | } |
124 | "testNamespace"); | ||
125 | GNUNET_assert (GNUNET_OK == GNUNET_FS_namespace_delete (ns, GNUNET_YES)); | ||
126 | if (ksk_search == NULL) | ||
127 | GNUNET_FS_stop (fs); | ||
128 | } | ||
129 | } | 137 | } |
130 | 138 | ||
131 | 139 | ||
@@ -202,26 +210,26 @@ progress_cb (void *cls, | |||
202 | (0 == strcmp ("ksk_search", event->value.search.cctx))); | 210 | (0 == strcmp ("ksk_search", event->value.search.cctx))); |
203 | if (NULL == event->value.search.cctx) | 211 | if (NULL == event->value.search.cctx) |
204 | { | 212 | { |
205 | GNUNET_assert (sks_search == event->value.search.pctx); | 213 | GNUNET_assert (0 == strcmp ("sks_search", event->value.search.pctx)); |
206 | update_started = GNUNET_YES; | 214 | update_started = GNUNET_YES; |
207 | } | 215 | } |
208 | GNUNET_assert (1 == event->value.search.anonymity); | 216 | GNUNET_assert (1 == event->value.search.anonymity); |
209 | break; | 217 | break; |
210 | case GNUNET_FS_STATUS_SEARCH_RESULT_STOPPED: | 218 | case GNUNET_FS_STATUS_SEARCH_RESULT_STOPPED: |
211 | break; | 219 | return NULL; |
212 | case GNUNET_FS_STATUS_SEARCH_STOPPED: | 220 | case GNUNET_FS_STATUS_SEARCH_STOPPED: |
213 | fprintf (stderr, | 221 | fprintf (stderr, |
214 | "Search stop event received\n"); | 222 | "Search stop event received\n"); |
215 | GNUNET_assert ( (ksk_search == event->value.search.sc) || | 223 | GNUNET_assert ( (ksk_search == event->value.search.sc) || |
216 | (sks_search == event->value.search.sc)); | 224 | (sks_search == event->value.search.sc)); |
217 | break; | 225 | return NULL; |
218 | default: | 226 | default: |
219 | fprintf (stderr, | 227 | fprintf (stderr, |
220 | "Unexpected event: %d\n", | 228 | "Unexpected event: %d\n", |
221 | event->status); | 229 | event->status); |
222 | break; | 230 | break; |
223 | } | 231 | } |
224 | return NULL; | 232 | return event->value.search.cctx; |
225 | } | 233 | } |
226 | 234 | ||
227 | 235 | ||