diff options
Diffstat (limited to 'src/testing/testing_api_cmd_get_webhook.c')
-rw-r--r-- | src/testing/testing_api_cmd_get_webhook.c | 35 |
1 files changed, 21 insertions, 14 deletions
diff --git a/src/testing/testing_api_cmd_get_webhook.c b/src/testing/testing_api_cmd_get_webhook.c index 7acc344e..aef6c555 100644 --- a/src/testing/testing_api_cmd_get_webhook.c +++ b/src/testing/testing_api_cmd_get_webhook.c @@ -105,7 +105,7 @@ get_webhook_cb (void *cls, { case MHD_HTTP_OK: { - const char **expected_event_type; + const char *expected_event_type; webhook_cmd = TALER_TESTING_interpreter_lookup_command ( gis->is, @@ -114,8 +114,8 @@ 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, - *expected_event_type)) + if (0 != strcmp (event_type, + expected_event_type)) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Event type does not match\n"); @@ -124,14 +124,14 @@ get_webhook_cb (void *cls, } } { - const char **expected_url; + const char *expected_url; if (GNUNET_OK != TALER_TESTING_get_trait_url (webhook_cmd, &expected_url)) TALER_TESTING_interpreter_fail (gis->is); if (0 != strcmp (url, - *expected_url)) + expected_url)) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "URL does not match\n"); @@ -140,14 +140,14 @@ get_webhook_cb (void *cls, } } { - const char **expected_http_method; + const char *expected_http_method; if (GNUNET_OK != TALER_TESTING_get_trait_http_method (webhook_cmd, &expected_http_method)) TALER_TESTING_interpreter_fail (gis->is); if (0 != strcmp (http_method, - *expected_http_method)) + expected_http_method)) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "http_method does not match\n"); @@ -156,14 +156,17 @@ get_webhook_cb (void *cls, } } { - const char **expected_header_template; + const char *expected_header_template; if (GNUNET_OK != 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"); @@ -172,14 +175,17 @@ get_webhook_cb (void *cls, } } { - const char **expected_body_template; + const char *expected_body_template; if (GNUNET_OK != 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"); @@ -216,7 +222,8 @@ get_webhook_run (void *cls, struct GetWebhookState *gis = cls; gis->is = is; - gis->igh = TALER_MERCHANT_webhook_get (is->ctx, + gis->igh = TALER_MERCHANT_webhook_get (TALER_TESTING_interpreter_get_context ( + is), gis->merchant_url, gis->webhook_id, &get_webhook_cb, |