diff options
author | Christian Grothoff <christian@grothoff.org> | 2009-11-15 18:12:39 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2009-11-15 18:12:39 +0000 |
commit | 8ed0131e0f2eb29e1bb947d66d482149b10a25a2 (patch) | |
tree | 8829fe041f83033c3dce44d2a9c8ac40a16e679d /src/topology | |
parent | a0c94d4eb2f763009cd0479e9b8a7da97a0bd650 (diff) | |
download | gnunet-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.c | 16 |
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; | |||
49 | static struct GNUNET_SCHEDULER_Handle *sched; | 49 | static struct GNUNET_SCHEDULER_Handle *sched; |
50 | 50 | ||
51 | 51 | ||
52 | static void | ||
53 | clean_up_task (void *cls, | ||
54 | const struct GNUNET_SCHEDULER_TaskContext *tc) | ||
55 | { | ||
56 | GNUNET_TESTING_daemons_stop (pg); | ||
57 | ok = 0; | ||
58 | } | ||
59 | |||
60 | |||
52 | static void | 61 | static void |
53 | notify_connect_complete(void *cls, | 62 | notify_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 | ||