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
@@ -154,24 +154,2 @@ com_unsubscribe (int argc, char **argv, mu_assoc_t options, void *env)
-static mu_record_t
-find_record (char const *scheme)
-{
- mu_iterator_t itr;
- mu_record_t result = NULL;
-
- MU_ASSERT (mu_registrar_get_iterator (&itr));
- for (mu_iterator_first (itr); !mu_iterator_is_done (itr);
- mu_iterator_next (itr))
- {
- mu_record_t rec;
- mu_iterator_current (itr, (void **)&rec);
- if (strcmp (rec->scheme, scheme) == 0)
- {
- result = rec;
- break;
- }
- }
- mu_iterator_destroy (&itr);
- return result;
-}
-
static int
@@ -207,5 +185,5 @@ com_scan (int argc, char **argv, mu_assoc_t options, void *env)
{
- mu_record_t rec = find_record (s);
-
- if (rec)
+ mu_record_t rec;
+ rc = mu_registrar_lookup_scheme (s, &rec);
+ if (rc == 0)
{
@@ -217,3 +195,7 @@ com_scan (int argc, char **argv, mu_assoc_t options, void *env)
{
- mu_error ("%s: no such record found", s);
+ if (rc == MU_ERR_NOENT)
+ mu_error ("%s: no such record found", s);
+ else
+ mu_diag_funcall (MU_DIAG_ERROR, "mu_registrar_lookup_scheme",
+ NULL, rc);
mu_list_destroy (&scn.records);
@@ -286,3 +268,3 @@ _always_is_scheme (mu_record_t record, mu_url_t url, int flags)
-static struct _mu_record test_record =
+static struct _mu_record any_record =
{
@@ -341,3 +323,3 @@ main (int argc, char **argv)
mu_tesh_init (argv[0]);
- mu_registrar_record (&test_record);
+ mu_registrar_record (&any_record);
mu_registrar_record (&reg_record);

Return to:

Send suggestions and report system problems to the System administrator.