diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-04-04 14:04:46 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-04-04 14:04:46 +0000 |
commit | ae64def363d4eeeaf8acfe586f00ae962da479fb (patch) | |
tree | 848d9e9eb579c17d9eef231e4caccc30b42c07f3 /src/datastore/test_datastore_api.c | |
parent | 0faff46cb3a4cc085ea2876eb6cdccfc59cb2bbe (diff) | |
download | gnunet-ae64def363d4eeeaf8acfe586f00ae962da479fb.tar.gz gnunet-ae64def363d4eeeaf8acfe586f00ae962da479fb.zip |
sqlite clean up
Diffstat (limited to 'src/datastore/test_datastore_api.c')
-rw-r--r-- | src/datastore/test_datastore_api.c | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/src/datastore/test_datastore_api.c b/src/datastore/test_datastore_api.c index 6280907ad..2cca1da69 100644 --- a/src/datastore/test_datastore_api.c +++ b/src/datastore/test_datastore_api.c | |||
@@ -188,6 +188,7 @@ check_value (void *cls, | |||
188 | struct GNUNET_TIME_Absolute | 188 | struct GNUNET_TIME_Absolute |
189 | expiration, uint64_t uid) | 189 | expiration, uint64_t uid) |
190 | { | 190 | { |
191 | static int matched; | ||
191 | struct CpsRunContext *crc = cls; | 192 | struct CpsRunContext *crc = cls; |
192 | int i; | 193 | int i; |
193 | 194 | ||
@@ -198,6 +199,8 @@ check_value (void *cls, | |||
198 | crc->phase = RP_DEL; | 199 | crc->phase = RP_DEL; |
199 | crc->i = ITERATIONS; | 200 | crc->i = ITERATIONS; |
200 | } | 201 | } |
202 | GNUNET_assert (matched == GNUNET_YES); | ||
203 | matched = GNUNET_NO; | ||
201 | GNUNET_SCHEDULER_add_continuation (&run_continuation, | 204 | GNUNET_SCHEDULER_add_continuation (&run_continuation, |
202 | crc, | 205 | crc, |
203 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); | 206 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); |
@@ -210,6 +213,7 @@ check_value (void *cls, | |||
210 | GNUNET_assert (priority == get_priority (i)); | 213 | GNUNET_assert (priority == get_priority (i)); |
211 | GNUNET_assert (anonymity == get_anonymity(i)); | 214 | GNUNET_assert (anonymity == get_anonymity(i)); |
212 | GNUNET_assert (expiration.abs_value == get_expiration(i).abs_value); | 215 | GNUNET_assert (expiration.abs_value == get_expiration(i).abs_value); |
216 | matched = GNUNET_YES; | ||
213 | GNUNET_DATASTORE_iterate_get_next (datastore); | 217 | GNUNET_DATASTORE_iterate_get_next (datastore); |
214 | } | 218 | } |
215 | 219 | ||
@@ -579,22 +583,32 @@ run_continuation (void *cls, | |||
579 | 583 | ||
580 | static void | 584 | static void |
581 | run_tests (void *cls, | 585 | run_tests (void *cls, |
582 | int success, | 586 | int32_t success, |
583 | const char *msg) | 587 | const char *msg) |
584 | { | 588 | { |
585 | struct CpsRunContext *crc = cls; | 589 | struct CpsRunContext *crc = cls; |
586 | 590 | ||
587 | if (success != GNUNET_YES) | 591 | switch (success) |
588 | { | 592 | { |
593 | case GNUNET_YES: | ||
594 | GNUNET_SCHEDULER_add_continuation (&run_continuation, | ||
595 | crc, | ||
596 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); | ||
597 | return; | ||
598 | case GNUNET_NO: | ||
599 | fprintf (stderr, | ||
600 | "Test 'put' operation failed, key already exists (!?)\n"); | ||
601 | GNUNET_free (crc); | ||
602 | return; | ||
603 | case GNUNET_SYSERR: | ||
589 | fprintf (stderr, | 604 | fprintf (stderr, |
590 | "Test 'put' operation failed with error `%s' database likely not setup, skipping test.", | 605 | "Test 'put' operation failed with error `%s' database likely not setup, skipping test.\n", |
591 | msg); | 606 | msg); |
592 | GNUNET_free (crc); | 607 | GNUNET_free (crc); |
593 | return; | 608 | return; |
609 | default: | ||
610 | GNUNET_assert (0); | ||
594 | } | 611 | } |
595 | GNUNET_SCHEDULER_add_continuation (&run_continuation, | ||
596 | crc, | ||
597 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); | ||
598 | } | 612 | } |
599 | 613 | ||
600 | 614 | ||