- Fixed killing of random processes on shutdown
[oweals/gnunet.git] / src / testing / testing.c
index 7a2a2b87a1f358f2875f808644fe4ce4f1dbaade..e2b1e684fc1b9d6196ff7567d5641e50c2b1f83c 100644 (file)
@@ -644,6 +644,8 @@ start_fsm (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
     d->phase = SP_START_DONE;
     if (NULL != cb)
       cb (d->cb_cls, &d->id, d->cfg, d, NULL);
+    GNUNET_free (d->proc_arm_srv_start);
+    d->proc_arm_srv_start = NULL;
     break;
   case SP_SERVICE_SHUTDOWN_START:
     /* confirm copying complete */
@@ -1542,7 +1544,10 @@ GNUNET_TESTING_daemon_stop (struct GNUNET_TESTING_Daemon *d,
     GNUNET_free_non_null (d->username);
     if (NULL != d->dead_cb)
       d->dead_cb (d->dead_cb_cls, NULL);
-    GNUNET_assert (NULL == d->proc_arm_stop);
+    /* FIXME: this should be an assert and the test below
+       should not be required, but testing is broken... */
+    GNUNET_break (NULL == d->proc_arm_stop);
+    if (NULL == d->proc_arm_stop) 
     GNUNET_free (d);
     return;
   }
@@ -2218,7 +2223,7 @@ GNUNET_TESTING_daemons_connect (struct GNUNET_TESTING_Daemon *d1,
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Asked to connect peer %s to peer %s\n",
               d1->shortname, d2->shortname);
   /* Core is up! Iterate over all _known_ peers first to check if we are already connected to the peer! */
-  GNUNET_assert (GNUNET_OK ==
+  GNUNET_assert (NULL !=
                  GNUNET_CORE_is_peer_connected (ctx->d1->cfg, &ctx->d2->id,
                                                 &core_initial_iteration, ctx));
   return ctx;