aboutsummaryrefslogtreecommitdiff
path: root/src/testing/test_testing_topology_blacklist.c
diff options
context:
space:
mode:
authorNathan S. Evans <evans@in.tum.de>2010-06-28 12:21:40 +0000
committerNathan S. Evans <evans@in.tum.de>2010-06-28 12:21:40 +0000
commit134afc9acfb4b12c84cdf8b56b2eabb856fde3e7 (patch)
treef62956e6c9ac0b39f37afc101270ce8660004831 /src/testing/test_testing_topology_blacklist.c
parent59ca0059f61b1e2538f2890625601a88b2119f66 (diff)
downloadgnunet-134afc9acfb4b12c84cdf8b56b2eabb856fde3e7.tar.gz
gnunet-134afc9acfb4b12c84cdf8b56b2eabb856fde3e7.zip
callback for peergroup shutdown in testing, requisite testcase changes
Diffstat (limited to 'src/testing/test_testing_topology_blacklist.c')
-rw-r--r--src/testing/test_testing_topology_blacklist.c29
1 files changed, 27 insertions, 2 deletions
diff --git a/src/testing/test_testing_topology_blacklist.c b/src/testing/test_testing_topology_blacklist.c
index 9788fa87c..b68386cd7 100644
--- a/src/testing/test_testing_topology_blacklist.c
+++ b/src/testing/test_testing_topology_blacklist.c
@@ -96,6 +96,31 @@ struct GNUNET_TestMessage
96 uint32_t uid; 96 uint32_t uid;
97}; 97};
98 98
99
100/**
101 * Check whether peers successfully shut down.
102 */
103void shutdown_callback (void *cls,
104 const char *emsg)
105{
106 if (emsg != NULL)
107 {
108#if VERBOSE
109 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
110 "Shutdown of peers failed!\n");
111#endif
112 if (ok == 0)
113 ok = 666;
114 }
115 else
116 {
117#if VERBOSE
118 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
119 "All peers successfully shut down!\n");
120#endif
121 }
122}
123
99static void 124static void
100finish_testing () 125finish_testing ()
101{ 126{
@@ -110,7 +135,7 @@ finish_testing ()
110 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 135 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
111 "Calling daemons_stop\n"); 136 "Calling daemons_stop\n");
112#endif 137#endif
113 GNUNET_TESTING_daemons_stop (pg, TIMEOUT); 138 GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL);
114#if VERBOSE 139#if VERBOSE
115 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 140 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
116 "daemons_stop finished\n"); 141 "daemons_stop finished\n");
@@ -133,7 +158,7 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext * tc)
133 158
134 if (pg != NULL) 159 if (pg != NULL)
135 { 160 {
136 GNUNET_TESTING_daemons_stop (pg, TIMEOUT); 161 GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL);
137 ok = 7331; /* Opposite of leet */ 162 ok = 7331; /* Opposite of leet */
138 } 163 }
139 else 164 else