summaryrefslogtreecommitdiff
path: root/src/datastore/test_datastore_api.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/datastore/test_datastore_api.c')
-rw-r--r--src/datastore/test_datastore_api.c48
1 files changed, 1 insertions, 47 deletions
diff --git a/src/datastore/test_datastore_api.c b/src/datastore/test_datastore_api.c
index 9f89d4087..a99668240 100644
--- a/src/datastore/test_datastore_api.c
+++ b/src/datastore/test_datastore_api.c
@@ -130,8 +130,6 @@ enum RunPhase
130 RP_PUT_MULTIPLE_NEXT = 8, 130 RP_PUT_MULTIPLE_NEXT = 8,
131 RP_GET_MULTIPLE = 9, 131 RP_GET_MULTIPLE = 9,
132 RP_GET_MULTIPLE_NEXT = 10, 132 RP_GET_MULTIPLE_NEXT = 10,
133 RP_UPDATE = 11,
134 RP_UPDATE_VALIDATE = 12,
135 133
136 /** 134 /**
137 * Execution failed with some kind of error. 135 * Execution failed with some kind of error.
@@ -349,7 +347,7 @@ check_multiple (void *cls,
349 break; 347 break;
350 case RP_GET_MULTIPLE_NEXT: 348 case RP_GET_MULTIPLE_NEXT:
351 GNUNET_assert (uid != crc->first_uid); 349 GNUNET_assert (uid != crc->first_uid);
352 crc->phase = RP_UPDATE; 350 crc->phase = RP_DONE;
353 break; 351 break;
354 default: 352 default:
355 GNUNET_break (0); 353 GNUNET_break (0);
@@ -362,32 +360,6 @@ check_multiple (void *cls,
362} 360}
363 361
364 362
365static void
366check_update (void *cls,
367 const struct GNUNET_HashCode *key,
368 size_t size,
369 const void *data,
370 enum GNUNET_BLOCK_Type type,
371 uint32_t priority,
372 uint32_t anonymity,
373 struct GNUNET_TIME_Absolute expiration,
374 uint64_t uid)
375{
376 struct CpsRunContext *crc = cls;
377
378 GNUNET_assert (key != NULL);
379 if ((anonymity == get_anonymity (42)) && (size == get_size (42)) &&
380 (priority == get_priority (42) + 100))
381 crc->phase = RP_DONE;
382 else
383 {
384 GNUNET_assert (size == get_size (43));
385 crc->offset++;
386 }
387 GNUNET_SCHEDULER_add_now (&run_continuation, crc);
388}
389
390
391/** 363/**
392 * Main state machine. Executes the next step of the test 364 * Main state machine. Executes the next step of the test
393 * depending on the current state. 365 * depending on the current state.
@@ -525,24 +497,6 @@ run_continuation (void *cls)
525 1, 1, 497 1, 1,
526 &check_multiple, crc)); 498 &check_multiple, crc));
527 break; 499 break;
528 case RP_UPDATE:
529 GNUNET_assert (crc->uid > 0);
530 crc->phase = RP_UPDATE_VALIDATE;
531 GNUNET_DATASTORE_update (datastore,
532 crc->uid, 100,
533 get_expiration (42), 1,
534 1,
535 &check_success, crc);
536 break;
537 case RP_UPDATE_VALIDATE:
538 GNUNET_assert (NULL !=
539 GNUNET_DATASTORE_get_key (datastore,
540 crc->offset,
541 &crc->key,
542 get_type (42),
543 1, 1,
544 &check_update, crc));
545 break;
546 case RP_DONE: 500 case RP_DONE:
547 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 501 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
548 "Finished, disconnecting\n"); 502 "Finished, disconnecting\n");