diff options
author | Christian Grothoff <christian@grothoff.org> | 2010-09-05 21:48:41 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2010-09-05 21:48:41 +0000 |
commit | 7749caa5dbd33bc337675ccc38e08213ef46ddcc (patch) | |
tree | 42ef890b1a91bbbadad4d9162c15fac15e1611d0 /src/fs/test_fs_namespace_list_updateable.c | |
parent | ba8ca593c236036cfeaa0b1bafd6a79c851017d8 (diff) | |
download | gnunet-7749caa5dbd33bc337675ccc38e08213ef46ddcc.tar.gz gnunet-7749caa5dbd33bc337675ccc38e08213ef46ddcc.zip |
fix
Diffstat (limited to 'src/fs/test_fs_namespace_list_updateable.c')
-rw-r--r-- | src/fs/test_fs_namespace_list_updateable.c | 63 |
1 files changed, 57 insertions, 6 deletions
diff --git a/src/fs/test_fs_namespace_list_updateable.c b/src/fs/test_fs_namespace_list_updateable.c index c2351471e..fc6b1537a 100644 --- a/src/fs/test_fs_namespace_list_updateable.c +++ b/src/fs/test_fs_namespace_list_updateable.c | |||
@@ -19,12 +19,9 @@ | |||
19 | */ | 19 | */ |
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @file fs/test_fs_namespace.c | 22 | * @file fs/test_fs_namespace_list_updateable.c |
23 | * @brief Test for fs_namespace.c | 23 | * @brief Test for fs_namespace_list_updateable.c |
24 | * @author Christian Grothoff | 24 | * @author Christian Grothoff |
25 | * | ||
26 | * TODO: | ||
27 | * - add timeout task | ||
28 | */ | 25 | */ |
29 | #include "platform.h" | 26 | #include "platform.h" |
30 | #include "gnunet_util_lib.h" | 27 | #include "gnunet_util_lib.h" |
@@ -112,11 +109,61 @@ stop_arm (struct PeerContext *p) | |||
112 | 109 | ||
113 | 110 | ||
114 | static void | 111 | static void |
112 | check_next (void *cls, | ||
113 | const char *last_id, | ||
114 | const struct GNUNET_FS_Uri *last_uri, | ||
115 | const struct GNUNET_CONTAINER_MetaData *last_meta, | ||
116 | const char *next_id) | ||
117 | { | ||
118 | GNUNET_break (0 == strcmp (last_id, "next")); | ||
119 | GNUNET_break (0 == strcmp (next_id, "future")); | ||
120 | err -= 4; | ||
121 | } | ||
122 | |||
123 | |||
124 | static void | ||
125 | check_this_next (void *cls, | ||
126 | const char *last_id, | ||
127 | const struct GNUNET_FS_Uri *last_uri, | ||
128 | const struct GNUNET_CONTAINER_MetaData *last_meta, | ||
129 | const char *next_id) | ||
130 | { | ||
131 | GNUNET_break (0 == strcmp (last_id, "this")); | ||
132 | GNUNET_break (0 == strcmp (next_id, "next")); | ||
133 | err -= 2; | ||
134 | err += 4; | ||
135 | GNUNET_FS_namespace_list_updateable (ns, | ||
136 | next_id, | ||
137 | &check_next, | ||
138 | NULL); | ||
139 | } | ||
140 | |||
141 | |||
142 | static void | ||
115 | sks_cont_next (void *cls, | 143 | sks_cont_next (void *cls, |
116 | const struct GNUNET_FS_Uri *uri, | 144 | const struct GNUNET_FS_Uri *uri, |
117 | const char *emsg) | 145 | const char *emsg) |
118 | { | 146 | { |
119 | GNUNET_assert (NULL == emsg); | 147 | GNUNET_assert (NULL == emsg); |
148 | err += 2; | ||
149 | GNUNET_FS_namespace_list_updateable (ns, | ||
150 | NULL, | ||
151 | &check_this_next, | ||
152 | NULL); | ||
153 | |||
154 | } | ||
155 | |||
156 | |||
157 | static void | ||
158 | check_this (void *cls, | ||
159 | const char *last_id, | ||
160 | const struct GNUNET_FS_Uri *last_uri, | ||
161 | const struct GNUNET_CONTAINER_MetaData *last_meta, | ||
162 | const char *next_id) | ||
163 | { | ||
164 | GNUNET_break (0 == strcmp (last_id, "this")); | ||
165 | GNUNET_break (0 == strcmp (next_id, "next")); | ||
166 | err -= 1; | ||
120 | } | 167 | } |
121 | 168 | ||
122 | 169 | ||
@@ -126,7 +173,11 @@ sks_cont_this (void *cls, | |||
126 | const char *emsg) | 173 | const char *emsg) |
127 | { | 174 | { |
128 | GNUNET_assert (NULL == emsg); | 175 | GNUNET_assert (NULL == emsg); |
129 | 176 | err = 1; | |
177 | GNUNET_FS_namespace_list_updateable (ns, | ||
178 | NULL, | ||
179 | &check_this, | ||
180 | NULL); | ||
130 | GNUNET_FS_publish_sks (fs, | 181 | GNUNET_FS_publish_sks (fs, |
131 | ns, | 182 | ns, |
132 | "next", | 183 | "next", |