commit 960dcacf25e51cc2bff359ea1fc86cdd3d9e6083
parent 7235973381c07f76abe66b2d49cedf545e0f92ff
Author: Christian Grothoff <christian@grothoff.org>
Date: Mon, 11 Jul 2022 18:31:51 +0200
-test exchange and payto uri as well
Diffstat:
2 files changed, 20 insertions(+), 7 deletions(-)
diff --git a/src/backenddb/test_merchantdb.c b/src/backenddb/test_merchantdb.c
@@ -2483,7 +2483,7 @@ make_deposit (const struct InstanceData *instance,
GNUNET_CRYPTO_eddsa_key_create (&coin_priv.eddsa_priv);
GNUNET_CRYPTO_eddsa_key_get_public (&coin_priv.eddsa_priv,
&deposit->coin_pub.eddsa_pub);
- deposit->exchange_url = "test-exchange";
+ deposit->exchange_url = "https://test-exchange/";
GNUNET_assert (GNUNET_OK ==
TALER_string_to_amount ("EUR:50.00",
&deposit->amount_with_fee));
@@ -4528,6 +4528,7 @@ lookup_reserve_cb (void *cls,
{
struct TestLookupReserve_Closure *cmp = cls;
unsigned int tip_cmp_results[tips_length];
+
if (NULL == cmp)
return;
if (GNUNET_TIME_timestamp_cmp (cmp->reserve_to_cmp->expiration,
@@ -4544,8 +4545,23 @@ lookup_reserve_cb (void *cls,
cmp->result_matches = 1;
return;
}
- /* FIXME: What about ‘exchange_url’ and ‘payto_uri’? --ttn */
- memset (tip_cmp_results, 0, sizeof (unsigned int) * tips_length);
+ if (0 != strcmp (exchange_url,
+ "https://exch-url/"))
+ {
+ GNUNET_break (0);
+ cmp->result_matches = 0;
+ return;
+ }
+ if (0 != strcmp (payto_uri,
+ "payto://other-uri"))
+ {
+ GNUNET_break (0);
+ cmp->result_matches = 0;
+ return;
+ }
+ memset (tip_cmp_results,
+ 0,
+ sizeof (tip_cmp_results));
for (unsigned int i = 0; tips_length > i; ++i)
{
for (unsigned int j = 0; tips_length > j; ++j)
@@ -5377,7 +5393,7 @@ pre_test_tips (struct TestTips_Closure *cls)
GNUNET_assert (GNUNET_OK ==
TALER_string_to_amount ("EUR:99.99",
&cls->reserve.initial_amount));
- cls->reserve.exchange_url = "exch-url";
+ cls->reserve.exchange_url = "https://exch-url/";
cls->reserve.payto_uri = "payto://other-uri";
cls->reserve.expiration = GNUNET_TIME_relative_to_timestamp (
GNUNET_TIME_UNIT_WEEKS);
diff --git a/src/testing/testing_api_cmd_wallet_get_tip.c b/src/testing/testing_api_cmd_wallet_get_tip.c
@@ -89,7 +89,6 @@ wallet_tip_get_cb (void *cls,
const char *exchange_url,
const struct TALER_Amount *amount_remaining)
{
- /* FIXME, deeper checks should be implemented here. */
struct WalletTipGetState *gts = cls;
const struct TALER_TESTING_Command *tip_cmd;
@@ -111,8 +110,6 @@ wallet_tip_get_cb (void *cls,
switch (hr->http_status)
{
case MHD_HTTP_OK:
- // FIXME: use gts->tip_reference here to
- // check if the data returned matches that from the POST / PATCH
if (gts->cmp_amounts)
{
if ((GNUNET_OK != TALER_amount_cmp_currency (>s->amount_remaining,