]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-index: test-mail-index-write - Use the new test-dir API
authorStephan Bosch <stephan.bosch@open-xchange.com>
Sat, 1 Nov 2025 17:09:00 +0000 (18:09 +0100)
committertimo.sirainen <timo.sirainen@open-xchange.com>
Wed, 5 Nov 2025 10:17:48 +0000 (10:17 +0000)
src/lib-index/test-mail-index-write.c

index 88eaa4a07e24904bbf774868a7bcec03c7b53894..2ea105f5c00ffc97fb2f493778c9d96a69626228 100644 (file)
@@ -2,6 +2,7 @@
 
 #include "lib.h"
 #include "test-common.h"
+#include "test-dir.h"
 #include "mail-index-private.h"
 #include "mail-transaction-log-private.h"
 
@@ -107,7 +108,8 @@ static void test_mail_index_write(void)
                .dir = ".",
                .fd = -1,
                .indexid = TEST_INDEXID,
-               .filepath = TEST_INDEX_FNAME,
+               .filepath = p_strconcat(unsafe_data_stack_pool, test_dir_get(),
+                                       "/", TEST_INDEX_FNAME, NULL),
                .log_sync_locked = TRUE,
        };
 
@@ -137,7 +139,6 @@ static void test_mail_index_write(void)
        test_assert(!index.reopen_main_index);
 
        event_unref(&index.event);
-       i_unlink(TEST_INDEX_FNAME);
        test_end();
 }
 
@@ -147,5 +148,7 @@ int main(void)
                test_mail_index_write,
                NULL
        };
+
+       test_dir_init("test-mail-index-write");
        return test_run(test_functions);
 }