diff options
author | Nathan S. Evans <evans@in.tum.de> | 2010-11-05 18:21:50 +0000 |
---|---|---|
committer | Nathan S. Evans <evans@in.tum.de> | 2010-11-05 18:21:50 +0000 |
commit | 75a33a1499cf60ea4364c9aa673816629a6c1413 (patch) | |
tree | 0620da4312bb04de4d7b65074fdd3b0c3dd6cc0e /src/fs/test_fs_test_lib.c | |
parent | 7217c601ad30760872823193d62307e7a335d226 (diff) | |
download | gnunet-75a33a1499cf60ea4364c9aa673816629a6c1413.tar.gz gnunet-75a33a1499cf60ea4364c9aa673816629a6c1413.zip |
big scheduler refactoring, expect some issues
Diffstat (limited to 'src/fs/test_fs_test_lib.c')
-rw-r--r-- | src/fs/test_fs_test_lib.c | 28 |
1 files changed, 8 insertions, 20 deletions
diff --git a/src/fs/test_fs_test_lib.c b/src/fs/test_fs_test_lib.c index 930038da5..3c6826181 100644 --- a/src/fs/test_fs_test_lib.c +++ b/src/fs/test_fs_test_lib.c | |||
@@ -44,8 +44,6 @@ | |||
44 | 44 | ||
45 | static struct GNUNET_FS_TestDaemon *daemons[NUM_DAEMONS]; | 45 | static struct GNUNET_FS_TestDaemon *daemons[NUM_DAEMONS]; |
46 | 46 | ||
47 | static struct GNUNET_SCHEDULER_Handle *sched; | ||
48 | |||
49 | static int ret; | 47 | static int ret; |
50 | 48 | ||
51 | static void | 49 | static void |
@@ -63,8 +61,7 @@ do_stop (void *cls, | |||
63 | "Finished download, shutting down\n", | 61 | "Finished download, shutting down\n", |
64 | (unsigned long long) FILESIZE); | 62 | (unsigned long long) FILESIZE); |
65 | } | 63 | } |
66 | GNUNET_FS_TEST_daemons_stop (sched, | 64 | GNUNET_FS_TEST_daemons_stop (NUM_DAEMONS, |
67 | NUM_DAEMONS, | ||
68 | daemons); | 65 | daemons); |
69 | } | 66 | } |
70 | 67 | ||
@@ -76,8 +73,7 @@ do_download (void *cls, | |||
76 | if (NULL == uri) | 73 | if (NULL == uri) |
77 | { | 74 | { |
78 | GNUNET_break (0); | 75 | GNUNET_break (0); |
79 | GNUNET_SCHEDULER_add_now (sched, | 76 | GNUNET_SCHEDULER_add_now (&do_stop, |
80 | &do_stop, | ||
81 | NULL); | 77 | NULL); |
82 | ret = 1; | 78 | ret = 1; |
83 | return; | 79 | return; |
@@ -85,8 +81,7 @@ do_download (void *cls, | |||
85 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 81 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
86 | "Downloading %llu bytes\n", | 82 | "Downloading %llu bytes\n", |
87 | (unsigned long long) FILESIZE); | 83 | (unsigned long long) FILESIZE); |
88 | GNUNET_FS_TEST_download (sched, | 84 | GNUNET_FS_TEST_download (daemons[0], |
89 | daemons[0], | ||
90 | TIMEOUT, | 85 | TIMEOUT, |
91 | 1, SEED, uri, | 86 | 1, SEED, uri, |
92 | VERBOSE, | 87 | VERBOSE, |
@@ -102,16 +97,14 @@ do_publish (void *cls, | |||
102 | { | 97 | { |
103 | GNUNET_break (0); | 98 | GNUNET_break (0); |
104 | ret = 1; | 99 | ret = 1; |
105 | GNUNET_SCHEDULER_add_now (sched, | 100 | GNUNET_SCHEDULER_add_now (&do_stop, |
106 | &do_stop, | ||
107 | NULL); | 101 | NULL); |
108 | return; | 102 | return; |
109 | } | 103 | } |
110 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 104 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
111 | "Publishing %llu bytes\n", | 105 | "Publishing %llu bytes\n", |
112 | (unsigned long long) FILESIZE); | 106 | (unsigned long long) FILESIZE); |
113 | GNUNET_FS_TEST_publish (sched, | 107 | GNUNET_FS_TEST_publish (daemons[0], |
114 | daemons[0], | ||
115 | TIMEOUT, | 108 | TIMEOUT, |
116 | 1, GNUNET_NO, FILESIZE, SEED, | 109 | 1, GNUNET_NO, FILESIZE, SEED, |
117 | VERBOSE, | 110 | VERBOSE, |
@@ -127,15 +120,13 @@ do_connect (void *cls, | |||
127 | { | 120 | { |
128 | GNUNET_break (0); | 121 | GNUNET_break (0); |
129 | ret = 1; | 122 | ret = 1; |
130 | GNUNET_SCHEDULER_add_now (sched, | 123 | GNUNET_SCHEDULER_add_now (&do_stop, |
131 | &do_stop, | ||
132 | NULL); | 124 | NULL); |
133 | return; | 125 | return; |
134 | } | 126 | } |
135 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 127 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
136 | "Daemons started, will now try to connect them\n"); | 128 | "Daemons started, will now try to connect them\n"); |
137 | GNUNET_FS_TEST_daemons_connect (sched, | 129 | GNUNET_FS_TEST_daemons_connect (daemons[0], |
138 | daemons[0], | ||
139 | daemons[1], | 130 | daemons[1], |
140 | TIMEOUT, | 131 | TIMEOUT, |
141 | &do_publish, | 132 | &do_publish, |
@@ -145,14 +136,11 @@ do_connect (void *cls, | |||
145 | 136 | ||
146 | static void | 137 | static void |
147 | run (void *cls, | 138 | run (void *cls, |
148 | struct GNUNET_SCHEDULER_Handle *s, | ||
149 | char *const *args, | 139 | char *const *args, |
150 | const char *cfgfile, | 140 | const char *cfgfile, |
151 | const struct GNUNET_CONFIGURATION_Handle *cfg) | 141 | const struct GNUNET_CONFIGURATION_Handle *cfg) |
152 | { | 142 | { |
153 | sched = s; | 143 | GNUNET_FS_TEST_daemons_start ("fs_test_lib_data.conf", |
154 | GNUNET_FS_TEST_daemons_start (sched, | ||
155 | "fs_test_lib_data.conf", | ||
156 | TIMEOUT, | 144 | TIMEOUT, |
157 | NUM_DAEMONS, | 145 | NUM_DAEMONS, |
158 | daemons, | 146 | daemons, |