From d20d3b256252729570e953d4d271108e17655a44 Mon Sep 17 00:00:00 2001 From: Sree Harsha Totakura Date: Fri, 10 Apr 2015 14:04:01 +0200 Subject: [PATCH] mintdb: test (create/get)_refresh_session --- src/mintdb/test_mintdb.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/mintdb/test_mintdb.c b/src/mintdb/test_mintdb.c index 99eb9b78c..9d9e1efa9 100644 --- a/src/mintdb/test_mintdb.c +++ b/src/mintdb/test_mintdb.c @@ -325,6 +325,28 @@ run (void *cls, plugin->have_deposit (plugin->cls, session, &deposit2)); + /* Tests for refreshing */ + { + struct TALER_MINTDB_RefreshSession refresh_session; + struct TALER_MINTDB_RefreshSession ret_refresh_session; + struct GNUNET_HashCode session_hash; + RND_BLK (&refresh_session); + RND_BLK (&session_hash); + refresh_session.num_oldcoins = UINT16_MAX; + refresh_session.num_newcoins = 1; + refresh_session.noreveal_index = 1; + FAILIF (GNUNET_OK != plugin->create_refresh_session (plugin->cls, + session, + &session_hash, + &refresh_session)); + FAILIF (GNUNET_OK != plugin->get_refresh_session (plugin->cls, + session, + &session_hash, + &ret_refresh_session)); + FAILIF (0 != memcmp (&ret_refresh_session, + &refresh_session, + sizeof (refresh_session))); + } result = 0; drop: