diff options
author | Nathan S. Evans <evans@in.tum.de> | 2010-05-10 12:43:22 +0000 |
---|---|---|
committer | Nathan S. Evans <evans@in.tum.de> | 2010-05-10 12:43:22 +0000 |
commit | a1acd8d8d89a86b7c5e18624eec0e1811f22a0a1 (patch) | |
tree | 33035dca7fe10128353c344a23a39cd68225f001 /src/testing | |
parent | c23fe586063b76a53e8b89d42e62e2fd19e271a8 (diff) | |
download | gnunet-a1acd8d8d89a86b7c5e18624eec0e1811f22a0a1.tar.gz gnunet-a1acd8d8d89a86b7c5e18624eec0e1811f22a0a1.zip |
better failure handling
Diffstat (limited to 'src/testing')
-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 8458bfbd6..966945003 100644 --- a/src/testing/test_testing_group.c +++ b/src/testing/test_testing_group.c | |||
@@ -19,7 +19,7 @@ | |||
19 | */ | 19 | */ |
20 | /** | 20 | /** |
21 | * @file testing/test_testing_group.c | 21 | * @file testing/test_testing_group.c |
22 | * @brief testcase for functions to connect two peers in testing.c | 22 | * @brief testcase for functions to connect peers in testing.c |
23 | */ | 23 | */ |
24 | #include "platform.h" | 24 | #include "platform.h" |
25 | #include "gnunet_testing_lib.h" | 25 | #include "gnunet_testing_lib.h" |
@@ -38,6 +38,8 @@ static int ok; | |||
38 | 38 | ||
39 | static int peers_left; | 39 | static int peers_left; |
40 | 40 | ||
41 | static int failed_peers; | ||
42 | |||
41 | static struct GNUNET_TESTING_PeerGroup *pg; | 43 | static struct GNUNET_TESTING_PeerGroup *pg; |
42 | 44 | ||
43 | static struct GNUNET_SCHEDULER_Handle *sched; | 45 | static struct GNUNET_SCHEDULER_Handle *sched; |
@@ -52,9 +54,11 @@ my_cb (void *cls, | |||
52 | if (id == NULL) | 54 | if (id == NULL) |
53 | { | 55 | { |
54 | 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, "Start callback called with error (too long starting peers), aborting test!\n"); |
55 | GNUNET_TESTING_daemons_stop (pg); | 57 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Error from testing: `%s'\n"); |
58 | failed_peers++; | ||
56 | ok = 7; | 59 | ok = 7; |
57 | } | 60 | } |
61 | |||
58 | peers_left--; | 62 | peers_left--; |
59 | if (peers_left == 0) | 63 | if (peers_left == 0) |
60 | { | 64 | { |
@@ -63,6 +67,10 @@ my_cb (void *cls, | |||
63 | GNUNET_TESTING_daemons_stop (pg); | 67 | GNUNET_TESTING_daemons_stop (pg); |
64 | ok = 0; | 68 | ok = 0; |
65 | } | 69 | } |
70 | else if (failed_peers == peers_left) | ||
71 | { | ||
72 | GNUNET_TESTING_daemons_stop (pg); | ||
73 | } | ||
66 | } | 74 | } |
67 | 75 | ||
68 | 76 | ||