diff options
author | Christian Grothoff <christian@grothoff.org> | 2017-05-08 13:31:28 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2017-05-08 13:31:28 +0200 |
commit | 8f854fb04c02f2e10ab41be3140bdf9aa05e0a83 (patch) | |
tree | 08802e0ea0dc5648b5ac7d668cae7286b393b33b /src/exchangedb/test_exchangedb.c | |
parent | 20aad54c3e010020185c76d9e0727f3f497c2f73 (diff) | |
download | exchange-8f854fb04c02f2e10ab41be3140bdf9aa05e0a83.tar.xz |
add 'get_latest_reserve_in_reference' to exchangedb API
Diffstat (limited to 'src/exchangedb/test_exchangedb.c')
-rw-r--r-- | src/exchangedb/test_exchangedb.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/exchangedb/test_exchangedb.c b/src/exchangedb/test_exchangedb.c index 9b399233b..f5358ff0a 100644 --- a/src/exchangedb/test_exchangedb.c +++ b/src/exchangedb/test_exchangedb.c @@ -1445,6 +1445,8 @@ run (void *cls) \"r\":123456789, \ \"address\": \"foobar\"}"; unsigned int cnt; + void *rr; + size_t rr_size; dkp = NULL; rh = NULL; @@ -1503,6 +1505,11 @@ run (void *cls) result = 4; sndr = json_loads ("{ \"account\":\"1\" }", 0, NULL); GNUNET_assert (NULL != sndr); + FAILIF (GNUNET_NO != + plugin->get_latest_reserve_in_reference (plugin->cls, + session, + &rr, + &rr_size)); FAILIF (GNUNET_OK != plugin->reserves_in_insert (plugin->cls, session, @@ -1513,6 +1520,14 @@ run (void *cls) "TEST", 4)); FAILIF (GNUNET_OK != + plugin->get_latest_reserve_in_reference (plugin->cls, + session, + &rr, + &rr_size)); + FAILIF (4 != rr_size); + FAILIF (0 != memcmp ("TEST", rr, 4)); + GNUNET_free (rr); + FAILIF (GNUNET_OK != check_reserve (session, &reserve_pub, value.value, @@ -1527,6 +1542,19 @@ run (void *cls) sndr, "TEST2", 5)); + FAILIF (GNUNET_OK != + plugin->get_latest_reserve_in_reference (plugin->cls, + session, + &rr, + &rr_size)); + FAILIF (GNUNET_OK != + plugin->get_latest_reserve_in_reference (plugin->cls, + session, + &rr, + &rr_size)); + FAILIF (5 != rr_size); + FAILIF (0 != memcmp ("TEST2", rr, 5)); + GNUNET_free (rr); json_decref (sndr); FAILIF (GNUNET_OK != check_reserve (session, |