aboutsummaryrefslogtreecommitdiff
path: root/src/testing
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2022-10-12 22:16:40 +0200
committerChristian Grothoff <christian@grothoff.org>2022-10-12 22:16:40 +0200
commit4702b156dc8130a842745035c936de8817c7c700 (patch)
treef1c2d6c9013d2fa904c82b6cbc2b1effb9c6e16a /src/testing
parent3b34acdb72cd450974a3bbde6169f1bf9644a302 (diff)
downloadexchange-4702b156dc8130a842745035c936de8817c7c700.tar.xz
-work on reserve control tests
Diffstat (limited to 'src/testing')
-rw-r--r--src/testing/test_exchange_p2p.c14
-rw-r--r--src/testing/testing_api_cmd_reserve_open.c6
2 files changed, 12 insertions, 8 deletions
diff --git a/src/testing/test_exchange_p2p.c b/src/testing/test_exchange_p2p.c
index d0a0a9898..693391c6c 100644
--- a/src/testing/test_exchange_p2p.c
+++ b/src/testing/test_exchange_p2p.c
@@ -382,7 +382,7 @@ run (void *cls,
MHD_HTTP_PAYMENT_REQUIRED, // FIXME: or CONFLICT?
NULL,
NULL),
- TALER_TESTING_cmd_reserve_open ("reserve-open-101-ok",
+ TALER_TESTING_cmd_reserve_open ("reserve-open-101-ok-a",
"create-reserve-101",
"EUR:0.01",
GNUNET_TIME_UNIT_MONTHS,
@@ -394,30 +394,32 @@ run (void *cls,
"create-reserve-101",
"EUR:1.03",
MHD_HTTP_OK),
- TALER_TESTING_cmd_reserve_open ("reserve-open-101-ok",
+ TALER_TESTING_cmd_reserve_open ("reserve-open-101-ok-b",
"create-reserve-101",
"EUR:0",
GNUNET_TIME_UNIT_MONTHS,
2, /* min purses */
MHD_HTTP_OK,
"withdraw-coin-100",
- "EUR:0.02",
+ "EUR:0.03", /* 0.02 for the reserve open, 0.01 for deposit fee */
NULL,
NULL),
- /* FIXME: use purse quota here */
+ /* FIXME: use purse creation with purse quota here */
TALER_TESTING_cmd_reserve_get_attestable ("reserve-101-attestable",
"create-reserve-101",
- MHD_HTTP_OK,
+ MHD_HTTP_NOT_FOUND,
NULL),
TALER_TESTING_cmd_reserve_get_attestable ("reserve-101-attest",
"create-reserve-101",
- MHD_HTTP_CONFLICT,
+ MHD_HTTP_NOT_FOUND,
"nx-attribute-name",
NULL),
+#if 0
TALER_TESTING_cmd_reserve_close ("reserve-101-close",
"create-reserve-101",
NULL, /* to origin */
MHD_HTTP_OK),
+#endif
TALER_TESTING_cmd_end ()
};
diff --git a/src/testing/testing_api_cmd_reserve_open.c b/src/testing/testing_api_cmd_reserve_open.c
index 67209d02e..cc0e649d2 100644
--- a/src/testing/testing_api_cmd_reserve_open.c
+++ b/src/testing/testing_api_cmd_reserve_open.c
@@ -319,6 +319,7 @@ TALER_TESTING_cmd_reserve_open (const char *label,
ss->cpl++;
va_end (ap);
GNUNET_assert (0 == (ss->cpl % 2));
+ ss->cpl /= 2; /* name and amount per coin */
ss->cd = GNUNET_new_array (ss->cpl,
struct CoinDetail);
i = 0;
@@ -326,11 +327,12 @@ TALER_TESTING_cmd_reserve_open (const char *label,
expected_response_code);
while (NULL != (name = va_arg (ap, const char *)))
{
- ss->cd[i].name = name;
+ struct CoinDetail *cd = &ss->cd[i];
+ cd->name = name;
GNUNET_assert (GNUNET_OK ==
TALER_string_to_amount (va_arg (ap,
const char *),
- &ss->cd[i].amount));
+ &cd->amount));
i++;
}
va_end (ap);