From 7b25787a4b8ac0a0b3cbc2174ba3cac9c564346a Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Mon, 30 May 2022 16:31:24 +0200 Subject: -generate 404 on non-existing accounts for fakebank, use payto://-URIs with receiver-name in tests --- src/testing/testing_api_cmd_reserve_history.c | 60 +++++++++++++++------------ 1 file changed, 34 insertions(+), 26 deletions(-) (limited to 'src/testing/testing_api_cmd_reserve_history.c') diff --git a/src/testing/testing_api_cmd_reserve_history.c b/src/testing/testing_api_cmd_reserve_history.c index 6cee5af1..e63cca86 100644 --- a/src/testing/testing_api_cmd_reserve_history.c +++ b/src/testing/testing_api_cmd_reserve_history.c @@ -95,7 +95,7 @@ analyze_command (const struct TALER_ReservePublicKeyP *reserve_pub, const struct TALER_TESTING_Command *cmd, unsigned int history_length, const struct TALER_EXCHANGE_ReserveHistoryEntry *history, - int *found) + bool *found) { if (TALER_TESTING_cmd_is_batch (cmd)) { @@ -134,7 +134,6 @@ analyze_command (const struct TALER_ReservePublicKeyP *reserve_pub, else { const struct TALER_ReservePublicKeyP *rp; - const struct TALER_EXCHANGE_ReserveHistoryEntry *he; if (GNUNET_OK != TALER_TESTING_get_trait_reserve_pub (cmd, @@ -144,32 +143,40 @@ analyze_command (const struct TALER_ReservePublicKeyP *reserve_pub, GNUNET_memcmp (rp, reserve_pub)) return GNUNET_OK; /* command affects some _other_ reserve */ - if (GNUNET_OK != - TALER_TESTING_get_trait_reserve_history (cmd, - &he)) - { - /* NOTE: only for debugging... */ - GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, - "Command `%s' has the reserve_pub trait, but does not reserve history trait\n", - cmd->label); - return GNUNET_OK; /* command does nothing for reserves */ - } - for (unsigned int i = 0; ilabel); + return GNUNET_OK; /* command does nothing for reserves */ } + for (unsigned int i = 0; ilabel, + j); + return GNUNET_SYSERR; } - GNUNET_log (GNUNET_ERROR_TYPE_ERROR, - "Command `%s' reserve history entry not found\n", - cmd->label); - return GNUNET_SYSERR; } } @@ -237,7 +244,7 @@ reserve_history_cb (void *cls, return; } { - int found[rs->details.ok.history_len]; + bool found[rs->details.ok.history_len]; memset (found, 0, @@ -342,7 +349,8 @@ history_traits (void *cls, struct HistoryState *hs = cls; struct TALER_TESTING_Trait traits[] = { /* history entry MUST be first due to response code logic below! */ - TALER_TESTING_make_trait_reserve_history (&hs->reserve_history), + TALER_TESTING_make_trait_reserve_history (0, + &hs->reserve_history), TALER_TESTING_trait_end () }; -- cgit v1.2.3