diff options
author | Christian Grothoff <christian@grothoff.org> | 2017-11-01 16:01:59 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2017-11-01 16:01:59 +0100 |
commit | 78e7999e02844c13644f79ff7ef250c0de844771 (patch) | |
tree | 40862242c28c83b9479f6c107904ba19b9f39793 /src/backenddb/test_merchantdb.c | |
parent | 3f1cb92782e404d907e4337393d92d8157acd4e7 (diff) | |
download | merchant-78e7999e02844c13644f79ff7ef250c0de844771.tar.gz merchant-78e7999e02844c13644f79ff7ef250c0de844771.tar.bz2 merchant-78e7999e02844c13644f79ff7ef250c0de844771.zip |
towards implementing /tip-pickup (incomplete)
Diffstat (limited to 'src/backenddb/test_merchantdb.c')
-rw-r--r-- | src/backenddb/test_merchantdb.c | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/src/backenddb/test_merchantdb.c b/src/backenddb/test_merchantdb.c index 05db7c2b..78e72e31 100644 --- a/src/backenddb/test_merchantdb.c +++ b/src/backenddb/test_merchantdb.c @@ -528,20 +528,21 @@ test_tipping () struct TALER_Amount total; struct TALER_Amount amount; struct TALER_Amount inc; + char *uri; RND_BLK (&tip_reserve_priv); - if (TALER_EC_TIP_AUTHORIZE_RESERVE_UNKNOWN != + if (TALER_EC_TIP_AUTHORIZE_RESERVE_NOT_ENABLED != plugin->authorize_tip (plugin->cls, "testing tips reserve unknown", &amount, &tip_reserve_priv, + "http://localhost:8081/", &tip_expiration, &tip_id)) { GNUNET_break (0); return GNUNET_SYSERR; } - RND_BLK (&tip_credit_uuid); GNUNET_assert (GNUNET_OK == TALER_string_to_amount (CURRENCY ":5", @@ -578,6 +579,7 @@ test_tipping () "testing tips too late", &amount, &tip_reserve_priv, + "http://localhost:8081/", &tip_expiration, &tip_id)) { @@ -623,6 +625,7 @@ test_tipping () "testing tips", &amount, &tip_reserve_priv, + "http://localhost:8081/", &tip_expiration, &tip_id)) { @@ -634,11 +637,28 @@ test_tipping () GNUNET_break (0); return GNUNET_SYSERR; } + if (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT != + plugin->lookup_exchange_by_tip (plugin->cls, + &tip_id, + &uri)) + { + GNUNET_break (0); + return GNUNET_SYSERR; + } + if (0 != strcmp ("http://localhost:8081/", + uri)) + { + GNUNET_free (uri); + GNUNET_break (0); + return GNUNET_SYSERR; + } + GNUNET_free (uri); if (TALER_EC_NONE != plugin->authorize_tip (plugin->cls, "testing tips more", &amount, &tip_reserve_priv, + "http://localhost:8081/", &tip_expiration, &tip_id)) { @@ -711,6 +731,7 @@ test_tipping () "testing tips insufficient funds", &amount, &tip_reserve_priv, + "http://localhost:8081/", &tip_expiration, &tip_id)) { |