From e5202df0a057e94740c64abe60ff81809a9ce4fd Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Wed, 12 Oct 2011 11:55:38 +0000 Subject: [PATCH] better logging --- src/testing/test_testing_reconnect.c | 26 +++++++++++++++++++++----- src/testing/testing.c | 2 +- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/src/testing/test_testing_reconnect.c b/src/testing/test_testing_reconnect.c index 433b02794..e9519ab3b 100644 --- a/src/testing/test_testing_reconnect.c +++ b/src/testing/test_testing_reconnect.c @@ -98,11 +98,13 @@ end1_cb (void *cls, const char *emsg) { ok = 0; } - - GNUNET_TESTING_daemon_stop (d2, TIMEOUT, &end2_cb, NULL, - (phase == NUM_PHASES) ? GNUNET_YES : GNUNET_NO, - GNUNET_NO); - d2 = NULL; + if (d2 != NULL) + { + GNUNET_TESTING_daemon_stop (d2, TIMEOUT, &end2_cb, NULL, + (phase == NUM_PHASES) ? GNUNET_YES : GNUNET_NO, + GNUNET_NO); + d2 = NULL; + } } static void @@ -141,6 +143,13 @@ my_cb2 (void *cls, const struct GNUNET_PeerIdentity *id, const struct GNUNET_CONFIGURATION_Handle *cfg, struct GNUNET_TESTING_Daemon *d, const char *emsg) { + if (emsg != NULL) + { + GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Starting daemon 2 gave: %s\n", + emsg); + GNUNET_assert (0); + return; + } GNUNET_assert (id != NULL); #if VERBOSE GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Daemon `%s' started.\n", @@ -156,6 +165,13 @@ my_cb1 (void *cls, const struct GNUNET_PeerIdentity *id, const struct GNUNET_CONFIGURATION_Handle *cfg, struct GNUNET_TESTING_Daemon *d, const char *emsg) { + if (emsg != NULL) + { + GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Starting daemon 1 gave: %s\n", + emsg); + GNUNET_assert (0); + return; + } GNUNET_assert (id != NULL); #if VERBOSE GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Daemon `%s' started.\n", diff --git a/src/testing/testing.c b/src/testing/testing.c index 3b065c357..466692ce7 100644 --- a/src/testing/testing.c +++ b/src/testing/testing.c @@ -384,7 +384,7 @@ start_fsm (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) GNUNET_OS_process_close (d->proc); d->proc = NULL; if (NULL != cb) - cb (d->cb_cls, NULL, d->cfg, d, _("`Failed to get hostkey!\n")); + cb (d->cb_cls, NULL, d->cfg, d, _("Failed to get hostkey!\n")); return; } d->shortname = GNUNET_strdup (GNUNET_i2s (&d->id)); -- 2.25.1