aboutsummaryrefslogtreecommitdiff
path: root/src/datastore/test_datastore_api_management.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2016-06-24 20:17:39 +0000
committerChristian Grothoff <christian@grothoff.org>2016-06-24 20:17:39 +0000
commit3140154d46212e08e0d73ed891a66213a6813075 (patch)
tree018a55a3899207664b388fcf47a679ca54ca6fbf /src/datastore/test_datastore_api_management.c
parentd5fd881c2a044474b54ddf03b6ab8be8d2b75927 (diff)
downloadgnunet-3140154d46212e08e0d73ed891a66213a6813075.tar.gz
gnunet-3140154d46212e08e0d73ed891a66213a6813075.zip
refactoring datastore API to use MQ API, also fixing misc. bugs in new mysql backend
Diffstat (limited to 'src/datastore/test_datastore_api_management.c')
-rw-r--r--src/datastore/test_datastore_api_management.c39
1 files changed, 28 insertions, 11 deletions
diff --git a/src/datastore/test_datastore_api_management.c b/src/datastore/test_datastore_api_management.c
index c9fec79e3..954e61bec 100644
--- a/src/datastore/test_datastore_api_management.c
+++ b/src/datastore/test_datastore_api_management.c
@@ -193,10 +193,18 @@ run_continuation (void *cls)
193 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Executing `%s' number %u\n", "PUT", 193 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Executing `%s' number %u\n", "PUT",
194 crc->i); 194 crc->i);
195 GNUNET_CRYPTO_hash (&crc->i, sizeof (int), &crc->key); 195 GNUNET_CRYPTO_hash (&crc->i, sizeof (int), &crc->key);
196 GNUNET_DATASTORE_put (datastore, 0, &crc->key, get_size (crc->i), 196 GNUNET_DATASTORE_put (datastore,
197 get_data (crc->i), get_type (crc->i), 197 0,
198 get_priority (crc->i), get_anonymity (crc->i), 0, 198 &crc->key,
199 get_expiration (crc->i), 1, 1, TIMEOUT, 199 get_size (crc->i),
200 get_data (crc->i),
201 get_type (crc->i),
202 get_priority (crc->i),
203 get_anonymity (crc->i),
204 0,
205 get_expiration (crc->i),
206 1,
207 1,
200 &check_success, crc); 208 &check_success, crc);
201 crc->i++; 209 crc->i++;
202 if (crc->i == ITERATIONS) 210 if (crc->i == ITERATIONS)
@@ -213,7 +221,8 @@ run_continuation (void *cls)
213 crc->i); 221 crc->i);
214 GNUNET_CRYPTO_hash (&crc->i, sizeof (int), &crc->key); 222 GNUNET_CRYPTO_hash (&crc->i, sizeof (int), &crc->key);
215 GNUNET_DATASTORE_get_key (datastore, crc->offset++, &crc->key, 223 GNUNET_DATASTORE_get_key (datastore, crc->offset++, &crc->key,
216 get_type (crc->i), 1, 1, TIMEOUT, &check_value, 224 get_type (crc->i), 1, 1,
225 &check_value,
217 crc); 226 crc);
218 break; 227 break;
219 case RP_GET_FAIL: 228 case RP_GET_FAIL:
@@ -221,7 +230,8 @@ run_continuation (void *cls)
221 crc->i); 230 crc->i);
222 GNUNET_CRYPTO_hash (&crc->i, sizeof (int), &crc->key); 231 GNUNET_CRYPTO_hash (&crc->i, sizeof (int), &crc->key);
223 GNUNET_DATASTORE_get_key (datastore, crc->offset++, &crc->key, 232 GNUNET_DATASTORE_get_key (datastore, crc->offset++, &crc->key,
224 get_type (crc->i), 1, 1, TIMEOUT, &check_nothing, 233 get_type (crc->i), 1, 1,
234 &check_nothing,
225 crc); 235 crc);
226 break; 236 break;
227 case RP_DONE: 237 case RP_DONE:
@@ -266,11 +276,18 @@ run (void *cls,
266 now = GNUNET_TIME_absolute_get (); 276 now = GNUNET_TIME_absolute_get ();
267 datastore = GNUNET_DATASTORE_connect (cfg); 277 datastore = GNUNET_DATASTORE_connect (cfg);
268 if (NULL == 278 if (NULL ==
269 GNUNET_DATASTORE_put (datastore, 0, &zkey, 4, "TEST", 279 GNUNET_DATASTORE_put (datastore,
270 GNUNET_BLOCK_TYPE_TEST, 0, 0, 0, 280 0,
271 GNUNET_TIME_relative_to_absolute 281 &zkey,
272 (GNUNET_TIME_UNIT_SECONDS), 0, 1, 282 4,
273 GNUNET_TIME_UNIT_MINUTES, &run_tests, crc)) 283 "TEST",
284 GNUNET_BLOCK_TYPE_TEST,
285 0, 0, 0,
286 GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_SECONDS),
287 0,
288 1,
289 &run_tests,
290 crc))
274 { 291 {
275 FPRINTF (stderr, "%s", "Test 'put' operation failed.\n"); 292 FPRINTF (stderr, "%s", "Test 'put' operation failed.\n");
276 GNUNET_free (crc); 293 GNUNET_free (crc);