diff options
author | Christian Grothoff <christian@grothoff.org> | 2023-02-19 11:47:07 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2023-02-19 11:47:07 +0100 |
commit | fdf1da57b25121dadeb110f013caf55d0de43046 (patch) | |
tree | ad2c7166756281f6051b6698d860e0797e0b2201 /src/testing/testing_api_cmd_checkserver.c | |
parent | 1954f2dee9545c89012dc3215769f044f323dc92 (diff) |
-doxygen fixes and configuration fixes
Diffstat (limited to 'src/testing/testing_api_cmd_checkserver.c')
-rw-r--r-- | src/testing/testing_api_cmd_checkserver.c | 141 |
1 files changed, 60 insertions, 81 deletions
diff --git a/src/testing/testing_api_cmd_checkserver.c b/src/testing/testing_api_cmd_checkserver.c index 1414bd1d..55f0b50d 100644 --- a/src/testing/testing_api_cmd_checkserver.c +++ b/src/testing/testing_api_cmd_checkserver.c @@ -33,7 +33,7 @@ /** - * State for a "check_aml_decision" CMD. + * State for a "checkserver" CMD. */ struct CheckState { @@ -60,22 +60,22 @@ struct CheckState /** * Expected method of the pending webhook. */ - char *expected_method; + const char *expected_method; /** * Expected url of the pending webhook. */ - char *expected_url; + const char *expected_url; /** * Expected header of the pending webhook. */ - char *expected_header; + const char *expected_header; /** * Expected body of the pending webhook. */ - char *expected_body; + const char *expected_body; }; @@ -93,56 +93,52 @@ checkserver_run (void *cls, { struct CheckState *cs = cls; const struct TALER_TESTING_Command *ref; + char **expected_url; + char **expected_http_method; + char **expected_header; + char **expected_body; + (void) cmd; cs->is = is; - ref = TALER_TESTING_interpreter_lookup_command (is, cs->ref_operation); - - if (NULL == ref) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, - "ref NULL\n"); + "ref NULL\n"); GNUNET_break (0); TALER_TESTING_interpreter_fail (is); return; } - - char **expected_url; if (GNUNET_OK != TALER_TESTING_get_trait_urls (ref, cs->index, &expected_url)) - { - GNUNET_log (GNUNET_ERROR_TYPE_ERROR, - "Trait url does not work\n"); - GNUNET_break (0); - TALER_TESTING_interpreter_fail (is); - return; - } + { + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + "Trait url does not work\n"); + GNUNET_break (0); + TALER_TESTING_interpreter_fail (is); + return; + } if (NULL == *expected_url) - { - GNUNET_log (GNUNET_ERROR_TYPE_ERROR, - "Trait for url is NULL!?\n"); - GNUNET_break (0); - TALER_TESTING_interpreter_fail (is); - return; - } - + { + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + "Trait for url is NULL!?\n"); + GNUNET_break (0); + TALER_TESTING_interpreter_fail (is); + return; + } if (0 != strcmp (cs->expected_url, *expected_url)) - { - GNUNET_log (GNUNET_ERROR_TYPE_ERROR, - "URL does not match: `%s' != `%s'\n", - cs->expected_url, - *expected_url); - TALER_TESTING_interpreter_fail (is); - return; - } - - char **expected_http_method; - + { + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + "URL does not match: `%s' != `%s'\n", + cs->expected_url, + *expected_url); + TALER_TESTING_interpreter_fail (is); + return; + } if (GNUNET_OK != TALER_TESTING_get_trait_http_methods (ref, cs->index, @@ -150,16 +146,12 @@ checkserver_run (void *cls, TALER_TESTING_interpreter_fail (is); if (0 != strcmp (cs->expected_method, *expected_http_method)) - { - GNUNET_log (GNUNET_ERROR_TYPE_ERROR, - "http_method does not match\n"); - TALER_TESTING_interpreter_fail (is); - return; - } - - - char **expected_header; - + { + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + "http_method does not match\n"); + TALER_TESTING_interpreter_fail (is); + return; + } if (GNUNET_OK != TALER_TESTING_get_trait_http_header (ref, cs->index, @@ -170,17 +162,14 @@ checkserver_run (void *cls, ( (NULL != cs->expected_header) && (0 != strcmp (cs->expected_header, *expected_header)) ) ) - { - GNUNET_log (GNUNET_ERROR_TYPE_ERROR, - "header does not match: `%s' != `%s'\n", - cs->expected_header, - *expected_header); - TALER_TESTING_interpreter_fail (is); - return; - } - - char **expected_body; - + { + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + "header does not match: `%s' != `%s'\n", + cs->expected_header, + *expected_header); + TALER_TESTING_interpreter_fail (is); + return; + } if (GNUNET_OK != TALER_TESTING_get_trait_http_body (ref, cs->index, @@ -191,38 +180,27 @@ checkserver_run (void *cls, ( (NULL != cs->expected_body) && (0 != strcmp (cs->expected_body, *expected_body) ) ) ) - { - GNUNET_log (GNUNET_ERROR_TYPE_ERROR, - "body does not match : `%s' and `%s'\n", - cs->expected_body, - *expected_body); - TALER_TESTING_interpreter_fail (is); - return; - } + { + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + "body does not match : `%s' and `%s'\n", + cs->expected_body, + *expected_body); + TALER_TESTING_interpreter_fail (is); + return; + } TALER_TESTING_interpreter_next (is); } -/** - * This function is used to check the web server - * - * @param label command label - * @param ref_operation reference to command to the previous set server status operation. - * @param index index to know which web server we check. - * @param url of the webhook - * @param http_method of the webhook - * @param header of the webhook - * @param body of the webhook - */ struct TALER_TESTING_Command TALER_TESTING_cmd_checkserver2 (const char *label, const char *ref_operation, unsigned int index, - char *expected_url, - char *expected_method, - char *expected_header, - char *expected_body) + const char *expected_url, + const char *expected_method, + const char *expected_header, + const char *expected_body) { struct CheckState *cs; @@ -260,4 +238,5 @@ TALER_TESTING_cmd_checkserver (const char *label, "5.0 EUR"); } + /* end of testing_api_cmd_checkserver.c */ |