diff options
author | Christian Grothoff <christian@grothoff.org> | 2019-10-05 15:42:08 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2019-10-05 15:42:08 +0200 |
commit | b46fe9aa21d0bd3624284be00f72f1de0d510b67 (patch) | |
tree | 368b65ff113b8ead3572adb816fb716317611179 /src/bank-lib | |
parent | 52bbfe926be03f66d57d15743e9914bc4e201c8c (diff) |
reindenting with uncrustify
Diffstat (limited to 'src/bank-lib')
-rw-r--r-- | src/bank-lib/bank_api_history.c | 21 | ||||
-rw-r--r-- | src/bank-lib/test_bank_api_new.c | 113 | ||||
-rw-r--r-- | src/bank-lib/test_bank_api_twisted.c | 11 |
3 files changed, 61 insertions, 84 deletions
diff --git a/src/bank-lib/bank_api_history.c b/src/bank-lib/bank_api_history.c index 88effc44a..a29598a30 100644 --- a/src/bank-lib/bank_api_history.c +++ b/src/bank-lib/bank_api_history.c @@ -369,17 +369,16 @@ conv_cancel (enum TALER_BANK_Direction direction) * called. */ struct TALER_BANK_HistoryHandle * -TALER_BANK_history_range - (struct GNUNET_CURL_Context *ctx, - const char *bank_base_url, - const struct TALER_BANK_AuthenticationData *auth, - uint64_t account_number, - enum TALER_BANK_Direction direction, - unsigned int ascending, - struct GNUNET_TIME_Absolute start_date, - struct GNUNET_TIME_Absolute end_date, - TALER_BANK_HistoryResultCallback hres_cb, - void *hres_cb_cls) +TALER_BANK_history_range (struct GNUNET_CURL_Context *ctx, + const char *bank_base_url, + const struct TALER_BANK_AuthenticationData *auth, + uint64_t account_number, + enum TALER_BANK_Direction direction, + unsigned int ascending, + struct GNUNET_TIME_Absolute start_date, + struct GNUNET_TIME_Absolute end_date, + TALER_BANK_HistoryResultCallback hres_cb, + void *hres_cb_cls) { struct TALER_BANK_HistoryHandle *hh; char *url; diff --git a/src/bank-lib/test_bank_api_new.c b/src/bank-lib/test_bank_api_new.c index 5c7920b76..31602a1ee 100644 --- a/src/bank-lib/test_bank_api_new.c +++ b/src/bank-lib/test_bank_api_new.c @@ -57,6 +57,26 @@ static struct GNUNET_OS_Process *bankd; static int WITH_FAKEBANK; /** + * Transfer @a amount from @a src account to @a dst using + * @a subject and the @a label for the command. + */ +#define TRANSFER(label,amount,src,dst,subject) \ + TALER_TESTING_cmd_fakebank_transfer_with_subject (label, \ + amount, \ + bank_url, \ + src, \ + dst, \ + AUTHS[src \ + - 1].details.basic. \ + username, \ + AUTHS[src \ + - 1].details.basic. \ + password, \ + subject, \ + "http://exchange.net/") + + +/** * Main function that will tell the interpreter what commands to * run. * @@ -70,9 +90,7 @@ run (void *cls, "Bank serves at `%s'\n", bank_url); extern struct TALER_BANK_AuthenticationData AUTHS[]; - struct TALER_TESTING_Command commands[] = { - TALER_TESTING_cmd_bank_history ("history-0", bank_url, BANK_ACCOUNT_NUMBER, @@ -80,20 +98,13 @@ run (void *cls, GNUNET_YES, NULL, 1), - /* WARNING: old API has expected http response code among * the parameters, although it was always set as '200 OK' */ - TALER_TESTING_cmd_fakebank_transfer_with_subject - ("debit-1", - "KUDOS:5.01", - bank_url, - EXCHANGE_ACCOUNT_NUMBER, - BANK_ACCOUNT_NUMBER, - AUTHS[EXCHANGE_ACCOUNT_NUMBER - 1].details.basic.username, - AUTHS[EXCHANGE_ACCOUNT_NUMBER - 1].details.basic.password, - "subject 1", - "http://exchange.com/"), - + TRANSFER ("debit-1", + "KUDOS:5.01", + EXCHANGE_ACCOUNT_NUMBER, + BANK_ACCOUNT_NUMBER, + "subject 1"), TALER_TESTING_cmd_bank_history ("history-1c", bank_url, BANK_ACCOUNT_NUMBER, @@ -101,7 +112,6 @@ run (void *cls, GNUNET_YES, NULL, 5), - TALER_TESTING_cmd_bank_history ("history-1d", bank_url, BANK_ACCOUNT_NUMBER, @@ -109,29 +119,16 @@ run (void *cls, GNUNET_YES, NULL, 5), - - TALER_TESTING_cmd_fakebank_transfer_with_subject - ("debit-2", - "KUDOS:3.21", - bank_url, - EXCHANGE_ACCOUNT_NUMBER, // debit account. - USER_ACCOUNT_NUMBER, - AUTHS[EXCHANGE_ACCOUNT_NUMBER - 1].details.basic.username, - AUTHS[EXCHANGE_ACCOUNT_NUMBER - 1].details.basic.password, - "subject 2", - "http://exchange.org/"), - - TALER_TESTING_cmd_fakebank_transfer_with_subject - ("credit-2", - "KUDOS:3.22", - bank_url, - USER_ACCOUNT_NUMBER, // debit account. - EXCHANGE_ACCOUNT_NUMBER, - AUTHS[USER_ACCOUNT_NUMBER - 1].details.basic.username, - AUTHS[USER_ACCOUNT_NUMBER - 1].details.basic.password, - "credit 2", - "http://exchange.org/"), - + TRANSFER ("debit-2", + "KUDOS:3.21", + EXCHANGE_ACCOUNT_NUMBER, + USER_ACCOUNT_NUMBER, + "subject 2"), + TRANSFER ("credit-2", + "KUDOS:3.22", + USER_ACCOUNT_NUMBER, + EXCHANGE_ACCOUNT_NUMBER, + "credit 2"), TALER_TESTING_cmd_bank_history ("history-2b", bank_url, EXCHANGE_ACCOUNT_NUMBER, @@ -139,7 +136,6 @@ run (void *cls, GNUNET_YES, NULL, 5), - TALER_TESTING_cmd_bank_history ("history-2bi", bank_url, EXCHANGE_ACCOUNT_NUMBER, @@ -147,22 +143,14 @@ run (void *cls, GNUNET_YES, "debit-1", 5), - - TALER_TESTING_cmd_fakebank_transfer_with_subject - ("credit-for-reject-1", - "KUDOS:1.01", - bank_url, - BANK_ACCOUNT_NUMBER, - EXCHANGE_ACCOUNT_NUMBER, - AUTHS[BANK_ACCOUNT_NUMBER - 1].details.basic.username, - AUTHS[BANK_ACCOUNT_NUMBER - 1].details.basic.password, - "subject 3", - "http://exchange.net/"), - + TRANSFER ("credit-for-reject-1", + "KUDOS:1.01", + BANK_ACCOUNT_NUMBER, + EXCHANGE_ACCOUNT_NUMBER, + "subject 3"), TALER_TESTING_cmd_bank_reject ("reject-1", bank_url, "credit-for-reject-1"), - TALER_TESTING_cmd_bank_history ("history-r1", bank_url, BANK_ACCOUNT_NUMBER, @@ -170,7 +158,6 @@ run (void *cls, GNUNET_YES, NULL, 5), - TALER_TESTING_cmd_bank_history ("history-r1c", bank_url, BANK_ACCOUNT_NUMBER, @@ -179,11 +166,6 @@ run (void *cls, GNUNET_YES, NULL, 5), - - /** - * End the suite. Fixme: better to have a label for this - * too, as it shows a "(null)" token on logs. - */ TALER_TESTING_cmd_end () }; @@ -213,9 +195,8 @@ main (int argc, if (GNUNET_YES == WITH_FAKEBANK) { TALER_LOG_DEBUG ("Running against the Fakebank.\n"); - if (NULL == (bank_url = TALER_TESTING_prepare_fakebank - (CONFIG_FILE, - "account-1"))) + if (NULL == (bank_url = TALER_TESTING_prepare_fakebank (CONFIG_FILE, + "account-1"))) { GNUNET_break (0); return 77; @@ -224,16 +205,14 @@ main (int argc, else { TALER_LOG_DEBUG ("Running against the Pybank.\n"); - if (NULL == (bank_url = TALER_TESTING_prepare_bank - (CONFIG_FILE))) + if (NULL == (bank_url = TALER_TESTING_prepare_bank (CONFIG_FILE))) { GNUNET_break (0); return 77; } - if (NULL == (bankd = TALER_TESTING_run_bank - (CONFIG_FILE, - bank_url))) + if (NULL == (bankd = TALER_TESTING_run_bank (CONFIG_FILE, + bank_url))) { GNUNET_break (0); return 77; @@ -254,7 +233,7 @@ main (int argc, GNUNET_OS_process_destroy (bankd); GNUNET_free (bank_url); } - + return rv; } diff --git a/src/bank-lib/test_bank_api_twisted.c b/src/bank-lib/test_bank_api_twisted.c index e971584f6..49ce94164 100644 --- a/src/bank-lib/test_bank_api_twisted.c +++ b/src/bank-lib/test_bank_api_twisted.c @@ -161,8 +161,8 @@ main (int argc, { TALER_LOG_DEBUG ("Running against the Fakebank.\n"); if (NULL == (bank_url = TALER_TESTING_prepare_fakebank - (CONFIG_FILE, - "account-1"))) + (CONFIG_FILE, + "account-1"))) { GNUNET_break (0); GNUNET_free (twister_url); @@ -173,16 +173,15 @@ main (int argc, { TALER_LOG_DEBUG ("Running against the Pybank.\n"); if (NULL == (bank_url = TALER_TESTING_prepare_bank - (CONFIG_FILE))) + (CONFIG_FILE))) { GNUNET_break (0); GNUNET_free (twister_url); return 77; } - if (NULL == (bankd = TALER_TESTING_run_bank - (CONFIG_FILE, - bank_url))) + if (NULL == (bankd = TALER_TESTING_run_bank (CONFIG_FILE, + bank_url))) { GNUNET_break (0); GNUNET_free (twister_url); |