diff options
Diffstat (limited to 'src/testing')
| -rw-r--r-- | src/testing/testing_api_cmd_deposit.c | 18 | ||||
| -rw-r--r-- | src/testing/testing_api_helpers_exchange.c | 3 | ||||
| -rw-r--r-- | src/testing/testing_api_loop.c | 31 | 
3 files changed, 28 insertions, 24 deletions
diff --git a/src/testing/testing_api_cmd_deposit.c b/src/testing/testing_api_cmd_deposit.c index 2b9486ca..2f55a318 100644 --- a/src/testing/testing_api_cmd_deposit.c +++ b/src/testing/testing_api_cmd_deposit.c @@ -241,6 +241,7 @@ deposit_cb (void *cls,            ds->backoff = GNUNET_TIME_randomized_backoff (ds->backoff,                                                          MAX_BACKOFF);          ds->is->commands[ds->is->ip].num_tries++; +        GNUNET_assert (NULL == ds->retry_task);          ds->retry_task            = GNUNET_SCHEDULER_add_delayed (ds->backoff,                                            &do_retry, @@ -452,6 +453,7 @@ deposit_run (void *cls,                                 coin_priv,                                 &coin_sig);    } +  GNUNET_assert (NULL == ds->dh);    ds->dh = TALER_EXCHANGE_deposit (is->exchange,                                     &ds->amount,                                     ds->wire_deadline, @@ -552,14 +554,14 @@ deposit_traits (void *cls,      TALER_TESTING_interpreter_fail (ds->is);      return GNUNET_NO;    } -  if (GNUNET_OK != -      TALER_TESTING_get_trait_coin_priv (coin_cmd, -                                         ds->coin_index, -                                         &coin_spent_priv) || -      (GNUNET_OK != -       TALER_TESTING_get_trait_age_commitment_proof (coin_cmd, -                                                     ds->coin_index, -                                                     &age_commitment_proof))) +  if ( (GNUNET_OK != +        TALER_TESTING_get_trait_coin_priv (coin_cmd, +                                           ds->coin_index, +                                           &coin_spent_priv)) || +       (GNUNET_OK != +        TALER_TESTING_get_trait_age_commitment_proof (coin_cmd, +                                                      ds->coin_index, +                                                      &age_commitment_proof)) )    {      GNUNET_break (0);      TALER_TESTING_interpreter_fail (ds->is); diff --git a/src/testing/testing_api_helpers_exchange.c b/src/testing/testing_api_helpers_exchange.c index c2c5136e..c47a1c2f 100644 --- a/src/testing/testing_api_helpers_exchange.c +++ b/src/testing/testing_api_helpers_exchange.c @@ -720,7 +720,8 @@ TALER_TESTING_setup_with_exchange_cfg (      return GNUNET_NO;    } -  if (0 == strcmp ("tcp", serve)) +  if (0 == strcmp ("tcp", +                   serve))    {      if (GNUNET_OK !=          GNUNET_CONFIGURATION_get_value_number (cfg, diff --git a/src/testing/testing_api_loop.c b/src/testing/testing_api_loop.c index 784d3c9e..0cd1fa51 100644 --- a/src/testing/testing_api_loop.c +++ b/src/testing/testing_api_loop.c @@ -270,17 +270,14 @@ do_shutdown (void *cls)    label = is->commands[is->ip].label;    if (NULL == label)      label = "END"; -    GNUNET_log (GNUNET_ERROR_TYPE_INFO,                "Executing shutdown at `%s'\n",                label); -    for (unsigned int j = 0;         NULL != (cmd = &is->commands[j])->label;         j++)      cmd->cleanup (cmd->cls,                    cmd); -    if (NULL != is->exchange)    {      TALER_LOG_DEBUG ("Disconnecting the exchange\n"); @@ -292,6 +289,11 @@ do_shutdown (void *cls)      GNUNET_SCHEDULER_cancel (is->task);      is->task = NULL;    } +  if (NULL != is->fakebank) +  { +    TALER_FAKEBANK_stop (is->fakebank); +    is->fakebank = NULL; +  }    if (NULL != is->ctx)    {      GNUNET_CURL_fini (is->ctx); @@ -312,11 +314,6 @@ do_shutdown (void *cls)      GNUNET_SCHEDULER_cancel (is->child_death_task);      is->child_death_task = NULL;    } -  if (NULL != is->fakebank) -  { -    TALER_FAKEBANK_stop (is->fakebank); -    is->fakebank = NULL; -  }    GNUNET_free (is->commands);  } @@ -620,6 +617,11 @@ do_abort (void *cls)      TALER_EXCHANGE_disconnect (is->exchange);      is->exchange = NULL;    } +  if (NULL != is->fakebank) +  { +    TALER_FAKEBANK_stop (is->fakebank); +    is->fakebank = NULL; +  }    if (NULL != is->ctx)    {      GNUNET_CURL_fini (is->ctx); @@ -822,18 +824,17 @@ TALER_TESTING_setup (TALER_TESTING_Main main_cb,      return GNUNET_SYSERR;    sigpipe = GNUNET_DISK_pipe (GNUNET_DISK_PF_NONE);    GNUNET_assert (NULL != sigpipe); -  shc_chld = GNUNET_SIGNAL_handler_install -               (GNUNET_SIGCHLD, -               &sighandler_child_death); -  is.ctx = GNUNET_CURL_init -             (&GNUNET_CURL_gnunet_scheduler_reschedule, -             &is.rc); +  shc_chld = GNUNET_SIGNAL_handler_install ( +    GNUNET_SIGCHLD, +    &sighandler_child_death); +  is.ctx = GNUNET_CURL_init ( +    &GNUNET_CURL_gnunet_scheduler_reschedule, +    &is.rc);    GNUNET_CURL_enable_async_scope_header (is.ctx,                                           "Taler-Correlation-Id");    GNUNET_assert (NULL != is.ctx);    is.rc = GNUNET_CURL_gnunet_rc_create (is.ctx); -    /* Blocking */    if (GNUNET_YES == exchange_connect)      GNUNET_SCHEDULER_run (&main_wrapper_exchange_connect,  | 
