aboutsummaryrefslogtreecommitdiff
path: root/src/topology
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2009-11-15 18:12:39 +0000
committerChristian Grothoff <christian@grothoff.org>2009-11-15 18:12:39 +0000
commit8ed0131e0f2eb29e1bb947d66d482149b10a25a2 (patch)
tree8829fe041f83033c3dce44d2a9c8ac40a16e679d /src/topology
parenta0c94d4eb2f763009cd0479e9b8a7da97a0bd650 (diff)
downloadgnunet-8ed0131e0f2eb29e1bb947d66d482149b10a25a2.tar.gz
gnunet-8ed0131e0f2eb29e1bb947d66d482149b10a25a2.zip
do not use sleep, use scheduler
Diffstat (limited to 'src/topology')
-rw-r--r--src/topology/test_gnunet_service_topology.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/topology/test_gnunet_service_topology.c b/src/topology/test_gnunet_service_topology.c
index 3cd39f49d..dfd53cf8a 100644
--- a/src/topology/test_gnunet_service_topology.c
+++ b/src/topology/test_gnunet_service_topology.c
@@ -49,6 +49,15 @@ static struct GNUNET_TESTING_Daemon *last;
49static struct GNUNET_SCHEDULER_Handle *sched; 49static struct GNUNET_SCHEDULER_Handle *sched;
50 50
51 51
52static void
53clean_up_task (void *cls,
54 const struct GNUNET_SCHEDULER_TaskContext *tc)
55{
56 GNUNET_TESTING_daemons_stop (pg);
57 ok = 0;
58}
59
60
52static void 61static void
53notify_connect_complete(void *cls, 62notify_connect_complete(void *cls,
54 const char *emsg) 63 const char *emsg)
@@ -67,9 +76,10 @@ notify_connect_complete(void *cls,
67 /* FIXME: check that topology adds a few more links 76 /* FIXME: check that topology adds a few more links
68 in addition to those that were seeded */ 77 in addition to those that were seeded */
69 /* For now, sleep so we can have the daemon do some work */ 78 /* For now, sleep so we can have the daemon do some work */
70 sleep (10); 79 GNUNET_SCHEDULER_add_delayed (sched,
71 GNUNET_TESTING_daemons_stop (pg); 80 GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 5),
72 ok = 0; 81 &clean_up_task,
82 NULL);
73 } 83 }
74} 84}
75 85