From 068dbf020b1f762d4364ca378c1396d16fa6eb1a Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sun, 8 May 2016 16:07:17 +0200 Subject: reorg testcase a bit --- src/exchangedb/test_exchangedb.c | 58 +++++++++++++++++++++++++++++++++------- 1 file changed, 48 insertions(+), 10 deletions(-) (limited to 'src/exchangedb/test_exchangedb.c') diff --git a/src/exchangedb/test_exchangedb.c b/src/exchangedb/test_exchangedb.c index 974290ee3..2feeb5247 100644 --- a/src/exchangedb/test_exchangedb.c +++ b/src/exchangedb/test_exchangedb.c @@ -324,10 +324,12 @@ free_refresh_commit_coins_array (struct TALER_EXCHANGEDB_RefreshCommitCoin *comm #define MELT_NEW_COINS 5 /** + * Test APIs related to the "insert_refresh_commit_coins" function. * * @param session database sesison to use * @param refresh_session details about the refresh session to use * @param session_hash refresh melt session hash to use + * @return #GNUNET_OK on success */ static int test_refresh_commit_coins (struct TALER_EXCHANGEDB_Session *session, @@ -420,6 +422,32 @@ test_refresh_commit_coins (struct TALER_EXCHANGEDB_Session *session, } +/** + * Test APIs related to the "insert_refresh_commit_coins" function. + * + * @param session database sesison to use + * @param refresh_session details about the refresh session to use + * @param session_hash refresh melt session hash to use + * @return #GNUNET_OK on success + */ +static int +test_refresh_commit_links (struct TALER_EXCHANGEDB_Session *session, + const struct TALER_EXCHANGEDB_RefreshSession *refresh_session, + const struct GNUNET_HashCode *session_hash) +{ + /* + FIXME #4401: test: insert_refresh_commit_links + FIXME #4401: test: get_refresh_commit_links + + FIXME #4401: test: get_link_data_list + FIXME #4401: test: free_link_data_list + FIXME #4401: test: get_transfer + + */ + return GNUNET_OK; +} + + /** * Function to test melting of coins as part of a refresh session * @@ -440,6 +468,7 @@ test_melting (struct TALER_EXCHANGEDB_Session *session) struct TALER_EXCHANGEDB_RefreshMelt *melts; struct TALER_DenominationPublicKey *new_denom_pubs; struct TALER_DenominationPublicKey *ret_denom_pubs; + struct TALER_EXCHANGEDB_MeltCommitment *mc; unsigned int cnt; int ret; @@ -565,6 +594,25 @@ test_melting (struct TALER_EXCHANGEDB_Session *session) test_refresh_commit_coins (session, &refresh_session, &session_hash)); + FAILIF (GNUNET_OK != + test_refresh_commit_links (session, + &refresh_session, + &session_hash)); + + /* checking 'get_melt_commitment' API */ + mc = plugin->get_melt_commitment (plugin->cls, + session, + &session_hash); + FAILIF (NULL != mc); /* NOTE: this will change once + 'test_refresh_commit_links' is implemented properly */ +#if 0 + /* FIXME #4401: test: get_melt_commitment: + check detailed information contained in 'mc' */ + plugin->free_melt_commitment (plugin->cls, + mc); +#endif + + /* FIXME #4401: test: insert_refresh_out */ ret = GNUNET_OK; @@ -1179,16 +1227,6 @@ run (void *cls) FAILIF (GNUNET_OK != test_wire_prepare (session)); - /* FIXME #4401: test: insert_refresh_commit_links - FIXME #4401: test: get_refresh_commit_links - FIXME #4401: test: get_melt_commitment - FIXME #4401: test: free_melt_commitment - FIXME #4401: test: insert_refresh_out - FIXME #4401: test: get_link_data_list - FIXME #4401: test: free_link_data_list - FIXME #4401: test: get_transfer - */ - /* setup values for wire transfer aggregation data */ memset (&wtid, 42, sizeof (wtid)); memset (&merchant_pub_wt, 43, sizeof (merchant_pub_wt)); -- cgit v1.2.3