From 4e0b5104382a1271261a24c4b97cb50f63aea976 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Thu, 13 Aug 2020 00:45:02 +0200 Subject: extend tests to discover corner cases from #6478, fix code to actually work for those cases --- src/testing/test_exchange_api.c | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) (limited to 'src/testing/test_exchange_api.c') diff --git a/src/testing/test_exchange_api.c b/src/testing/test_exchange_api.c index e410b1805..d30597b20 100644 --- a/src/testing/test_exchange_api.c +++ b/src/testing/test_exchange_api.c @@ -552,20 +552,35 @@ run (void *cls, * fakebank and the second to actually check there are not * other transfers around. */// TALER_TESTING_cmd_check_bank_empty ("check_bank_transfer-pre-refund"), - TALER_TESTING_cmd_refund ("refund-ok", - MHD_HTTP_OK, - "EUR:5", - "deposit-refund-1"), - TALER_TESTING_cmd_refund ("refund-ok-double", - MHD_HTTP_OK, - "EUR:5", - "deposit-refund-1"), + TALER_TESTING_cmd_refund_with_id ("refund-ok", + MHD_HTTP_OK, + "EUR:3", + "deposit-refund-1", + 3), + TALER_TESTING_cmd_refund_with_id ("refund-ok-double", + MHD_HTTP_OK, + "EUR:3", + "deposit-refund-1", + 3), /* Previous /refund(s) had id == 0. */ TALER_TESTING_cmd_refund_with_id ("refund-conflicting", MHD_HTTP_CONFLICT, "EUR:5", "deposit-refund-1", 1), + TALER_TESTING_cmd_deposit ("deposit-refund-insufficient-refund", + "withdraw-coin-r1", + 0, + bc.user42_payto, + "{\"items\":[{\"name\":\"ice cream\",\"value\":\"EUR:4\"}]}", + GNUNET_TIME_UNIT_MINUTES, + "EUR:4", + MHD_HTTP_CONFLICT), + TALER_TESTING_cmd_refund_with_id ("refund-ok-increase", + MHD_HTTP_OK, + "EUR:2", + "deposit-refund-1", + 2), /** * Spend 4.99 EUR of the refunded 4.99 EUR coin (1ct gone * due to refund) (merchant would receive EUR:4.98 due to -- cgit v1.2.3