From: Timo Sirainen Date: Thu, 27 Jul 2023 11:19:08 +0000 (+0300) Subject: mail-crypt: test-fs-crypt - Replace fs_init_from_string() with fs_init() X-Git-Tag: 2.4.1~1423 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=529cba511195bbc7f02caf68b34ff8352b4da227;p=thirdparty%2Fdovecot%2Fcore.git mail-crypt: test-fs-crypt - Replace fs_init_from_string() with fs_init() There was no benefit in using it. --- diff --git a/src/plugins/mail-crypt/test-fs-crypt.c b/src/plugins/mail-crypt/test-fs-crypt.c index 5cff40d171..a98e96c1e5 100644 --- a/src/plugins/mail-crypt/test-fs-crypt.c +++ b/src/plugins/mail-crypt/test-fs-crypt.c @@ -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");