diff options
Diffstat (limited to 'src/datastore/test_datastore_api.c')
-rw-r--r-- | src/datastore/test_datastore_api.c | 43 |
1 files changed, 26 insertions, 17 deletions
diff --git a/src/datastore/test_datastore_api.c b/src/datastore/test_datastore_api.c index a99668240..0da68b266 100644 --- a/src/datastore/test_datastore_api.c +++ b/src/datastore/test_datastore_api.c | |||
@@ -156,8 +156,6 @@ struct CpsRunContext | |||
156 | void *data; | 156 | void *data; |
157 | size_t size; | 157 | size_t size; |
158 | 158 | ||
159 | uint64_t uid; | ||
160 | uint64_t offset; | ||
161 | uint64_t first_uid; | 159 | uint64_t first_uid; |
162 | }; | 160 | }; |
163 | 161 | ||
@@ -267,7 +265,6 @@ check_value (void *cls, | |||
267 | GNUNET_assert (priority == get_priority (i)); | 265 | GNUNET_assert (priority == get_priority (i)); |
268 | GNUNET_assert (anonymity == get_anonymity (i)); | 266 | GNUNET_assert (anonymity == get_anonymity (i)); |
269 | GNUNET_assert (expiration.abs_value_us == get_expiration (i).abs_value_us); | 267 | GNUNET_assert (expiration.abs_value_us == get_expiration (i).abs_value_us); |
270 | crc->offset++; | ||
271 | if (crc->i == 0) | 268 | if (crc->i == 0) |
272 | { | 269 | { |
273 | crc->phase = RP_DEL; | 270 | crc->phase = RP_DEL; |
@@ -343,7 +340,6 @@ check_multiple (void *cls, | |||
343 | case RP_GET_MULTIPLE: | 340 | case RP_GET_MULTIPLE: |
344 | crc->phase = RP_GET_MULTIPLE_NEXT; | 341 | crc->phase = RP_GET_MULTIPLE_NEXT; |
345 | crc->first_uid = uid; | 342 | crc->first_uid = uid; |
346 | crc->offset++; | ||
347 | break; | 343 | break; |
348 | case RP_GET_MULTIPLE_NEXT: | 344 | case RP_GET_MULTIPLE_NEXT: |
349 | GNUNET_assert (uid != crc->first_uid); | 345 | GNUNET_assert (uid != crc->first_uid); |
@@ -354,8 +350,6 @@ check_multiple (void *cls, | |||
354 | crc->phase = RP_ERROR; | 350 | crc->phase = RP_ERROR; |
355 | break; | 351 | break; |
356 | } | 352 | } |
357 | if (priority == get_priority (42)) | ||
358 | crc->uid = uid; | ||
359 | GNUNET_SCHEDULER_add_now (&run_continuation, crc); | 353 | GNUNET_SCHEDULER_add_now (&run_continuation, crc); |
360 | } | 354 | } |
361 | 355 | ||
@@ -400,7 +394,8 @@ run_continuation (void *cls) | |||
400 | sizeof (int), | 394 | sizeof (int), |
401 | &crc->key); | 395 | &crc->key); |
402 | GNUNET_DATASTORE_get_key (datastore, | 396 | GNUNET_DATASTORE_get_key (datastore, |
403 | crc->offset, | 397 | 0, |
398 | false, | ||
404 | &crc->key, | 399 | &crc->key, |
405 | get_type (crc->i), | 400 | get_type (crc->i), |
406 | 1, | 401 | 1, |
@@ -417,7 +412,8 @@ run_continuation (void *cls) | |||
417 | GNUNET_CRYPTO_hash (&crc->i, sizeof (int), &crc->key); | 412 | GNUNET_CRYPTO_hash (&crc->i, sizeof (int), &crc->key); |
418 | GNUNET_assert (NULL != | 413 | GNUNET_assert (NULL != |
419 | GNUNET_DATASTORE_get_key (datastore, | 414 | GNUNET_DATASTORE_get_key (datastore, |
420 | crc->offset, | 415 | 0, |
416 | false, | ||
421 | &crc->key, | 417 | &crc->key, |
422 | get_type (crc->i), | 418 | get_type (crc->i), |
423 | 1, | 419 | 1, |
@@ -450,9 +446,15 @@ run_continuation (void *cls) | |||
450 | crc->i); | 446 | crc->i); |
451 | GNUNET_CRYPTO_hash (&crc->i, sizeof (int), &crc->key); | 447 | GNUNET_CRYPTO_hash (&crc->i, sizeof (int), &crc->key); |
452 | GNUNET_assert (NULL != | 448 | GNUNET_assert (NULL != |
453 | GNUNET_DATASTORE_get_key (datastore, crc->offset, &crc->key, | 449 | GNUNET_DATASTORE_get_key (datastore, |
454 | get_type (crc->i), 1, 1, | 450 | 0, |
455 | &check_nothing, crc)); | 451 | false, |
452 | &crc->key, | ||
453 | get_type (crc->i), | ||
454 | 1, | ||
455 | 1, | ||
456 | &check_nothing, | ||
457 | crc)); | ||
456 | break; | 458 | break; |
457 | case RP_RESERVE: | 459 | case RP_RESERVE: |
458 | crc->phase = RP_PUT_MULTIPLE; | 460 | crc->phase = RP_PUT_MULTIPLE; |
@@ -483,19 +485,26 @@ run_continuation (void *cls) | |||
483 | case RP_GET_MULTIPLE: | 485 | case RP_GET_MULTIPLE: |
484 | GNUNET_assert (NULL != | 486 | GNUNET_assert (NULL != |
485 | GNUNET_DATASTORE_get_key (datastore, | 487 | GNUNET_DATASTORE_get_key (datastore, |
486 | crc->offset, | 488 | 0, |
489 | false, | ||
487 | &crc->key, | 490 | &crc->key, |
488 | get_type (42), 1, 1, | 491 | get_type (42), |
489 | &check_multiple, crc)); | 492 | 1, |
493 | 1, | ||
494 | &check_multiple, | ||
495 | crc)); | ||
490 | break; | 496 | break; |
491 | case RP_GET_MULTIPLE_NEXT: | 497 | case RP_GET_MULTIPLE_NEXT: |
492 | GNUNET_assert (NULL != | 498 | GNUNET_assert (NULL != |
493 | GNUNET_DATASTORE_get_key (datastore, | 499 | GNUNET_DATASTORE_get_key (datastore, |
494 | crc->offset, | 500 | crc->first_uid + 1, |
501 | false, | ||
495 | &crc->key, | 502 | &crc->key, |
496 | get_type (42), | 503 | get_type (42), |
497 | 1, 1, | 504 | 1, |
498 | &check_multiple, crc)); | 505 | 1, |
506 | &check_multiple, | ||
507 | crc)); | ||
499 | break; | 508 | break; |
500 | case RP_DONE: | 509 | case RP_DONE: |
501 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 510 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |