diff options
author | Nathan S. Evans <evans@in.tum.de> | 2010-06-28 12:21:40 +0000 |
---|---|---|
committer | Nathan S. Evans <evans@in.tum.de> | 2010-06-28 12:21:40 +0000 |
commit | 134afc9acfb4b12c84cdf8b56b2eabb856fde3e7 (patch) | |
tree | f62956e6c9ac0b39f37afc101270ce8660004831 /src/testing/test_testing_topology_churn.c | |
parent | 59ca0059f61b1e2538f2890625601a88b2119f66 (diff) | |
download | gnunet-134afc9acfb4b12c84cdf8b56b2eabb856fde3e7.tar.gz gnunet-134afc9acfb4b12c84cdf8b56b2eabb856fde3e7.zip |
callback for peergroup shutdown in testing, requisite testcase changes
Diffstat (limited to 'src/testing/test_testing_topology_churn.c')
-rw-r--r-- | src/testing/test_testing_topology_churn.c | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/src/testing/test_testing_topology_churn.c b/src/testing/test_testing_topology_churn.c index 0d894378f..ba493e295 100644 --- a/src/testing/test_testing_topology_churn.c +++ b/src/testing/test_testing_topology_churn.c | |||
@@ -74,6 +74,30 @@ struct GNUNET_TestMessage | |||
74 | uint32_t uid; | 74 | uint32_t uid; |
75 | }; | 75 | }; |
76 | 76 | ||
77 | /** | ||
78 | * Check whether peers successfully shut down. | ||
79 | */ | ||
80 | void shutdown_callback (void *cls, | ||
81 | const char *emsg) | ||
82 | { | ||
83 | if (emsg != NULL) | ||
84 | { | ||
85 | #if VERBOSE | ||
86 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
87 | "Shutdown of peers failed!\n"); | ||
88 | #endif | ||
89 | if (ok == 0) | ||
90 | ok = 666; | ||
91 | } | ||
92 | else | ||
93 | { | ||
94 | #if VERBOSE | ||
95 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
96 | "All peers successfully shut down!\n"); | ||
97 | #endif | ||
98 | } | ||
99 | } | ||
100 | |||
77 | static void | 101 | static void |
78 | finish_testing () | 102 | finish_testing () |
79 | { | 103 | { |
@@ -91,7 +115,7 @@ finish_testing () | |||
91 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 115 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
92 | "Calling daemons_stop\n"); | 116 | "Calling daemons_stop\n"); |
93 | #endif | 117 | #endif |
94 | GNUNET_TESTING_daemons_stop (pg, TIMEOUT); | 118 | GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL); |
95 | #if VERBOSE | 119 | #if VERBOSE |
96 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 120 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
97 | "daemons_stop finished\n"); | 121 | "daemons_stop finished\n"); |
@@ -109,7 +133,7 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext * tc) | |||
109 | 133 | ||
110 | if (pg != NULL) | 134 | if (pg != NULL) |
111 | { | 135 | { |
112 | GNUNET_TESTING_daemons_stop (pg, TIMEOUT); | 136 | GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL); |
113 | ok = 7331; /* Opposite of leet */ | 137 | ok = 7331; /* Opposite of leet */ |
114 | } | 138 | } |
115 | else | 139 | else |