summaryrefslogtreecommitdiff
path: root/libmailutils/tests/fsfolder.c
diff options
context:
space:
mode:
Diffstat (limited to 'libmailutils/tests/fsfolder.c')
-rw-r--r--libmailutils/tests/fsfolder.c38
1 files changed, 10 insertions, 28 deletions
diff --git a/libmailutils/tests/fsfolder.c b/libmailutils/tests/fsfolder.c
index 8c2579838..5a4d9df7d 100644
--- a/libmailutils/tests/fsfolder.c
+++ b/libmailutils/tests/fsfolder.c
@@ -152,28 +152,6 @@ com_unsubscribe (int argc, char **argv, mu_assoc_t options, void *env)
152 return 0; 152 return 0;
153} 153}
154 154
155static mu_record_t
156find_record (char const *scheme)
157{
158 mu_iterator_t itr;
159 mu_record_t result = NULL;
160
161 MU_ASSERT (mu_registrar_get_iterator (&itr));
162 for (mu_iterator_first (itr); !mu_iterator_is_done (itr);
163 mu_iterator_next (itr))
164 {
165 mu_record_t rec;
166 mu_iterator_current (itr, (void **)&rec);
167 if (strcmp (rec->scheme, scheme) == 0)
168 {
169 result = rec;
170 break;
171 }
172 }
173 mu_iterator_destroy (&itr);
174 return result;
175}
176
177static int 155static int
178com_scan (int argc, char **argv, mu_assoc_t options, void *env) 156com_scan (int argc, char **argv, mu_assoc_t options, void *env)
179{ 157{
@@ -205,9 +183,9 @@ com_scan (int argc, char **argv, mu_assoc_t options, void *env)
205 183
206 if (mu_assoc_lookup (options, "type", &s) == 0) 184 if (mu_assoc_lookup (options, "type", &s) == 0)
207 { 185 {
208 mu_record_t rec = find_record (s); 186 mu_record_t rec;
209 187 rc = mu_registrar_lookup_scheme (s, &rec);
210 if (rec) 188 if (rc == 0)
211 { 189 {
212 if (!scn.records) 190 if (!scn.records)
213 MU_ASSERT (mu_list_create (&scn.records)); 191 MU_ASSERT (mu_list_create (&scn.records));
@@ -215,7 +193,11 @@ com_scan (int argc, char **argv, mu_assoc_t options, void *env)
215 } 193 }
216 else 194 else
217 { 195 {
218 mu_error ("%s: no such record found", s); 196 if (rc == MU_ERR_NOENT)
197 mu_error ("%s: no such record found", s);
198 else
199 mu_diag_funcall (MU_DIAG_ERROR, "mu_registrar_lookup_scheme",
200 NULL, rc);
219 mu_list_destroy (&scn.records); 201 mu_list_destroy (&scn.records);
220 return 0; 202 return 0;
221 } 203 }
@@ -284,7 +266,7 @@ _always_is_scheme (mu_record_t record, mu_url_t url, int flags)
284 return res & flags; 266 return res & flags;
285} 267}
286 268
287static struct _mu_record test_record = 269static struct _mu_record any_record =
288{ 270{
289 10, 271 10,
290 "any", 272 "any",
@@ -339,7 +321,7 @@ main (int argc, char **argv)
339 int glob_option = 0; 321 int glob_option = 0;
340 322
341 mu_tesh_init (argv[0]); 323 mu_tesh_init (argv[0]);
342 mu_registrar_record (&test_record); 324 mu_registrar_record (&any_record);
343 mu_registrar_record (&reg_record); 325 mu_registrar_record (&reg_record);
344 326
345 if (argc == 1) 327 if (argc == 1)

Return to:

Send suggestions and report system problems to the System administrator.