diff options
Diffstat (limited to 'src/exchangedb/test_exchangedb.c')
-rw-r--r-- | src/exchangedb/test_exchangedb.c | 35 |
1 files changed, 23 insertions, 12 deletions
diff --git a/src/exchangedb/test_exchangedb.c b/src/exchangedb/test_exchangedb.c index 3bb9b9f2c..2ef7f5d72 100644 --- a/src/exchangedb/test_exchangedb.c +++ b/src/exchangedb/test_exchangedb.c @@ -137,7 +137,7 @@ create_denom_key_pair (unsigned int size, dki.issue.properties.expire_withdraw = GNUNET_TIME_absolute_hton (GNUNET_TIME_absolute_add (GNUNET_TIME_absolute_get (), GNUNET_TIME_UNIT_HOURS)); - dki.issue.properties.expire_spend = GNUNET_TIME_absolute_hton + dki.issue.properties.expire_deposit = GNUNET_TIME_absolute_hton (GNUNET_TIME_absolute_add (GNUNET_TIME_absolute_get (), GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_HOURS, 2))); @@ -172,9 +172,10 @@ static struct TALER_Amount fee_refresh; static struct TALER_Amount fee_refund; static struct TALER_Amount amount_with_fee; + static void -free_refresh_commit_coins_array(struct TALER_EXCHANGEDB_RefreshCommitCoin *commit_coins, - unsigned int size) +free_refresh_commit_coins_array (struct TALER_EXCHANGEDB_RefreshCommitCoin *commit_coins, + unsigned int size) { unsigned int cnt; struct TALER_EXCHANGEDB_RefreshCommitCoin *ccoin; @@ -282,6 +283,7 @@ test_refresh_commit_coins (struct TALER_EXCHANGEDB_Session *session, return ret; } + /** * Function to test melting of coins as part of a refresh session * @@ -658,21 +660,30 @@ run (void *cls) if (NULL == (plugin = TALER_EXCHANGEDB_plugin_load (cfg))) { - result = 1; + result = 77; return; } + if (NULL != + (session = plugin->get_session (plugin->cls))) + { + if (GNUNET_OK != + plugin->drop_tables (plugin->cls, + session)) + { + result = 77; + goto drop; + } + } if (GNUNET_OK != - plugin->create_tables (plugin->cls, - GNUNET_YES)) + plugin->create_tables (plugin->cls)) { - result = 2; + result = 77; goto drop; } if (NULL == - (session = plugin->get_session (plugin->cls, - GNUNET_YES))) + (session = plugin->get_session (plugin->cls))) { - result = 3; + result = 77; goto drop; } RND_BLK (&reserve_pub); @@ -932,8 +943,8 @@ run (void *cls) rh = NULL; if (NULL != session) GNUNET_break (GNUNET_OK == - plugin->drop_temporary (plugin->cls, - session)); + plugin->drop_tables (plugin->cls, + session)); if (NULL != dkp) destroy_denom_key_pair (dkp); if (NULL != cbc.sig.rsa_signature) |