From d55b093de8d5a39d7796ca68a4990ee4e9669c16 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Mon, 30 May 2022 19:31:49 +0200 Subject: -fix reserve history, include in tests --- src/testing/testing_api_cmd_reserve_status.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'src/testing/testing_api_cmd_reserve_status.c') diff --git a/src/testing/testing_api_cmd_reserve_status.c b/src/testing/testing_api_cmd_reserve_status.c index 9abd99f0..76639e49 100644 --- a/src/testing/testing_api_cmd_reserve_status.c +++ b/src/testing/testing_api_cmd_reserve_status.c @@ -138,6 +138,7 @@ analyze_command (const struct TALER_ReservePublicKeyP *reserve_pub, for (unsigned int j = 0; true; j++) { const struct TALER_EXCHANGE_ReserveHistoryEntry *he; + bool matched = false; if (GNUNET_OK != TALER_TESTING_get_trait_reserve_history (cmd, @@ -159,14 +160,18 @@ analyze_command (const struct TALER_ReservePublicKeyP *reserve_pub, &history[i])) { found[i] = true; - return GNUNET_OK; + matched = true; + break; } } - GNUNET_log (GNUNET_ERROR_TYPE_ERROR, - "Command `%s' reserve history entry #%u not found\n", - cmd->label, - j); - return GNUNET_SYSERR; + if (! matched) + { + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + "Command `%s' reserve history entry #%u not found\n", + cmd->label, + j); + return GNUNET_SYSERR; + } } } } @@ -213,9 +218,13 @@ reserve_status_cb (void *cls, if (0 != TALER_amount_cmp (&eb, &rs->details.ok.balance)) { + GNUNET_break (0); GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Unexpected amount in reserve: %s\n", TALER_amount_to_string (&rs->details.ok.balance)); + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + "Expected balance of: %s\n", + TALER_amount_to_string (&eb)); TALER_TESTING_interpreter_fail (ss->is); return; } -- cgit v1.2.3