[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [taler-merchant] 02/04: Splitting tests, up to tip
From: |
gnunet |
Subject: |
[GNUnet-SVN] [taler-merchant] 02/04: Splitting tests, up to tip |
Date: |
Tue, 26 Jun 2018 12:51:29 +0200 |
This is an automated email from the git hooks/post-receive script.
marcello pushed a commit to branch master
in repository merchant.
commit 8eb86b430e3276ba5246460d5c8832645134281d
Author: Marcello Stanisci <address@hidden>
AuthorDate: Tue Jun 26 12:09:05 2018 +0200
Splitting tests, up to tip
---
src/lib/test_merchant_api_new.c | 69 +++++++++++++++++++++++------------------
src/lib/testing_api_cmd_tip.c | 9 +++++-
2 files changed, 47 insertions(+), 31 deletions(-)
diff --git a/src/lib/test_merchant_api_new.c b/src/lib/test_merchant_api_new.c
index 706c36d..6787ebc 100644
--- a/src/lib/test_merchant_api_new.c
+++ b/src/lib/test_merchant_api_new.c
@@ -628,35 +628,8 @@ run (void *cls,
TALER_TESTING_cmd_end ()
};
- struct TALER_TESTING_Command commands[] = {
- TALER_TESTING_cmd_batch ("pay",
- pay),
-
- TALER_TESTING_cmd_batch ("double-spending",
- double_spending),
-
- TALER_TESTING_cmd_batch ("track",
- track),
-
- /**
- * Just a weird /history request, not really tied to
- * any CMDs chunk.
- */
- TALER_TESTING_cmd_history
- ("history-2",
- merchant_url,
- is->ctx,
- MHD_HTTP_OK,
- GNUNET_TIME_absolute_add (GNUNET_TIME_UNIT_ZERO_ABS,
- GNUNET_TIME_UNIT_MICROSECONDS),
- /* zero results expected, time too ancient. */
- 0,
- 10,
- 10),
-
- TALER_TESTING_cmd_batch ("refund",
- refund),
+ struct TALER_TESTING_Command tip[] = {
/* Test tipping. */
TALER_TESTING_cmd_fakebank_transfer_with_instance
@@ -671,7 +644,6 @@ run (void *cls,
EXCHANGE_URL,
CONFIG_FILE),
-
CMD_EXEC_WIREWATCH ("wirewatch-3"),
TALER_TESTING_cmd_check_bank_transfer
@@ -697,7 +669,6 @@ run (void *cls,
"tip 2",
"EUR:5.01"),
-
/* This command tests the authorization of tip
* against a reserve that does not exist. This is
* implemented by passing a "tip instance" that
@@ -736,6 +707,44 @@ run (void *cls,
"authorize-tip-1",
pickup_amounts_1,
is->exchange),
+ TALER_TESTING_cmd_end ()
+ };
+
+ struct TALER_TESTING_Command commands[] = {
+
+ TALER_TESTING_cmd_batch ("pay",
+ pay),
+
+ TALER_TESTING_cmd_batch ("double-spending",
+ double_spending),
+
+ TALER_TESTING_cmd_batch ("track",
+ track),
+
+ /**
+ * Just a weird /history request, not really tied to
+ * any CMDs chunk.
+ */
+ TALER_TESTING_cmd_history
+ ("history-2",
+ merchant_url,
+ is->ctx,
+ MHD_HTTP_OK,
+ GNUNET_TIME_absolute_add (GNUNET_TIME_UNIT_ZERO_ABS,
+ GNUNET_TIME_UNIT_MICROSECONDS),
+ /* zero results expected, time too ancient. */
+ 0,
+ 10,
+ 10),
+
+ TALER_TESTING_cmd_batch ("refund",
+ refund),
+
+ TALER_TESTING_cmd_batch ("tip",
+ tip),
+
+
+
TALER_TESTING_cmd_tip_query_with_amounts ("query-tip-3",
merchant_url,
diff --git a/src/lib/testing_api_cmd_tip.c b/src/lib/testing_api_cmd_tip.c
index ec747fa..f90afeb 100644
--- a/src/lib/testing_api_cmd_tip.c
+++ b/src/lib/testing_api_cmd_tip.c
@@ -772,6 +772,11 @@ struct WithdrawHandle
*/
unsigned int off;
+
+ /**
+ * Internal state of the "pickup" CMD.
+ */
+ struct TipPickupState *tps;
};
/**
@@ -796,7 +801,8 @@ pickup_withdraw_cb (void *cls,
{
struct WithdrawHandle *wh = cls;
struct TALER_TESTING_Interpreter *is = wh->is;
- struct TipPickupState *tps = is->commands[is->ip].cls;
+
+ struct TipPickupState *tps = wh->tps;
wh->wsh = NULL;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -904,6 +910,7 @@ pickup_cb (void *cls,
wh->off = i;
wh->is = tps->is;
+ wh->tps = tps;
GNUNET_assert
( (NULL == wh->wsh) &&
( (NULL == tps->sigs) ||
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [taler-merchant] branch master updated (877f49d -> c2ae934), gnunet, 2018/06/26
- [GNUnet-SVN] [taler-merchant] 02/04: Splitting tests, up to tip,
gnunet <=
- [GNUnet-SVN] [taler-merchant] 04/04: Finish splitting main "lib" test cases., gnunet, 2018/06/26
- [GNUnet-SVN] [taler-merchant] 03/04: Splitting tests, _actually_ up to tip, gnunet, 2018/06/26
- [GNUnet-SVN] [taler-merchant] 01/04: Splitting tests, up to refund, gnunet, 2018/06/26