summaryrefslogtreecommitdiff
path: root/src/mint-lib/test_mint_api.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2015-09-20 14:02:10 +0200
committerChristian Grothoff <christian@grothoff.org>2015-09-20 14:02:10 +0200
commit16ed21afe071277d797b575a0d15fa29bd969c0b (patch)
tree9fc4eea7f2753145fe55517f5458fb96be2abe5e /src/mint-lib/test_mint_api.c
parenta6f8fa98b0253091cae0f2e38fb5fcec47e115fa (diff)
downloadexchange-16ed21afe071277d797b575a0d15fa29bd969c0b.tar.gz
exchange-16ed21afe071277d797b575a0d15fa29bd969c0b.tar.bz2
exchange-16ed21afe071277d797b575a0d15fa29bd969c0b.zip
expanding test to cover multi-wire format scenarios (#3972)
Diffstat (limited to 'src/mint-lib/test_mint_api.c')
-rw-r--r--src/mint-lib/test_mint_api.c27
1 files changed, 18 insertions, 9 deletions
diff --git a/src/mint-lib/test_mint_api.c b/src/mint-lib/test_mint_api.c
index 6fb099095..7b96f657c 100644
--- a/src/mint-lib/test_mint_api.c
+++ b/src/mint-lib/test_mint_api.c
@@ -33,9 +33,8 @@
/**
* Is the configuration file is set to include wire format 'sepa'?
- * Needs #3972 to be solved first.
*/
-#define WIRE_SEPA 0
+#define WIRE_SEPA 1
/**
* Main execution context for the main loop.
@@ -464,6 +463,11 @@ struct Command
*/
struct TALER_MINT_WireHandle *wh;
+ /**
+ * Format we expect to see, others will be *ignored*.
+ */
+ const char *format;
+
} wire;
} details;
@@ -1038,10 +1042,6 @@ link_cb (void *cls,
return;
}
/* check that the coins match */
- fprintf (stderr,
- "Got %u coins\n",
- num_coins);
-
for (i=0;i<num_coins;i++)
for (j=i+1;j<num_coins;j++)
if (0 == memcmp (&coin_privs[i],
@@ -1186,6 +1186,13 @@ wire_cb (void *cls,
/* 0 always signals the end of the iteration */
cmd->details.wire.wh = NULL;
}
+ else if ( (NULL != method) &&
+ (0 != strcasecmp (method,
+ cmd->details.wire.format)) )
+ {
+ /* not the method we care about, skip */
+ return;
+ }
if (cmd->expected_response_code != http_status)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
@@ -1994,13 +2001,15 @@ run (void *cls,
{ .oc = OC_WIRE,
.label = "wire-test",
/* /wire/test replies with a 302 redirect */
- .expected_response_code = MHD_HTTP_FOUND },
+ .expected_response_code = MHD_HTTP_FOUND,
+ .details.wire.format = "test" },
#endif
#if WIRE_SEPA
- { .oc = OC_WIRE,
+ { .oc = OC_WIRE,
.label = "wire-sepa",
/* /wire/sepa replies with a 200 redirect */
- .expected_response_code = MHD_HTTP_OK },
+ .expected_response_code = MHD_HTTP_OK,
+ .details.wire.format = "sepa" },
#endif
/* *************** end of /wire testing ************** */