diff options
author | Christian Grothoff <christian@grothoff.org> | 2020-02-11 15:40:37 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2020-02-11 15:40:37 +0100 |
commit | 3ad698d01865c9f1b5c5aadc2f4d8b0a3658b81c (patch) | |
tree | 671de5acc0a13cafe636bf1e220496a5882a8b74 /src/testing/test_taler_exchange_aggregator.c | |
parent | de0d987e34d426f6ed3593840078442191255587 (diff) | |
parent | cdaf1ce69b5fb56f09bbdc00942b03f039710614 (diff) | |
download | exchange-3ad698d01865c9f1b5c5aadc2f4d8b0a3658b81c.tar.xz |
merging
Diffstat (limited to 'src/testing/test_taler_exchange_aggregator.c')
-rw-r--r-- | src/testing/test_taler_exchange_aggregator.c | 78 |
1 files changed, 42 insertions, 36 deletions
diff --git a/src/testing/test_taler_exchange_aggregator.c b/src/testing/test_taler_exchange_aggregator.c index c709e5fe9..2e8a35ce2 100644 --- a/src/testing/test_taler_exchange_aggregator.c +++ b/src/testing/test_taler_exchange_aggregator.c @@ -57,36 +57,6 @@ static char *config_filename; #define USER42_ACCOUNT "42" -/** - * @return GNUNET_NO if database could not be prepared, - * otherwise GNUNET_OK - */ -static int -prepare_database (void *cls, - const struct GNUNET_CONFIGURATION_Handle *cfg) -{ - dbc.plugin = TALER_EXCHANGEDB_plugin_load (cfg); - if (NULL == dbc.plugin) - { - GNUNET_break (0); - result = 77; - return GNUNET_NO; - } - if (GNUNET_OK != - dbc.plugin->create_tables (dbc.plugin->cls)) - { - GNUNET_break (0); - TALER_EXCHANGEDB_plugin_unload (dbc.plugin); - dbc.plugin = NULL; - result = 77; - return GNUNET_NO; - } - dbc.session = dbc.plugin->get_session (dbc.plugin->cls); - GNUNET_assert (NULL != dbc.session); - - return GNUNET_OK; -} - /** * Collects all the tests. @@ -454,6 +424,48 @@ run (void *cls, } +/** + * Prepare database an launch the test. + * + * @param cls unused + * @param cfg our configuration + * @return #GNUNET_NO if database could not be prepared, + * otherwise #GNUNET_OK + */ +static int +prepare_database (void *cls, + const struct GNUNET_CONFIGURATION_Handle *cfg) +{ + dbc.plugin = TALER_EXCHANGEDB_plugin_load (cfg); + if (NULL == dbc.plugin) + { + GNUNET_break (0); + result = 77; + return GNUNET_NO; + } + if (GNUNET_OK != + dbc.plugin->create_tables (dbc.plugin->cls)) + { + GNUNET_break (0); + TALER_EXCHANGEDB_plugin_unload (dbc.plugin); + dbc.plugin = NULL; + result = 77; + return GNUNET_NO; + } + dbc.session = dbc.plugin->get_session (dbc.plugin->cls); + GNUNET_assert (NULL != dbc.session); + + result = TALER_TESTING_setup (&run, + NULL, + cfg, + NULL, // no exchange process handle. + GNUNET_NO); // do not try to connect to the exchange + + + return GNUNET_OK; +} + + int main (int argc, char *const argv[]) @@ -507,12 +519,6 @@ main (int argc, return result; } - result = TALER_TESTING_setup (&run, - NULL, - config_filename, - NULL, // no exchange process handle. - GNUNET_NO); // do not try to connect to the exchange - GNUNET_free (config_filename); GNUNET_free (testname); dbc.plugin->drop_tables (dbc.plugin->cls); |