diff options
author | priscilla <priscilla.huang@efrei.net> | 2023-02-20 04:39:40 -0500 |
---|---|---|
committer | priscilla <priscilla.huang@efrei.net> | 2023-02-20 12:19:40 -0500 |
commit | 69341625aad4b0a1b3642103226f11c2ec4d943c (patch) | |
tree | 789cb05034676c6865879862d025be0145c14e13 | |
parent | 2a52426a7cdc55f49f726f24ddc735d6c01decaa (diff) | |
download | merchant-69341625aad4b0a1b3642103226f11c2ec4d943c.tar.gz merchant-69341625aad4b0a1b3642103226f11c2ec4d943c.tar.bz2 merchant-69341625aad4b0a1b3642103226f11c2ec4d943c.zip |
pull changes
-rw-r--r-- | src/testing/testing_api_cmd_get_template.c | 24 | ||||
-rw-r--r-- | src/testing/testing_api_cmd_patch_template.c | 16 | ||||
-rw-r--r-- | src/testing/testing_api_cmd_post_templates.c | 20 |
3 files changed, 32 insertions, 28 deletions
diff --git a/src/testing/testing_api_cmd_get_template.c b/src/testing/testing_api_cmd_get_template.c index bd9afff3..acd9a2e3 100644 --- a/src/testing/testing_api_cmd_get_template.c +++ b/src/testing/testing_api_cmd_get_template.c @@ -80,7 +80,7 @@ static void get_template_cb (void *cls, const struct TALER_MERCHANT_HttpResponse *hr, const char *template_description, - const char *image, + const char *pos_key, const json_t *template_contract) { struct GetTemplateState *gis = cls; @@ -120,22 +120,22 @@ get_template_cb (void *cls, } } { - const char **expected_image; + const char **expected_pos_key; if (GNUNET_OK != - TALER_TESTING_get_trait_template_image (template_cmd, - &expected_image)) + TALER_TESTING_get_trait_template_pos_key (template_cmd, + &expected_pos_key)) TALER_TESTING_interpreter_fail (gis->is); - if ( ( (NULL == image) && (NULL != *expected_image)) || - ( (NULL != image) && (NULL == *expected_image)) || - ( (NULL != image) && - (0 != strcmp (image, - *expected_image)) ) ) + if ( ( (NULL == pos_key) && (NULL != *expected_pos_key)) || + ( (NULL != pos_key) && (NULL == *expected_pos_key)) || + ( (NULL != pos_key) && + (0 != strcmp (pos_key, + *expected_pos_key)) ) ) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, - "Template image `%s' does not match `%s'\n", - image, - *expected_image); + "Template pos_key `%s' does not match `%s'\n", + pos_key, + *expected_pos_key); TALER_TESTING_interpreter_fail (gis->is); return; } diff --git a/src/testing/testing_api_cmd_patch_template.c b/src/testing/testing_api_cmd_patch_template.c index a2a75b89..f6f5771b 100644 --- a/src/testing/testing_api_cmd_patch_template.c +++ b/src/testing/testing_api_cmd_patch_template.c @@ -60,9 +60,9 @@ struct PatchTemplateState const char *template_description; /** - * base64-encoded template image + * base64-encoded key */ - char *image; + char *pos_key; /** * Contract of the company @@ -141,7 +141,7 @@ patch_template_run (void *cls, pis->merchant_url, pis->template_id, pis->template_description, - pis->image, + pis->pos_key, pis->template_contract, &patch_template_cb, pis); @@ -168,8 +168,8 @@ patch_template_traits (void *cls, struct PatchTemplateState *pts = cls; struct TALER_TESTING_Trait traits[] = { TALER_TESTING_make_trait_template_description (&pts->template_description), - TALER_TESTING_make_trait_template_image ( - (const char **) &pts->image), + TALER_TESTING_make_trait_template_pos_key ( + (const char **) &pts->pos_key), TALER_TESTING_make_trait_template_contract (pts->template_contract), TALER_TESTING_make_trait_template_id (&pts->template_id), TALER_TESTING_trait_end (), @@ -201,7 +201,7 @@ patch_template_cleanup (void *cls, "PATCH /templates/$ID operation did not complete\n"); TALER_MERCHANT_template_patch_cancel (pis->iph); } - GNUNET_free (pis->image); + GNUNET_free (pis->pos_key); json_decref (pis->template_contract); GNUNET_free (pis); } @@ -213,7 +213,7 @@ TALER_TESTING_cmd_merchant_patch_template ( const char *merchant_url, const char *template_id, const char *template_description, - const char *image, + const char *pos_key, json_t *template_contract, unsigned int http_status) { @@ -224,7 +224,7 @@ TALER_TESTING_cmd_merchant_patch_template ( pis->template_id = template_id; pis->http_status = http_status; pis->template_description = template_description; - pis->image = (NULL == image) ? NULL : GNUNET_strdup (image); + pis->pos_key = (NULL == pos_key) ? NULL : GNUNET_strdup (pos_key); pis->template_contract = template_contract; /* ownership taken */ { struct TALER_TESTING_Command cmd = { diff --git a/src/testing/testing_api_cmd_post_templates.c b/src/testing/testing_api_cmd_post_templates.c index 32b8d627..85dea3a4 100644 --- a/src/testing/testing_api_cmd_post_templates.c +++ b/src/testing/testing_api_cmd_post_templates.c @@ -60,9 +60,9 @@ struct PostTemplatesState const char *template_description; /** - * base64-encoded product image + * base64-encoded key */ - char *image; + char *pos_key; /** * Contract of the company @@ -97,6 +97,10 @@ post_templates_cb (void *cls, hr->http_status, (int) hr->ec, TALER_TESTING_interpreter_get_current_label (tis->is)); + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + "tis %u vs hr %u", + tis->http_status, + hr->http_status); TALER_TESTING_interpreter_fail (tis->is); return; } @@ -140,7 +144,7 @@ post_templates_run (void *cls, tis->merchant_url, tis->template_id, tis->template_description, - tis->image, + tis->pos_key, tis->template_contract, &post_templates_cb, tis); @@ -172,8 +176,8 @@ post_templates_traits (void *cls, struct PostTemplatesState *pts = cls; struct TALER_TESTING_Trait traits[] = { TALER_TESTING_make_trait_template_description (&pts->template_description), - TALER_TESTING_make_trait_template_image ( - (const char **) &pts->image), + TALER_TESTING_make_trait_template_pos_key ( + (const char **) &pts->pos_key), TALER_TESTING_make_trait_template_contract (pts->template_contract), TALER_TESTING_make_trait_template_id (&pts->template_id), TALER_TESTING_trait_end (), @@ -205,7 +209,7 @@ post_templates_cleanup (void *cls, "POST /templates operation did not complete\n"); TALER_MERCHANT_templates_post_cancel (tis->iph); } - GNUNET_free (tis->image); + GNUNET_free (tis->pos_key); json_decref (tis->template_contract); GNUNET_free (tis); } @@ -217,7 +221,7 @@ TALER_TESTING_cmd_merchant_post_templates2 ( const char *merchant_url, const char *template_id, const char *template_description, - const char *image, + const char *pos_key, json_t *template_contract, unsigned int http_status) { @@ -231,7 +235,7 @@ TALER_TESTING_cmd_merchant_post_templates2 ( tis->template_id = template_id; tis->http_status = http_status; tis->template_description = template_description; - tis->image = (NULL == image) ? NULL : GNUNET_strdup (image); + tis->pos_key = (NULL == pos_key) ? NULL : GNUNET_strdup (pos_key); tis->template_contract = template_contract; { struct TALER_TESTING_Command cmd = { |