From 8baa2fc8e1604455fd3ccd0bf0c67bcbd669d613 Mon Sep 17 00:00:00 2001 From: "Nathan S. Evans" Date: Mon, 10 May 2010 15:00:34 +0000 Subject: [PATCH] test case fails properly now --- src/testing/test_testing_group.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/testing/test_testing_group.c b/src/testing/test_testing_group.c index 2429c4525..f222fbb82 100644 --- a/src/testing/test_testing_group.c +++ b/src/testing/test_testing_group.c @@ -24,7 +24,7 @@ #include "platform.h" #include "gnunet_testing_lib.h" -#define VERBOSE GNUNET_NO +#define VERBOSE GNUNET_YES #define NUM_PEERS 4 @@ -55,10 +55,17 @@ my_cb (void *cls, GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Start callback called with error (too long starting peers), aborting test!\n"); GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Error from testing: `%s'\n"); failed_peers++; - ok = 7; + if (failed_peers == peers_left) + { + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Too many peers failed, ending test!\n"); + ok = 1; + GNUNET_TESTING_daemons_stop (pg, TIMEOUT); + } + return; } peers_left--; + fprintf(stderr, "peers_left is %d, failed_peers is %d\n", peers_left, failed_peers); if (peers_left == 0) { sleep(2); /* Give other services a chance to initialize before killing */ @@ -69,6 +76,7 @@ my_cb (void *cls, else if (failed_peers == peers_left) { GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Too many peers failed, ending test!\n"); + ok = 1; GNUNET_TESTING_daemons_stop (pg, TIMEOUT); } } -- 2.25.1