diff options
author | Christian Grothoff <christian@grothoff.org> | 2022-12-29 14:47:17 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2022-12-29 14:47:17 +0100 |
commit | 2c19f6a6fb180f059fcaeb193dd387c4d6af21b1 (patch) | |
tree | d7fdd874e84950510f5a7a698007023ed46d80ea /src/testing/testing_api_cmd_post_templates.c | |
parent | 689bbc7a201067815cb0975703422854099d19ba (diff) |
-towards fixing the template tests
Diffstat (limited to 'src/testing/testing_api_cmd_post_templates.c')
-rw-r--r-- | src/testing/testing_api_cmd_post_templates.c | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/src/testing/testing_api_cmd_post_templates.c b/src/testing/testing_api_cmd_post_templates.c index 3708a467..c80e00cf 100644 --- a/src/testing/testing_api_cmd_post_templates.c +++ b/src/testing/testing_api_cmd_post_templates.c @@ -85,7 +85,7 @@ struct PostTemplatesState */ static void post_templates_cb (void *cls, - const struct TALER_MERCHANT_HttpResponse *hr) + const struct TALER_MERCHANT_HttpResponse *hr) { struct PostTemplatesState *tis = cls; @@ -130,20 +130,20 @@ post_templates_cb (void *cls, */ static void post_templates_run (void *cls, - const struct TALER_TESTING_Command *cmd, - struct TALER_TESTING_Interpreter *is) + const struct TALER_TESTING_Command *cmd, + struct TALER_TESTING_Interpreter *is) { struct PostTemplatesState *tis = cls; tis->is = is; tis->iph = TALER_MERCHANT_templates_post (is->ctx, - tis->merchant_url, - tis->template_id, - tis->template_description, - tis->image, - tis->template_contract, - &post_templates_cb, - tis); + tis->merchant_url, + tis->template_id, + tis->template_description, + tis->image, + tis->template_contract, + &post_templates_cb, + tis); GNUNET_assert (NULL != tis->iph); } @@ -158,11 +158,11 @@ post_templates_run (void *cls, * @param index index number of the object to extract. * @return #GNUNET_OK on success */ -static int +static enum GNUNET_GenericReturnValue post_templates_traits (void *cls, - const void **ret, - const char *trait, - unsigned int index) + const void **ret, + const char *trait, + unsigned int index) { struct PostTemplatesState *pts = cls; struct TALER_TESTING_Trait traits[] = { @@ -190,7 +190,7 @@ post_templates_traits (void *cls, */ static void post_templates_cleanup (void *cls, - const struct TALER_TESTING_Command *cmd) + const struct TALER_TESTING_Command *cmd) { struct PostTemplatesState *tis = cls; @@ -226,7 +226,7 @@ TALER_TESTING_cmd_merchant_post_templates2 ( tis->template_id = template_id; tis->http_status = http_status; tis->template_description = template_description; - tis->image = GNUNET_strdup (image); + tis->image = (NULL == image) ? NULL : GNUNET_strdup (image); tis->template_contract = template_contract; { struct TALER_TESTING_Command cmd = { @@ -244,17 +244,17 @@ TALER_TESTING_cmd_merchant_post_templates2 ( struct TALER_TESTING_Command TALER_TESTING_cmd_merchant_post_templates (const char *label, - const char *merchant_url, - const char *template_id, - const char *template_description, - unsigned int http_status) + const char *merchant_url, + const char *template_id, + const char *template_description, + unsigned int http_status) { return TALER_TESTING_cmd_merchant_post_templates2 ( label, merchant_url, template_id, template_description, - "", + NULL, json_pack ("{s:s}", "merchant", "Pay"), http_status); } |