]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
mail-crypt: test-fs-crypt - Replace fs_init_from_string() with fs_init()
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Thu, 27 Jul 2023 11:19:08 +0000 (14:19 +0300)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Wed, 12 Feb 2025 10:34:09 +0000 (12:34 +0200)
There was no benefit in using it.

src/plugins/mail-crypt/test-fs-crypt.c

index 5cff40d1719479ea0ee1aa56e9ed647a86eca87b..a98e96c1e50a5196a16fe209c4b60c01fdcbb844 100644 (file)
@@ -43,7 +43,7 @@ static void test_setup(void)
        fs_class_register(&fs_class_posix);
        fs_class_register(&fs_class_crypt);
 
-       if (fs_init_from_string("posix", &test_fs_set, &fs, &error) < 0)
+       if (fs_init("posix", "", &test_fs_set, &fs, &error) < 0)
                 i_fatal("fs_init(posix) failed: %s", error);
        /* write keys to disk */
        file = fs_file_init(fs, "test_public_key.pem", FS_OPEN_MODE_CREATE);
@@ -67,9 +67,9 @@ static void test_fs_crypt_read_write(void)
        const char *error;
        struct fs *fs;
 
-       if (fs_init_from_string("crypt:public_key_path=test_public_key.pem:"
-                               "private_key_path=test_private_key.pem:posix",
-                               &test_fs_set, &fs, &error) < 0)
+       if (fs_init("crypt", "public_key_path=test_public_key.pem:"
+                   "private_key_path=test_private_key.pem:posix",
+                   &test_fs_set, &fs, &error) < 0)
                i_fatal("fs_init(crypt:posix) failed: %s", error);
 
        i_unlink_if_exists("test_file");
@@ -116,9 +116,9 @@ static void test_fs_crypt_read_write_0(void)
        const char *error;
        struct fs *fs;
 
-       if (fs_init_from_string("crypt:public_key_path=test_public_key.pem:"
-                               "private_key_path=test_private_key.pem:posix",
-                               &test_fs_set, &fs, &error) < 0)
+       if (fs_init("crypt", "public_key_path=test_public_key.pem:"
+                   "private_key_path=test_private_key.pem:posix",
+                   &test_fs_set, &fs, &error) < 0)
                i_fatal("fs_init(crypt:posix) failed: %s", error);
 
        i_unlink_if_exists("test_file");
@@ -157,10 +157,10 @@ static void test_fs_crypt_read_write_unencrypted(void)
        const char *error;
        struct fs *fs;
 
-       if (fs_init_from_string("crypt:public_key_path=:"
-                               "private_key_path=test_private_key.pem:"
-                               "maybe:posix",
-                               &test_fs_set, &fs, &error) < 0)
+       if (fs_init("crypt", "public_key_path=:"
+                   "private_key_path=test_private_key.pem:"
+                   "maybe:posix",
+                   &test_fs_set, &fs, &error) < 0)
                i_fatal("fs_init(crypt:posix) failed: %s", error);
 
        i_unlink_if_exists("test_file");
@@ -199,10 +199,10 @@ static void test_fs_crypt_read_write_unencrypted(void)
        fs_file_deinit(&file);
        fs_deinit(&fs);
 
-       if (fs_init_from_string("crypt:public_key_path=test_public_key.pem:"
-                               "private_key_path=test_private_key.pem:"
-                               "maybe:posix",
-                               &test_fs_set, &fs, &error) < 0)
+       if (fs_init("crypt", "public_key_path=test_public_key.pem:"
+                   "private_key_path=test_private_key.pem:"
+                   "maybe:posix",
+                   &test_fs_set, &fs, &error) < 0)
                i_fatal("fs_init(crypt:posix) failed: %s", error);
 
        i_unlink_if_exists("test_file");