From: Sree Harsha Totakura Date: Wed, 20 Jun 2012 19:15:35 +0000 (+0000) Subject: -fixed assertion failure when GNUNET_TESTING_peer_shutdown is called in GNUNET_TESTIN... X-Git-Tag: initial-import-from-subversion-38251~12913 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=a108a1ec6a4b299f3a6db7d9bb0a507188a2d0bb;p=oweals%2Fgnunet.git -fixed assertion failure when GNUNET_TESTING_peer_shutdown is called in GNUNET_TESTING_peer/service_run --- diff --git a/src/testing/testing.c b/src/testing/testing.c index 6d22c68ce..ce3ad8c76 100644 --- a/src/testing/testing.c +++ b/src/testing/testing.c @@ -1005,9 +1005,7 @@ GNUNET_TESTING_service_run (const char *testdir, struct GNUNET_TESTING_Peer *peer; struct GNUNET_CONFIGURATION_Handle *cfg; - GNUNET_log_setup (testdir, - "WARNING", - NULL); + GNUNET_log_setup (testdir, "WARNING", NULL); system = GNUNET_TESTING_system_create (testdir, "127.0.0.1"); if (NULL == system) return 1; @@ -1042,7 +1040,8 @@ GNUNET_TESTING_service_run (const char *testdir, sc.tm_cls = tm_cls; sc.peer = peer; GNUNET_SCHEDULER_run (&service_run_main, &sc); /* Scheduler loop */ - if (GNUNET_OK != GNUNET_TESTING_peer_stop (peer)) + if ((NULL != peer->main_process) && + (GNUNET_OK != GNUNET_TESTING_peer_stop (peer))) { GNUNET_TESTING_peer_destroy (peer); GNUNET_CONFIGURATION_destroy (cfg);