indentation and logging fixes

This commit is contained in:
Christian Grothoff 2020-08-10 08:10:44 +02:00
parent c2a0196f16
commit a97983ddb1
No known key found for this signature in database
GPG Key ID: 939E6BE1E29FC3CC
4 changed files with 31 additions and 24 deletions

View File

@ -197,9 +197,9 @@ main (int argc,
return 77; return 77;
} }
if (NULL == (bankd = TALER_TESTING_run_bank (CONFIG_FILE_PYBANK, if (NULL == (bankd = TALER_TESTING_run_bank (
bc.exchange_auth. CONFIG_FILE_PYBANK,
wire_gateway_url))) bc.exchange_auth.wire_gateway_url)))
{ {
GNUNET_break (0); GNUNET_break (0);
return 77; return 77;

View File

@ -174,8 +174,8 @@ main (int argc,
else else
cfgfilename = CONFIG_FILE_PYBANK; cfgfilename = CONFIG_FILE_PYBANK;
if (NULL == (twister_url = TALER_TWISTER_prepare_twister if (NULL == (twister_url = TALER_TWISTER_prepare_twister (
(cfgfilename))) cfgfilename)))
{ {
GNUNET_break (0); GNUNET_break (0);
return 77; return 77;
@ -189,7 +189,6 @@ main (int argc,
GNUNET_free (twister_url); GNUNET_free (twister_url);
return 77; return 77;
} }
if (GNUNET_YES == with_fakebank) if (GNUNET_YES == with_fakebank)
{ {
TALER_LOG_DEBUG ("Running against the Fakebank.\n"); TALER_LOG_DEBUG ("Running against the Fakebank.\n");
@ -217,9 +216,9 @@ main (int argc,
return 77; return 77;
} }
if (NULL == (bankd = TALER_TESTING_run_bank (cfgfilename, if (NULL == (bankd = TALER_TESTING_run_bank (
bc.exchange_auth. cfgfilename,
wire_gateway_url))) bc.exchange_auth.wire_gateway_url)))
{ {
GNUNET_break (0); GNUNET_break (0);
GNUNET_free (twister_url); GNUNET_free (twister_url);
@ -227,6 +226,7 @@ main (int argc,
} }
} }
sleep (5);
ret = GNUNET_CONFIGURATION_parse_and_run (cfgfilename, ret = GNUNET_CONFIGURATION_parse_and_run (cfgfilename,
&setup_with_cfg, &setup_with_cfg,
NULL); NULL);

View File

@ -209,7 +209,7 @@ confirmation_cb (void *cls,
} }
GNUNET_break (0); GNUNET_break (0);
GNUNET_log (GNUNET_ERROR_TYPE_ERROR, GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Fakebank returned HTTP status %u/%d\n", "Bank returned HTTP status %u/%d\n",
http_status, http_status,
(int) ec); (int) ec);
TALER_TESTING_interpreter_fail (is); TALER_TESTING_interpreter_fail (is);
@ -252,8 +252,8 @@ transfer_run (void *cls,
&buf_size); &buf_size);
fts->is = is; fts->is = is;
fts->weh fts->weh
= TALER_BANK_transfer = TALER_BANK_transfer (
(TALER_TESTING_interpreter_get_context (is), TALER_TESTING_interpreter_get_context (is),
&fts->auth, &fts->auth,
buf, buf,
buf_size, buf_size,

View File

@ -44,13 +44,16 @@ TALER_TWISTER_prepare_twister (const char *config_filename)
cfg = GNUNET_CONFIGURATION_create (); cfg = GNUNET_CONFIGURATION_create ();
if (GNUNET_OK != GNUNET_CONFIGURATION_load if (GNUNET_OK !=
(cfg, config_filename)) GNUNET_CONFIGURATION_load (cfg,
config_filename))
TWISTER_FAIL (); TWISTER_FAIL ();
if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_number if (GNUNET_OK !=
(cfg, "twister", GNUNET_CONFIGURATION_get_value_number (cfg,
"HTTP_PORT", &port)) "twister",
"HTTP_PORT",
&port))
{ {
GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
"twister", "twister",
@ -61,8 +64,9 @@ TALER_TWISTER_prepare_twister (const char *config_filename)
GNUNET_CONFIGURATION_destroy (cfg); GNUNET_CONFIGURATION_destroy (cfg);
if (GNUNET_OK != GNUNET_NETWORK_test_port_free if (GNUNET_OK !=
(IPPROTO_TCP, (uint16_t) port)) GNUNET_NETWORK_test_port_free (IPPROTO_TCP,
(uint16_t) port))
{ {
fprintf (stderr, fprintf (stderr,
"Required port %llu not available, skipping.\n", "Required port %llu not available, skipping.\n",
@ -119,8 +123,10 @@ TALER_TWISTER_run_twister (const char *config_filename)
} }
if (GNUNET_SYSERR == GNUNET_OS_process_wait_status if (GNUNET_SYSERR ==
(client_proc, &type, &code)) GNUNET_OS_process_wait_status (client_proc,
&type,
&code))
{ {
GNUNET_OS_process_destroy (client_proc); GNUNET_OS_process_destroy (client_proc);
GNUNET_OS_process_kill (proc, SIGTERM); GNUNET_OS_process_kill (proc, SIGTERM);
@ -131,7 +137,8 @@ TALER_TWISTER_run_twister (const char *config_filename)
if ( (type == GNUNET_OS_PROCESS_EXITED) && if ( (type == GNUNET_OS_PROCESS_EXITED) &&
(0 != code) ) (0 != code) )
{ {
fprintf (stderr, "Failed to check twister works.\n"); GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Failed to check twister works.\n");
GNUNET_OS_process_destroy (client_proc); GNUNET_OS_process_destroy (client_proc);
GNUNET_OS_process_kill (proc, SIGTERM); GNUNET_OS_process_kill (proc, SIGTERM);
GNUNET_OS_process_wait (proc); GNUNET_OS_process_wait (proc);
@ -141,8 +148,8 @@ TALER_TWISTER_run_twister (const char *config_filename)
if ( (type != GNUNET_OS_PROCESS_EXITED) || if ( (type != GNUNET_OS_PROCESS_EXITED) ||
(0 != code) ) (0 != code) )
{ {
fprintf (stderr, "Unexpected error running" GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
" `taler-twister'!\n"); "Unexpected error running `taler-twister'!\n");
GNUNET_OS_process_destroy (client_proc); GNUNET_OS_process_destroy (client_proc);
GNUNET_OS_process_kill (proc, SIGTERM); GNUNET_OS_process_kill (proc, SIGTERM);
GNUNET_OS_process_wait (proc); GNUNET_OS_process_wait (proc);