From 5583b7a0595fe5c91943419ea46260fe7f7b9e9c Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sat, 18 Jan 2020 14:24:55 +0100 Subject: libraries were folded, fold headers as well --- src/include/Makefile.am | 1 - src/include/taler_auditor_service.h | 6 +- src/include/taler_curl_lib.h | 4 +- src/include/taler_exchangedb_plugin.h | 2 +- src/include/taler_mhd_lib.h | 1 - src/include/taler_testing_auditor_lib.h | 172 ----------------------------- src/include/taler_testing_lib.h | 131 ++++++++++++++++++++++ src/lib/auditor_api_deposit_confirmation.c | 2 +- src/lib/auditor_api_exchanges.c | 4 +- src/lib/test_auditor_api.c | 5 +- src/lib/test_auditor_api_version.c | 3 +- src/lib/testing_api_helpers_auditor.c | 3 +- 12 files changed, 144 insertions(+), 190 deletions(-) delete mode 100644 src/include/taler_testing_auditor_lib.h (limited to 'src') diff --git a/src/include/Makefile.am b/src/include/Makefile.am index 08ed62ec7..b8ea0d175 100644 --- a/src/include/Makefile.am +++ b/src/include/Makefile.am @@ -16,7 +16,6 @@ talerinclude_HEADERS = \ taler_exchangedb_plugin.h \ taler_fakebank_lib.h \ taler_json_lib.h \ - taler_testing_auditor_lib.h \ taler_testing_lib.h \ taler_util.h \ taler_mhd_lib.h \ diff --git a/src/include/taler_auditor_service.h b/src/include/taler_auditor_service.h index 012db8ba1..486e7cc4b 100644 --- a/src/include/taler_auditor_service.h +++ b/src/include/taler_auditor_service.h @@ -246,7 +246,7 @@ TALER_AUDITOR_deposit_confirmation (struct TALER_AUDITOR_Handle *auditor, * Cancel a deposit-confirmation permission request. This function cannot be used * on a request handle if a response is already served for it. * - * @param deposit-confirmation the deposit-confirmation permission request handle + * @param deposit_confirmation the deposit-confirmation permission request handle */ void TALER_AUDITOR_deposit_confirmation_cancel (struct @@ -316,10 +316,10 @@ TALER_AUDITOR_list_exchanges (struct TALER_AUDITOR_Handle *auditor, /** - * Cancel a deposit-confirmation permission request. This function cannot be used + * Cancel a list exchanges request. This function cannot be used * on a request handle if a response is already served for it. * - * @param deposit-confirmation the deposit-confirmation permission request handle + * @param leh the list exchanges request handle */ void TALER_AUDITOR_list_exchanges_cancel (struct diff --git a/src/include/taler_curl_lib.h b/src/include/taler_curl_lib.h index a38c0fce1..9fa0005a8 100644 --- a/src/include/taler_curl_lib.h +++ b/src/include/taler_curl_lib.h @@ -54,7 +54,7 @@ struct TALER_CURL_PostContext * Add the @a body as POST data to the easy handle in * @a ctx. * - * @param ctx[in,out] a request context (updated) + * @param[in,out] ctx a request context (updated) * @param eh easy handle to use * @param body JSON body to add to @e ctx * @return #GNUNET_OK on success #GNUNET_SYSERR on failure @@ -68,7 +68,7 @@ TALER_curl_easy_post (struct TALER_CURL_PostContext *ctx, /** * Free the data in @a ctx. * - * @param ctx[in] a request context (updated) + * @param[in] ctx a request context (updated) */ void TALER_curl_easy_post_finished (struct TALER_CURL_PostContext *ctx); diff --git a/src/include/taler_exchangedb_plugin.h b/src/include/taler_exchangedb_plugin.h index 451650d09..27dcc3440 100644 --- a/src/include/taler_exchangedb_plugin.h +++ b/src/include/taler_exchangedb_plugin.h @@ -1543,7 +1543,7 @@ typedef void /** * Function called with information about the exchange's denomination keys. * - * @parma cls closure + * @param cls closure * @param denom_pub public key of the denomination * @param issue detailed information about the denomination (value, expiration times, fees) */ diff --git a/src/include/taler_mhd_lib.h b/src/include/taler_mhd_lib.h index e82d8d75f..fdf60d561 100644 --- a/src/include/taler_mhd_lib.h +++ b/src/include/taler_mhd_lib.h @@ -204,7 +204,6 @@ TALER_MHD_reply_agpl (struct MHD_Connection *connection, * Function to call to handle the request by sending * back static data. * - * @param rh context of the handler * @param connection the MHD connection to handle * @param http_status status code to return * @param mime_type content-type to use diff --git a/src/include/taler_testing_auditor_lib.h b/src/include/taler_testing_auditor_lib.h deleted file mode 100644 index b12cce986..000000000 --- a/src/include/taler_testing_auditor_lib.h +++ /dev/null @@ -1,172 +0,0 @@ -/* - This file is part of TALER - (C) 2018 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as - published by the Free Software Foundation; either version 3, or - (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public - License along with TALER; see the file COPYING. If not, see - -*/ - -/** - * @file include/taler_testing_auditor_lib.h - * @brief API for writing an interpreter to test Taler components - * @author Christian Grothoff - * @author Marcello Stanisci - */ -#ifndef TALER_TESTING_AUDITOR_LIB_H -#define TALER_TESTING_AUDITOR_LIB_H - -#include "taler_util.h" -#include "taler_exchange_service.h" -#include -#include "taler_json_lib.h" -#include - - -/* ********************* Commands ********************* */ - -/** - * Make the "exec-auditor" CMD. - * - * @param label command label. - * @param config_filename configuration filename. - * @return the command. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_exec_auditor (const char *label, - const char *config_filename); - - -/** - * Make the "exec-auditor-dbinit" CMD. Always run with the "-r" option. - * - * @param label command label. - * @param config_filename configuration filename. - * @return the command. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_exec_auditor_dbinit (const char *label, - const char *config_filename); - - -/** - * Make the "exec wire-auditor" CMD. - * - * @param label command label. - * @param config_filename configuration filename. - * @return the command. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_exec_wire_auditor (const char *label, - const char *config_filename); - - -/** - * Create a "deposit-confirmation" command. - * - * @param label command label. - * @param auditor auditor connection. - * @param deposit_reference reference to any operation that can - * provide a coin. - * @param coin_index if @a deposit_reference offers an array of - * coins, this parameter selects which one in that array. - * This value is currently ignored, as only one-coin - * deposits are implemented. - * @param amount_without_fee deposited amount without the fee - * @param expected_response_code expected HTTP response code. - * @return the command. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_deposit_confirmation (const char *label, - struct TALER_AUDITOR_Handle *auditor, - const char *deposit_reference, - unsigned int coin_index, - const char *amount_without_fee, - unsigned int expected_response_code); - - -/** - * Modify a deposit confirmation command to enable retries when we get - * transient errors from the auditor. - * - * @param cmd a deposit confirmation command - * @return the command with retries enabled - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_deposit_confirmation_with_retry (struct TALER_TESTING_Command - cmd); - - -/** - * Create a "list exchanges" command. - * - * @param label command label. - * @param auditor auditor connection. - * @param expected_response_code expected HTTP response code. - * @return the command. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_exchanges (const char *label, - struct TALER_AUDITOR_Handle *auditor, - unsigned int expected_response_code); - - -/** - * Create a "list exchanges" command and check whether - * a particular exchange belongs to the returned bundle. - * - * @param label command label. - * @param auditor auditor connection. - * @param expected_response_code expected HTTP response code. - * @param exchange_url URL of the exchange supposed to - * be included in the response. - * @return the command. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_exchanges_with_url (const char *label, - unsigned int expected_response_code, - const char *exchange_url); - -/** - * Modify an exchanges command to enable retries when we get - * transient errors from the auditor. - * - * @param cmd a deposit confirmation command - * @return the command with retries enabled - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_exchanges_with_retry (struct TALER_TESTING_Command cmd); - - -/* ********************* Helper functions ********************* */ - - -/** - * Install signal handlers plus schedules the main wrapper - * around the "run" method. - * - * @param main_cb the "run" method which contains all the - * commands. - * @param main_cb_cls a closure for "run", typically NULL. - * @param config_filename configuration filename. - * @return #GNUNET_OK if all is okay, != #GNUNET_OK otherwise. - * non-GNUNET_OK codes are #GNUNET_SYSERR most of the - * times. - */ -int -TALER_TESTING_AUDITOR_setup (TALER_TESTING_Main main_cb, - void *main_cb_cls, - const char *config_filename); - - -#endif diff --git a/src/include/taler_testing_lib.h b/src/include/taler_testing_lib.h index 060bbd0a7..6af1b6b90 100644 --- a/src/include/taler_testing_lib.h +++ b/src/include/taler_testing_lib.h @@ -656,6 +656,24 @@ TALER_TESTING_setup (TALER_TESTING_Main main_cb, int exchange_connect); +/** + * Install signal handlers plus schedules the main wrapper + * around the "run" method. + * + * @param main_cb the "run" method which contains all the + * commands. + * @param main_cb_cls a closure for "run", typically NULL. + * @param config_filename configuration filename. + * @return #GNUNET_OK if all is okay, != #GNUNET_OK otherwise. + * non-GNUNET_OK codes are #GNUNET_SYSERR most of the + * times. + */ +int +TALER_TESTING_auditor_setup (TALER_TESTING_Main main_cb, + void *main_cb_cls, + const char *config_filename); + + /** * Closure for #TALER_TESTING_setup_with_exchange_cfg(). */ @@ -868,6 +886,119 @@ TALER_TESTING_cmd_transfer (const char *label, const char *exchange_base_url); +/** + * Make the "exec-auditor" CMD. + * + * @param label command label. + * @param config_filename configuration filename. + * @return the command. + */ +struct TALER_TESTING_Command +TALER_TESTING_cmd_exec_auditor (const char *label, + const char *config_filename); + + +/** + * Make the "exec-auditor-dbinit" CMD. Always run with the "-r" option. + * + * @param label command label. + * @param config_filename configuration filename. + * @return the command. + */ +struct TALER_TESTING_Command +TALER_TESTING_cmd_exec_auditor_dbinit (const char *label, + const char *config_filename); + + +/** + * Make the "exec wire-auditor" CMD. + * + * @param label command label. + * @param config_filename configuration filename. + * @return the command. + */ +struct TALER_TESTING_Command +TALER_TESTING_cmd_exec_wire_auditor (const char *label, + const char *config_filename); + + +/** + * Create a "deposit-confirmation" command. + * + * @param label command label. + * @param auditor auditor connection. + * @param deposit_reference reference to any operation that can + * provide a coin. + * @param coin_index if @a deposit_reference offers an array of + * coins, this parameter selects which one in that array. + * This value is currently ignored, as only one-coin + * deposits are implemented. + * @param amount_without_fee deposited amount without the fee + * @param expected_response_code expected HTTP response code. + * @return the command. + */ +struct TALER_TESTING_Command +TALER_TESTING_cmd_deposit_confirmation (const char *label, + struct TALER_AUDITOR_Handle *auditor, + const char *deposit_reference, + unsigned int coin_index, + const char *amount_without_fee, + unsigned int expected_response_code); + + +/** + * Modify a deposit confirmation command to enable retries when we get + * transient errors from the auditor. + * + * @param cmd a deposit confirmation command + * @return the command with retries enabled + */ +struct TALER_TESTING_Command +TALER_TESTING_cmd_deposit_confirmation_with_retry (struct TALER_TESTING_Command + cmd); + + +/** + * Create a "list exchanges" command. + * + * @param label command label. + * @param auditor auditor connection. + * @param expected_response_code expected HTTP response code. + * @return the command. + */ +struct TALER_TESTING_Command +TALER_TESTING_cmd_exchanges (const char *label, + struct TALER_AUDITOR_Handle *auditor, + unsigned int expected_response_code); + + +/** + * Create a "list exchanges" command and check whether + * a particular exchange belongs to the returned bundle. + * + * @param label command label. + * @param auditor auditor connection. + * @param expected_response_code expected HTTP response code. + * @param exchange_url URL of the exchange supposed to + * be included in the response. + * @return the command. + */ +struct TALER_TESTING_Command +TALER_TESTING_cmd_exchanges_with_url (const char *label, + unsigned int expected_response_code, + const char *exchange_url); + +/** + * Modify an exchanges command to enable retries when we get + * transient errors from the auditor. + * + * @param cmd a deposit confirmation command + * @return the command with retries enabled + */ +struct TALER_TESTING_Command +TALER_TESTING_cmd_exchanges_with_retry (struct TALER_TESTING_Command cmd); + + /* ***** Commands ONLY for testing (/admin-API) **** */ /** diff --git a/src/lib/auditor_api_deposit_confirmation.c b/src/lib/auditor_api_deposit_confirmation.c index b1a5bacc6..dff17893a 100644 --- a/src/lib/auditor_api_deposit_confirmation.c +++ b/src/lib/auditor_api_deposit_confirmation.c @@ -383,7 +383,7 @@ TALER_AUDITOR_deposit_confirmation (struct TALER_AUDITOR_Handle *auditor, * Cancel a deposit-confirmation permission request. This function cannot be used * on a request handle if a response is already served for it. * - * @param deposit-confirmation the deposit-confirmation permission request handle + * @param deposit_confirmation the deposit-confirmation permission request handle */ void TALER_AUDITOR_deposit_confirmation_cancel (struct diff --git a/src/lib/auditor_api_exchanges.c b/src/lib/auditor_api_exchanges.c index 4dfd5cdcd..1f5e49f13 100644 --- a/src/lib/auditor_api_exchanges.c +++ b/src/lib/auditor_api_exchanges.c @@ -224,10 +224,10 @@ TALER_AUDITOR_list_exchanges (struct TALER_AUDITOR_Handle *auditor, /** - * Cancel a deposit-confirmation permission request. This function cannot be used + * Cancel a list exchanges request. This function cannot be used * on a request handle if a response is already served for it. * - * @param deposit-confirmation the deposit-confirmation permission request handle + * @param leh the list exchanges request handle */ void TALER_AUDITOR_list_exchanges_cancel (struct diff --git a/src/lib/test_auditor_api.c b/src/lib/test_auditor_api.c index 8302897c6..ac3a6459a 100644 --- a/src/lib/test_auditor_api.c +++ b/src/lib/test_auditor_api.c @@ -16,7 +16,6 @@ License along with TALER; see the file COPYING. If not, see */ - /** * @file lib/test_auditor_api.c * @brief testcase to test auditor's HTTP API interface @@ -34,7 +33,7 @@ #include "taler_bank_service.h" #include "taler_fakebank_lib.h" #include "taler_testing_lib.h" -#include "taler_testing_auditor_lib.h" + /** * Configuration file we use. One (big) configuration is used @@ -695,7 +694,7 @@ main (int argc, * start/stop the exchange. It calls TALER_TESTING_setup * which creates the 'is' object. */ - TALER_TESTING_AUDITOR_setup (&run, + TALER_TESTING_auditor_setup (&run, NULL, CONFIG_FILE)) return 1; diff --git a/src/lib/test_auditor_api_version.c b/src/lib/test_auditor_api_version.c index 9dc0fbc72..be85455d7 100644 --- a/src/lib/test_auditor_api_version.c +++ b/src/lib/test_auditor_api_version.c @@ -16,7 +16,6 @@ License along with TALER; see the file COPYING. If not, see */ - /** * @file lib/test_auditor_api_version.c * @brief testcase to test auditor's HTTP API interface to fetch /version @@ -34,7 +33,7 @@ #include "taler_bank_service.h" #include "taler_fakebank_lib.h" #include "taler_testing_lib.h" -#include "taler_testing_auditor_lib.h" + /** * Configuration file we use. One (big) configuration is used diff --git a/src/lib/testing_api_helpers_auditor.c b/src/lib/testing_api_helpers_auditor.c index ab5625b66..ff85c0c85 100644 --- a/src/lib/testing_api_helpers_auditor.c +++ b/src/lib/testing_api_helpers_auditor.c @@ -25,7 +25,6 @@ #include "taler_json_lib.h" #include #include "taler_testing_lib.h" -#include "taler_testing_auditor_lib.h" #include "taler_auditor_service.h" @@ -212,7 +211,7 @@ setup_with_cfg (void *cls, * times. */ int -TALER_TESTING_AUDITOR_setup (TALER_TESTING_Main main_cb, +TALER_TESTING_auditor_setup (TALER_TESTING_Main main_cb, void *main_cb_cls, const char *config_filename) { -- cgit v1.2.3