summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcello Stanisci <stanisci.m@gmail.com>2018-12-18 14:48:47 +0100
committerMarcello Stanisci <stanisci.m@gmail.com>2018-12-18 14:48:47 +0100
commita3a0b36a9eb1053ea665d63375ab5f4830e5e8d9 (patch)
tree67ba184880aa478464958d09e9c4452e95f2c052
parent4393961f913dd79c195070e520d83943ffd3024e (diff)
downloadmerchant-a3a0b36a9eb1053ea665d63375ab5f4830e5e8d9.tar.gz
merchant-a3a0b36a9eb1053ea665d63375ab5f4830e5e8d9.tar.bz2
merchant-a3a0b36a9eb1053ea665d63375ab5f4830e5e8d9.zip
/proposal #5284
-rw-r--r--src/include/taler_merchant_testing_lib.h3
-rw-r--r--src/lib/test_merchant_api_new.c8
-rw-r--r--src/lib/test_merchant_api_twisted.c16
-rw-r--r--src/lib/testing_api_cmd_proposal.c22
4 files changed, 3 insertions, 46 deletions
diff --git a/src/include/taler_merchant_testing_lib.h b/src/include/taler_merchant_testing_lib.h
index b74ebe0b..2664cfc7 100644
--- a/src/include/taler_merchant_testing_lib.h
+++ b/src/include/taler_merchant_testing_lib.h
@@ -71,7 +71,6 @@ TALER_TESTING_run_merchant (const char *config_filename,
* @param label command label
* @param merchant_url base URL of the merchant serving
* the proposal request.
- * @param ctx CURL context.
* @param http_status expected HTTP status.
* @param order the order to PUT to the merchant.
* @param instance merchant instance performing the operation.
@@ -81,7 +80,6 @@ TALER_TESTING_run_merchant (const char *config_filename,
struct TALER_TESTING_Command
TALER_TESTING_cmd_proposal (const char *label,
const char *merchant_url,
- struct GNUNET_CURL_Context *ctx,
unsigned int http_status,
const char *order,
const char *instance);
@@ -101,7 +99,6 @@ TALER_TESTING_cmd_proposal (const char *label,
struct TALER_TESTING_Command
TALER_TESTING_cmd_proposal_lookup
(const char *label,
- struct GNUNET_CURL_Context *ctx,
const char *merchant_url,
unsigned int http_status,
const char *proposal_reference,
diff --git a/src/lib/test_merchant_api_new.c b/src/lib/test_merchant_api_new.c
index e1a741cd..5ebceb85 100644
--- a/src/lib/test_merchant_api_new.c
+++ b/src/lib/test_merchant_api_new.c
@@ -200,7 +200,6 @@ run (void *cls,
TALER_TESTING_cmd_proposal
("create-proposal-1",
merchant_url,
- is->ctx,
MHD_HTTP_OK,
"{\"max_fee\":\
{\"currency\":\"EUR\",\
@@ -276,7 +275,6 @@ run (void *cls,
TALER_TESTING_cmd_proposal
("create-proposal-2",
merchant_url,
- is->ctx,
MHD_HTTP_OK,
"{\"max_fee\":\
{\"currency\":\"EUR\",\
@@ -296,7 +294,6 @@ run (void *cls,
NULL),
TALER_TESTING_cmd_proposal_lookup ("fetch-proposal-2",
- is->ctx,
merchant_url,
MHD_HTTP_OK,
"create-proposal-2",
@@ -488,7 +485,6 @@ run (void *cls,
TALER_TESTING_cmd_proposal
("create-proposal-not-to-be-paid",
merchant_url,
- is->ctx,
MHD_HTTP_OK,
"{\"max_fee\":\
{\"currency\":\"EUR\",\
@@ -558,7 +554,6 @@ run (void *cls,
TALER_TESTING_cmd_proposal
("create-proposal-unincreased-refund",
merchant_url,
- is->ctx,
MHD_HTTP_OK,
"{\"max_fee\":\
{\"currency\":\"EUR\",\
@@ -800,7 +795,6 @@ run (void *cls,
TALER_TESTING_cmd_proposal
("create-proposal-tip-1",
merchant_url,
- is->ctx,
MHD_HTTP_OK,
"{\"max_fee\":\
{\"currency\":\"EUR\",\
@@ -880,7 +874,6 @@ run (void *cls,
TALER_TESTING_cmd_proposal
("create-proposal-10",
merchant_url,
- is->ctx,
MHD_HTTP_OK,
"{\"max_fee\":\
{\"currency\":\"EUR\",\
@@ -964,7 +957,6 @@ run (void *cls,
TALER_TESTING_cmd_proposal
("create-proposal-11",
merchant_url,
- is->ctx,
MHD_HTTP_OK,
"{\"max_fee\":\
{\"currency\":\"EUR\",\
diff --git a/src/lib/test_merchant_api_twisted.c b/src/lib/test_merchant_api_twisted.c
index 48be4eef..1553cab0 100644
--- a/src/lib/test_merchant_api_twisted.c
+++ b/src/lib/test_merchant_api_twisted.c
@@ -196,7 +196,6 @@ run (void *cls,
TALER_TESTING_cmd_proposal
("proposal-for-check-payment",
twister_merchant_url,
- is->ctx,
MHD_HTTP_OK,
"{\"max_fee\":\
{\"currency\":\"EUR\",\
@@ -268,7 +267,6 @@ run (void *cls,
TALER_TESTING_cmd_proposal
("create-proposal-0",
twister_merchant_url,
- is->ctx,
MHD_HTTP_BAD_REQUEST,
/* giving a valid JSON to not make it fail before
* data reaches the merchant. */
@@ -283,7 +281,6 @@ run (void *cls,
TALER_TESTING_cmd_proposal
("create-proposal-1",
twister_merchant_url,
- is->ctx,
/* This status code == 0 is gotten via a 500 Internal Server
* Error handed to the library. */
MHD_HTTP_INTERNAL_SERVER_ERROR,
@@ -305,7 +302,6 @@ run (void *cls,
TALER_TESTING_cmd_proposal
("create-proposal-2",
twister_merchant_url,
- is->ctx,
0,
"{\"max_fee\":\
{\"currency\":\"EUR\",\
@@ -332,7 +328,6 @@ run (void *cls,
TALER_TESTING_cmd_proposal
("create-proposal-3",
twister_merchant_url,
- is->ctx,
0,
"{\"max_fee\":\
{\"currency\":\"EUR\",\
@@ -357,7 +352,6 @@ run (void *cls,
TALER_TESTING_cmd_proposal
("create-proposal-4",
twister_merchant_url,
- is->ctx,
MHD_HTTP_NOT_FOUND,
"{\"amount\":\"EUR:5\",\
\"fulfillment_url\": \"https://example.com/\",\
@@ -367,7 +361,6 @@ run (void *cls,
/* Cause a 404 Not Found from /proposal/lookup,
* due to a non existing order id being queried. */
TALER_TESTING_cmd_proposal_lookup ("lookup-0",
- is->ctx,
twister_merchant_url,
MHD_HTTP_NOT_FOUND,
NULL,
@@ -379,7 +372,6 @@ run (void *cls,
/* To be short, we'll make a _error_ response to be
* unparsable. */
TALER_TESTING_cmd_proposal_lookup ("lookup-1",
- is->ctx,
twister_merchant_url,
0, // response code.
NULL,
@@ -395,7 +387,6 @@ run (void *cls,
TALER_TESTING_cmd_proposal
("create-proposal-5",
twister_merchant_url,
- is->ctx,
MHD_HTTP_OK,
"{\"max_fee\":\
{\"currency\":\"EUR\",\
@@ -421,7 +412,6 @@ run (void *cls,
/* lookup! */
TALER_TESTING_cmd_proposal_lookup ("lookup-5",
- is->ctx,
twister_merchant_url,
// expected response code.
0,
@@ -507,7 +497,6 @@ run (void *cls,
TALER_TESTING_cmd_proposal
("create-proposal-unaggregation",
twister_merchant_url,
- is->ctx,
MHD_HTTP_OK,
"{\"max_fee\":\
{\"currency\":\"EUR\",\
@@ -576,7 +565,6 @@ run (void *cls,
TALER_TESTING_cmd_proposal
("create-proposal-5383",
twister_merchant_url,
- is->ctx,
MHD_HTTP_OK,
"{\"max_fee\":\
{\"currency\":\"EUR\",\
@@ -673,7 +661,6 @@ run (void *cls,
TALER_TESTING_cmd_proposal
("create-proposal-6",
twister_merchant_url,
- is->ctx,
MHD_HTTP_OK,
"{\"max_fee\":\
{\"currency\":\"EUR\",\
@@ -795,7 +782,6 @@ run (void *cls,
TALER_TESTING_cmd_proposal
("create-proposal-abort-1",
twister_merchant_url,
- is->ctx,
MHD_HTTP_OK,
"{\"max_fee\":\
{\"currency\":\"EUR\",\
@@ -883,7 +869,6 @@ run (void *cls,
TALER_TESTING_cmd_proposal
("create-proposal-double-spend",
twister_merchant_url,
- is->ctx,
MHD_HTTP_OK,
"{\"max_fee\":\
{\"currency\":\"EUR\",\
@@ -904,7 +889,6 @@ run (void *cls,
TALER_TESTING_cmd_proposal
("create-proposal-double-spend-1",
twister_merchant_url,
- is->ctx,
MHD_HTTP_OK,
"{\"max_fee\":\
{\"currency\":\"EUR\",\
diff --git a/src/lib/testing_api_cmd_proposal.c b/src/lib/testing_api_cmd_proposal.c
index fb22c52f..ac4ae0e7 100644
--- a/src/lib/testing_api_cmd_proposal.c
+++ b/src/lib/testing_api_cmd_proposal.c
@@ -89,11 +89,6 @@ struct ProposalState
const char *merchant_url;
/**
- * The curl context.
- */
- struct GNUNET_CURL_Context *ctx;
-
- /**
* The interpreter state.
*/
struct TALER_TESTING_Interpreter *is;
@@ -127,11 +122,6 @@ struct ProposalLookupState
const char *merchant_url;
/**
- * The curl context.
- */
- struct GNUNET_CURL_Context *ctx;
-
- /**
* Expected status code.
*/
unsigned int http_status;
@@ -319,7 +309,7 @@ proposal_cb (void *cls,
if (NULL ==
(ps->plo = TALER_MERCHANT_proposal_lookup
- (ps->ctx,
+ (ps->is->ctx,
ps->merchant_url,
ps->order_id,
ps->instance,
@@ -394,7 +384,7 @@ proposal_run (void *cls,
merchant);
}
- ps->po = TALER_MERCHANT_order_put (ps->ctx,
+ ps->po = TALER_MERCHANT_order_put (is->ctx,
ps->merchant_url,
order,
&proposal_cb,
@@ -470,7 +460,6 @@ proposal_lookup_cleanup (void *cls,
* @param label command label
* @param merchant_url base URL of the merchant serving
* the proposal request.
- * @param ctx CURL context.
* @param http_status expected HTTP status.
* @param order the order to PUT to the merchant.
* @param instance merchant instance performing the operation.
@@ -480,7 +469,6 @@ proposal_lookup_cleanup (void *cls,
struct TALER_TESTING_Command
TALER_TESTING_cmd_proposal (const char *label,
const char *merchant_url,
- struct GNUNET_CURL_Context *ctx,
unsigned int http_status,
const char *order,
const char *instance)
@@ -491,7 +479,6 @@ TALER_TESTING_cmd_proposal (const char *label,
ps = GNUNET_new (struct ProposalState);
ps->order = order;
ps->http_status = http_status;
- ps->ctx = ctx;
ps->merchant_url = merchant_url;
ps->instance = (NULL == instance) ? "default": instance;
@@ -581,7 +568,7 @@ proposal_lookup_run (void *cls,
(proposal_cmd, 0, &order_id))
TALER_TESTING_FAIL (is);
}
- pls->plo = TALER_MERCHANT_proposal_lookup (pls->ctx,
+ pls->plo = TALER_MERCHANT_proposal_lookup (is->ctx,
pls->merchant_url,
order_id,
"default",
@@ -596,7 +583,6 @@ proposal_lookup_run (void *cls,
* Make a "proposal lookup" command.
*
* @param label command label.
- * @param ctx CURL context.
* @param merchant_url base URL of the merchant backend
* serving the proposal lookup request.
* @param http_status expected HTTP response code.
@@ -608,7 +594,6 @@ proposal_lookup_run (void *cls,
struct TALER_TESTING_Command
TALER_TESTING_cmd_proposal_lookup
(const char *label,
- struct GNUNET_CURL_Context *ctx,
const char *merchant_url,
unsigned int http_status,
const char *proposal_reference,
@@ -621,7 +606,6 @@ TALER_TESTING_cmd_proposal_lookup
pls->http_status = http_status;
pls->proposal_reference = proposal_reference;
pls->merchant_url = merchant_url;
- pls->ctx = ctx;
pls->order_id = order_id;
cmd.cls = pls;