diff options
author | Christian Grothoff <christian@grothoff.org> | 2022-11-27 21:43:55 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2022-11-27 21:43:55 +0100 |
commit | c86c92200c331f0099ab95edd35b9f73c177b72b (patch) | |
tree | 0132917d3f18c12d6517b5edb4d166468739c989 /src/exchangedb/test_exchangedb_by_j.c | |
parent | cf2e37cd876651e799893e8fe5babb51a9e12dd7 (diff) | |
download | exchange-c86c92200c331f0099ab95edd35b9f73c177b72b.tar.xz |
-db tests pass again
Diffstat (limited to 'src/exchangedb/test_exchangedb_by_j.c')
-rw-r--r-- | src/exchangedb/test_exchangedb_by_j.c | 58 |
1 files changed, 26 insertions, 32 deletions
diff --git a/src/exchangedb/test_exchangedb_by_j.c b/src/exchangedb/test_exchangedb_by_j.c index b2f6ddeb5..43f471671 100644 --- a/src/exchangedb/test_exchangedb_by_j.c +++ b/src/exchangedb/test_exchangedb_by_j.c @@ -33,7 +33,7 @@ static int result; */ #define FAILIF(cond) \ do { \ - if (! (cond)) {break;} \ + if (! (cond)) {break;} \ GNUNET_break (0); \ goto drop; \ } while (0) @@ -83,21 +83,14 @@ run (void *cls) } (void) plugin->drop_tables (plugin->cls); if (GNUNET_OK != - plugin->create_tables (plugin->cls)) + plugin->create_tables (plugin->cls, + true, + num_partitions)) { GNUNET_break (0); result = 77; goto cleanup; } - if (GNUNET_OK != - plugin->setup_partitions (plugin->cls, - num_partitions)) - { - GNUNET_break (0); - result = 77; - goto cleanup; - } - for (unsigned int i = 0; i< 7; i++) { static unsigned int batches[] = {1, 1, 2, 4, 16, 64, 256}; @@ -114,28 +107,28 @@ run (void *cls) &value)); now = GNUNET_TIME_absolute_get (); ts = GNUNET_TIME_timestamp_get (); - for (unsigned int r=0;r<10;r++) + for (unsigned int r = 0; r<10; r++) { - plugin->start_read_committed (plugin->cls, - "test_by_j"); - - for (unsigned int k = 0; k<batch_size; k++) - { - RND_BLK (&reserves[k].reserve_pub); - reserves[k].balance = value; - reserves[k].execution_time = ts; - reserves[k].sender_account_details = sndr; - reserves[k].exchange_account_name = "name"; - reserves[k].wire_reference = k; - - } - FAILIF (batch_size != - plugin->batch_reserves_in_insert (plugin->cls, - reserves, - batch_size, - results)); - - plugin->commit (plugin->cls); + plugin->start_read_committed (plugin->cls, + "test_by_j"); + + for (unsigned int k = 0; k<batch_size; k++) + { + RND_BLK (&reserves[k].reserve_pub); + reserves[k].balance = value; + reserves[k].execution_time = ts; + reserves[k].sender_account_details = sndr; + reserves[k].exchange_account_name = "name"; + reserves[k].wire_reference = k; + + } + FAILIF (batch_size != + plugin->batch_reserves_in_insert (plugin->cls, + reserves, + batch_size, + results)); + + plugin->commit (plugin->cls); } duration = GNUNET_TIME_absolute_get_duration (now); fprintf (stdout, @@ -201,4 +194,5 @@ main (int argc, return result; } + /* end of test_exchangedb_by_j.c */ |