summaryrefslogtreecommitdiff
path: root/src/testing/testing_api_cmd_reserve_status.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2022-05-30 19:31:49 +0200
committerChristian Grothoff <christian@grothoff.org>2022-05-30 19:31:49 +0200
commitd55b093de8d5a39d7796ca68a4990ee4e9669c16 (patch)
tree0692bf465a54d05a78cd63a2b992e1f3902834f5 /src/testing/testing_api_cmd_reserve_status.c
parentab4aa4dcfd3477971b3fb0c81a4caffff953c145 (diff)
downloadexchange-d55b093de8d5a39d7796ca68a4990ee4e9669c16.tar.gz
exchange-d55b093de8d5a39d7796ca68a4990ee4e9669c16.tar.bz2
exchange-d55b093de8d5a39d7796ca68a4990ee4e9669c16.zip
-fix reserve history, include in tests
Diffstat (limited to 'src/testing/testing_api_cmd_reserve_status.c')
-rw-r--r--src/testing/testing_api_cmd_reserve_status.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/src/testing/testing_api_cmd_reserve_status.c b/src/testing/testing_api_cmd_reserve_status.c
index 9abd99f0b..76639e49c 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;
}