From 34affbd1ac4ca8749ee8ebd53346d251af7f5ac6 Mon Sep 17 00:00:00 2001 From: Sasha Szpakowski Date: Sat, 8 Feb 2025 23:05:35 -0400 Subject: [PATCH] tests: fix love.filesystem mounting --- src/modules/filesystem/physfs/Filesystem.cpp | 2 ++ testing/tests/filesystem.lua | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/modules/filesystem/physfs/Filesystem.cpp b/src/modules/filesystem/physfs/Filesystem.cpp index 14c2ca43e..5ff5ce706 100644 --- a/src/modules/filesystem/physfs/Filesystem.cpp +++ b/src/modules/filesystem/physfs/Filesystem.cpp @@ -232,6 +232,8 @@ bool Filesystem::setIdentity(const char *ident, bool appendToPath) // This is done so the save directory is only created on-demand. if (!mountCommonPathInternal(COMMONPATH_APP_SAVEDIR, nullptr, MOUNT_PERMISSIONS_READWRITE, appendToPath, false)) saveDirectoryNeedsMounting = true; + else + saveDirectoryNeedsMounting = false; // Mount any other app common paths with directory creation immediately // instead of on-demand, since to get to this point they would have to be diff --git a/testing/tests/filesystem.lua b/testing/tests/filesystem.lua index 1b8948a27..2df557cb8 100644 --- a/testing/tests/filesystem.lua +++ b/testing/tests/filesystem.lua @@ -410,7 +410,7 @@ love.test.filesystem.mountCommonPath = function(test) end local mount6 = love.filesystem.mountCommonPath('userdocuments', 'userdocuments', 'readwrite') local ok = pcall(love.filesystem.mountCommonPath, 'fakepath', 'fake', 'readwrite') - test:assertTrue(mount1, 'check mount appsavedir') + test:assertFalse(mount1, 'check mount appsavedir') -- This is already mounted, we can't do it again. test:assertTrue(mount2, 'check mount appdocuments') test:assertTrue(mount3, 'check mount userhome') test:assertTrue(mount4, 'check mount userappdata')