aboutsummaryrefslogtreecommitdiff
path: root/src/exchange-lib
diff options
context:
space:
mode:
authorMarcello Stanisci <stanisci.m@gmail.com>2018-02-27 22:49:18 +0100
committerMarcello Stanisci <stanisci.m@gmail.com>2018-02-27 22:55:18 +0100
commit663f26a1a269d91e5d6ab2d9d5d01102d6ffd353 (patch)
treedac11467e1e82b1464263b13d87ab272cd464167 /src/exchange-lib
parentcfab4194f08af08227d33d768d3e2001434bb6cd (diff)
downloadexchange-663f26a1a269d91e5d6ab2d9d5d01102d6ffd353.tar.xz
fix reject test command.
Diffstat (limited to 'src/exchange-lib')
-rw-r--r--src/exchange-lib/testing_api_cmd_bank_check.c28
-rw-r--r--src/exchange-lib/testing_api_cmd_track.c1
2 files changed, 25 insertions, 4 deletions
diff --git a/src/exchange-lib/testing_api_cmd_bank_check.c b/src/exchange-lib/testing_api_cmd_bank_check.c
index 9af156f92..380f5d61d 100644
--- a/src/exchange-lib/testing_api_cmd_bank_check.c
+++ b/src/exchange-lib/testing_api_cmd_bank_check.c
@@ -200,17 +200,19 @@ check_bank_transfer_traits (void *cls,
unsigned int index)
{
struct BankCheckState *bcs = cls;
+ struct TALER_WireTransferIdentifierRawP *wtid_ptr;
- GNUNET_assert (GNUNET_OK ==
- GNUNET_STRINGS_string_to_data
+ if (GNUNET_OK != GNUNET_STRINGS_string_to_data
(bcs->subject,
strlen (bcs->subject),
&bcs->wtid,
- sizeof (struct TALER_WireTransferIdentifierRawP)));
+ sizeof (struct TALER_WireTransferIdentifierRawP)))
+ wtid_ptr = NULL;
+ wtid_ptr = &bcs->wtid;
struct TALER_TESTING_Trait traits[] = {
TALER_TESTING_make_trait_transfer_subject (0, bcs->subject),
- TALER_TESTING_make_trait_wtid (0, &bcs->wtid),
+ TALER_TESTING_make_trait_wtid (0, wtid_ptr),
TALER_TESTING_make_trait_url (0, bcs->exchange_base_url),
TALER_TESTING_trait_end ()
};
@@ -298,6 +300,22 @@ check_bank_empty_run (void *cls,
}
/**
+ * FIXME.
+ */
+static int
+check_bank_empty_traits (void *cls,
+ void **ret,
+ const char *trait,
+ unsigned int index)
+{
+ /**
+ * Some commands (notably "bank history") could randomly
+ * look for traits; this way makes sure we don't segfault.
+ */
+ return GNUNET_SYSERR;
+}
+
+/**
* Check bank's balance is zero.
*
* @param credit_account the account that received money
@@ -312,6 +330,7 @@ TALER_TESTING_cmd_check_bank_empty (const char *label)
cmd.label = label;
cmd.run = &check_bank_empty_run;
cmd.cleanup = &check_bank_empty_cleanup;
+ cmd.traits = &check_bank_empty_traits;
return cmd;
}
@@ -331,6 +350,7 @@ TALER_TESTING_cmd_check_bank_transfer_with_ref
bcs = GNUNET_new (struct BankCheckState);
bcs->deposit_reference = deposit_reference;
+
cmd.label = label;
cmd.cls = bcs;
cmd.run = &check_bank_transfer_run;
diff --git a/src/exchange-lib/testing_api_cmd_track.c b/src/exchange-lib/testing_api_cmd_track.c
index 8c289ed5d..3f14c5110 100644
--- a/src/exchange-lib/testing_api_cmd_track.c
+++ b/src/exchange-lib/testing_api_cmd_track.c
@@ -722,6 +722,7 @@ track_transfer_run (void *cls,
TALER_TESTING_interpreter_fail (tts->is);
return;
}
+ GNUNET_assert (NULL != wtid_ptr);
}
tts->tth = TALER_EXCHANGE_track_transfer (tts->exchange,
wtid_ptr,