diff options
Diffstat (limited to 'src/service/peerstore/test_peerstore_api_store.c')
-rw-r--r-- | src/service/peerstore/test_peerstore_api_store.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/service/peerstore/test_peerstore_api_store.c b/src/service/peerstore/test_peerstore_api_store.c index 77e8a17c1..8cf0e60a7 100644 --- a/src/service/peerstore/test_peerstore_api_store.c +++ b/src/service/peerstore/test_peerstore_api_store.c | |||
@@ -21,6 +21,7 @@ | |||
21 | * @file peerstore/test_peerstore_api_store.c | 21 | * @file peerstore/test_peerstore_api_store.c |
22 | * @brief testcase for peerstore store operation | 22 | * @brief testcase for peerstore store operation |
23 | */ | 23 | */ |
24 | #include "gnunet_common.h" | ||
24 | #include "platform.h" | 25 | #include "platform.h" |
25 | #include "gnunet_peerstore_service.h" | 26 | #include "gnunet_peerstore_service.h" |
26 | #include "gnunet_testing_lib.h" | 27 | #include "gnunet_testing_lib.h" |
@@ -41,6 +42,13 @@ static int count = 0; | |||
41 | 42 | ||
42 | 43 | ||
43 | static void | 44 | static void |
45 | finish (void *cls) | ||
46 | { | ||
47 | GNUNET_PEERSTORE_disconnect (h); | ||
48 | GNUNET_SCHEDULER_shutdown (); | ||
49 | } | ||
50 | |||
51 | static void | ||
44 | test3_cont2 (void *cls, | 52 | test3_cont2 (void *cls, |
45 | const struct GNUNET_PEERSTORE_Record *record, | 53 | const struct GNUNET_PEERSTORE_Record *record, |
46 | const char *emsg) | 54 | const char *emsg) |
@@ -57,8 +65,7 @@ test3_cont2 (void *cls, | |||
57 | } | 65 | } |
58 | GNUNET_assert (count == 1); | 66 | GNUNET_assert (count == 1); |
59 | ok = 0; | 67 | ok = 0; |
60 | GNUNET_PEERSTORE_disconnect (h, GNUNET_YES); | 68 | GNUNET_SCHEDULER_add_now (&finish, NULL); |
61 | GNUNET_SCHEDULER_shutdown (); | ||
62 | } | 69 | } |
63 | 70 | ||
64 | 71 | ||
@@ -158,7 +165,10 @@ test1_cont2 (void *cls, | |||
158 | const char *emsg) | 165 | const char *emsg) |
159 | { | 166 | { |
160 | if (NULL != emsg) | 167 | if (NULL != emsg) |
168 | { | ||
169 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Error received: %s\n", emsg); | ||
161 | return; | 170 | return; |
171 | } | ||
162 | if (NULL != record) | 172 | if (NULL != record) |
163 | { | 173 | { |
164 | GNUNET_assert ((strlen (val1) + 1) == record->value_size); | 174 | GNUNET_assert ((strlen (val1) + 1) == record->value_size); |
@@ -175,6 +185,7 @@ test1_cont2 (void *cls, | |||
175 | static void | 185 | static void |
176 | test1_cont (void *cls, int success) | 186 | test1_cont (void *cls, int success) |
177 | { | 187 | { |
188 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Store done, ret=%d...\n", success); | ||
178 | if (GNUNET_YES != success) | 189 | if (GNUNET_YES != success) |
179 | return; | 190 | return; |
180 | count = 0; | 191 | count = 0; |
@@ -193,6 +204,7 @@ test1_cont (void *cls, int success) | |||
193 | static void | 204 | static void |
194 | test1 () | 205 | test1 () |
195 | { | 206 | { |
207 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test1 start\n"); | ||
196 | GNUNET_PEERSTORE_store (h, | 208 | GNUNET_PEERSTORE_store (h, |
197 | subsystem, | 209 | subsystem, |
198 | &pid, | 210 | &pid, |