diff options
author | priscilla <priscilla.huang@efrei.net> | 2023-02-01 04:46:35 -0500 |
---|---|---|
committer | priscilla <priscilla.huang@efrei.net> | 2023-02-01 04:46:52 -0500 |
commit | 8b18850523c9a2303c348b2ede777f012f610fda (patch) | |
tree | 989c9be16261ec781397a280b5ff3fd6d8db833b /src/testing | |
parent | 9a651aeea9cf20233a9488e45ddd11bba5f3ea68 (diff) | |
download | merchant-8b18850523c9a2303c348b2ede777f012f610fda.tar.gz merchant-8b18850523c9a2303c348b2ede777f012f610fda.tar.bz2 merchant-8b18850523c9a2303c348b2ede777f012f610fda.zip |
update from the file testing
Diffstat (limited to 'src/testing')
-rw-r--r-- | src/testing/testing_api_cmd_get_webhook.c | 16 | ||||
-rw-r--r-- | src/testing/testing_api_cmd_patch_webhook.c | 4 | ||||
-rw-r--r-- | src/testing/testing_api_cmd_post_webhooks.c | 4 |
3 files changed, 15 insertions, 9 deletions
diff --git a/src/testing/testing_api_cmd_get_webhook.c b/src/testing/testing_api_cmd_get_webhook.c index 7acc344e..b28a075e 100644 --- a/src/testing/testing_api_cmd_get_webhook.c +++ b/src/testing/testing_api_cmd_get_webhook.c @@ -114,7 +114,7 @@ get_webhook_cb (void *cls, TALER_TESTING_get_trait_event_type (webhook_cmd, &expected_event_type)) TALER_TESTING_interpreter_fail (gis->is); - if (0 != strcmp (event_type, + if (0 != strcmp (event_type, *expected_event_type)) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, @@ -162,8 +162,11 @@ get_webhook_cb (void *cls, TALER_TESTING_get_trait_header_template (webhook_cmd, &expected_header_template)) TALER_TESTING_interpreter_fail (gis->is); - if (0 != strcmp (header_template, - *expected_header_template)) + if ( ( (NULL == header_template) && (NULL != *expected_header_template)) || + ( (NULL != header_template) && (NULL == expected_header_template)) || + ( (NULL != header_template) && + (0 != strcmp (header_template, + *expected_header_template)) ) ) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "header template does not match\n"); @@ -178,8 +181,11 @@ get_webhook_cb (void *cls, TALER_TESTING_get_trait_body_template (webhook_cmd, &expected_body_template)) TALER_TESTING_interpreter_fail (gis->is); - if (0 != strcmp (body_template, - *expected_body_template)) + if ( ( (NULL == body_template) && (NULL != *expected_body_template)) || + ( (NULL != body_template) && (NULL == expected_body_template)) || + ( (NULL != body_template) && + (0 != strcmp (body_template, + *expected_body_template)) ) ) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "body template does not match\n"); diff --git a/src/testing/testing_api_cmd_patch_webhook.c b/src/testing/testing_api_cmd_patch_webhook.c index a2fea433..8cbcc6b1 100644 --- a/src/testing/testing_api_cmd_patch_webhook.c +++ b/src/testing/testing_api_cmd_patch_webhook.c @@ -239,8 +239,8 @@ TALER_TESTING_cmd_merchant_patch_webhook ( pis->event_type = event_type; pis->url = url; pis->http_method = http_method; - pis->header_template = header_template; - pis->body_template = body_template; + pis->header_template = (NULL == header_template) ? NULL : header_template; + pis->body_template = (NULL == body_template) ? NULL : body_template; { struct TALER_TESTING_Command cmd = { .cls = pis, diff --git a/src/testing/testing_api_cmd_post_webhooks.c b/src/testing/testing_api_cmd_post_webhooks.c index d1628429..9f7c36b7 100644 --- a/src/testing/testing_api_cmd_post_webhooks.c +++ b/src/testing/testing_api_cmd_post_webhooks.c @@ -240,8 +240,8 @@ TALER_TESTING_cmd_merchant_post_webhooks2 ( wis->event_type = event_type; wis->url = url; wis->http_method = http_method; - wis->header_template = header_template; - wis->body_template = body_template; + wis->header_template = (NULL==header_template) ? NULL : header_template; + wis->body_template = (NULL==body_template) ? NULL : body_template; { struct TALER_TESTING_Command cmd = { .cls = wis, |