diff options
author | Nathan S. Evans <evans@in.tum.de> | 2010-05-10 15:00:34 +0000 |
---|---|---|
committer | Nathan S. Evans <evans@in.tum.de> | 2010-05-10 15:00:34 +0000 |
commit | 8baa2fc8e1604455fd3ccd0bf0c67bcbd669d613 (patch) | |
tree | 10388d701aade4e83c8b2495864c6b6590dbd46d /src/testing/test_testing_group.c | |
parent | 70592d7ecec48ac0b8c7d2f37f17585c852c8e3b (diff) | |
download | gnunet-8baa2fc8e1604455fd3ccd0bf0c67bcbd669d613.tar.gz gnunet-8baa2fc8e1604455fd3ccd0bf0c67bcbd669d613.zip |
test case fails properly now
Diffstat (limited to 'src/testing/test_testing_group.c')
-rw-r--r-- | src/testing/test_testing_group.c | 12 |
1 files 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 @@ | |||
24 | #include "platform.h" | 24 | #include "platform.h" |
25 | #include "gnunet_testing_lib.h" | 25 | #include "gnunet_testing_lib.h" |
26 | 26 | ||
27 | #define VERBOSE GNUNET_NO | 27 | #define VERBOSE GNUNET_YES |
28 | 28 | ||
29 | #define NUM_PEERS 4 | 29 | #define NUM_PEERS 4 |
30 | 30 | ||
@@ -55,10 +55,17 @@ my_cb (void *cls, | |||
55 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Start callback called with error (too long starting peers), aborting test!\n"); | 55 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Start callback called with error (too long starting peers), aborting test!\n"); |
56 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Error from testing: `%s'\n"); | 56 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Error from testing: `%s'\n"); |
57 | failed_peers++; | 57 | failed_peers++; |
58 | ok = 7; | 58 | if (failed_peers == peers_left) |
59 | { | ||
60 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Too many peers failed, ending test!\n"); | ||
61 | ok = 1; | ||
62 | GNUNET_TESTING_daemons_stop (pg, TIMEOUT); | ||
63 | } | ||
64 | return; | ||
59 | } | 65 | } |
60 | 66 | ||
61 | peers_left--; | 67 | peers_left--; |
68 | fprintf(stderr, "peers_left is %d, failed_peers is %d\n", peers_left, failed_peers); | ||
62 | if (peers_left == 0) | 69 | if (peers_left == 0) |
63 | { | 70 | { |
64 | sleep(2); /* Give other services a chance to initialize before killing */ | 71 | sleep(2); /* Give other services a chance to initialize before killing */ |
@@ -69,6 +76,7 @@ my_cb (void *cls, | |||
69 | else if (failed_peers == peers_left) | 76 | else if (failed_peers == peers_left) |
70 | { | 77 | { |
71 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Too many peers failed, ending test!\n"); | 78 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Too many peers failed, ending test!\n"); |
79 | ok = 1; | ||
72 | GNUNET_TESTING_daemons_stop (pg, TIMEOUT); | 80 | GNUNET_TESTING_daemons_stop (pg, TIMEOUT); |
73 | } | 81 | } |
74 | } | 82 | } |