summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-01-15 22:11:32 +0100
committerChristian Grothoff <christian@grothoff.org>2020-01-15 22:11:32 +0100
commit77281fa319f8cfb079bdffe63cef51b6aeb24cc7 (patch)
tree1b5b80a4c1baf373d1910a34422d56d4e32bfa66
parent16a6d39dc94eccf60f25e5abfaeb6c313e39c39a (diff)
downloadexchange-77281fa319f8cfb079bdffe63cef51b6aeb24cc7.tar.gz
exchange-77281fa319f8cfb079bdffe63cef51b6aeb24cc7.tar.bz2
exchange-77281fa319f8cfb079bdffe63cef51b6aeb24cc7.zip
check for 204 first
-rw-r--r--src/lib/testing_api_cmd_bank_history_credit.c18
-rw-r--r--src/lib/testing_api_cmd_bank_history_debit.c29
2 files changed, 25 insertions, 22 deletions
diff --git a/src/lib/testing_api_cmd_bank_history_credit.c b/src/lib/testing_api_cmd_bank_history_credit.c
index be820ab4b..fbabc77ba 100644
--- a/src/lib/testing_api_cmd_bank_history_credit.c
+++ b/src/lib/testing_api_cmd_bank_history_credit.c
@@ -507,15 +507,6 @@ history_cb (void *cls,
struct HistoryState *hs = is->commands[is->ip].cls;
(void) row_id;
- if (MHD_HTTP_OK != http_status)
- {
- hs->hh = NULL;
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- "Unwanted response code from /history: %u\n",
- http_status);
- TALER_TESTING_interpreter_fail (is);
- return GNUNET_SYSERR;
- }
if (NULL == details)
{
hs->hh = NULL;
@@ -541,6 +532,15 @@ history_cb (void *cls,
TALER_TESTING_interpreter_next (is);
return GNUNET_OK;
}
+ if (MHD_HTTP_OK != http_status)
+ {
+ hs->hh = NULL;
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Unwanted response code from /history: %u\n",
+ http_status);
+ TALER_TESTING_interpreter_fail (is);
+ return GNUNET_SYSERR;
+ }
/* check current element */
if (GNUNET_OK != check_result (is,
diff --git a/src/lib/testing_api_cmd_bank_history_debit.c b/src/lib/testing_api_cmd_bank_history_debit.c
index 267ea1432..c98eb26a1 100644
--- a/src/lib/testing_api_cmd_bank_history_debit.c
+++ b/src/lib/testing_api_cmd_bank_history_debit.c
@@ -205,8 +205,10 @@ build_history (struct TALER_TESTING_Interpreter *is,
add_incoming_cmd = TALER_TESTING_interpreter_lookup_command
(is, hs->start_row_reference);
GNUNET_assert (NULL != add_incoming_cmd);
- GNUNET_assert (GNUNET_OK == TALER_TESTING_get_trait_uint64
- (add_incoming_cmd, 0, &row_id_start));
+ GNUNET_assert (GNUNET_OK ==
+ TALER_TESTING_get_trait_uint64 (add_incoming_cmd,
+ 0,
+ &row_id_start));
}
GNUNET_assert (0 != hs->num_results);
@@ -330,8 +332,9 @@ build_history (struct TALER_TESTING_Interpreter *is,
const char *credit_account;
const char *debit_account;
- if (GNUNET_OK != TALER_TESTING_GET_TRAIT_ROW_ID
- (pos, &row_id))
+ if (GNUNET_OK !=
+ TALER_TESTING_GET_TRAIT_ROW_ID (pos,
+ &row_id))
continue;
if (NULL != row_id_start)
@@ -511,15 +514,6 @@ history_cb (void *cls,
struct HistoryState *hs = is->commands[is->ip].cls;
(void) row_id;
- if (MHD_HTTP_OK != http_status)
- {
- hs->hh = NULL;
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- "Unwanted response code from /history: %u\n",
- http_status);
- TALER_TESTING_interpreter_fail (is);
- return GNUNET_SYSERR;
- }
if (NULL == details)
{
hs->hh = NULL;
@@ -545,6 +539,15 @@ history_cb (void *cls,
TALER_TESTING_interpreter_next (is);
return GNUNET_OK;
}
+ if (MHD_HTTP_OK != http_status)
+ {
+ hs->hh = NULL;
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Unwanted response code from /history: %u\n",
+ http_status);
+ TALER_TESTING_interpreter_fail (is);
+ return GNUNET_SYSERR;
+ }
/* check current element */
if (GNUNET_OK != check_result (is,