1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-07-02 16:38:41 +00:00

Better handling of temporary folders

This commit is contained in:
sfan5 2024-04-05 15:55:54 +02:00
parent f87994edc7
commit 7e4462e0ac
6 changed files with 34 additions and 17 deletions

View file

@ -324,13 +324,8 @@ std::string TestBase::getTestTempDirectory()
if (!m_test_dir.empty())
return m_test_dir;
char buf[32];
porting::mt_snprintf(buf, sizeof(buf), "%08X", myrand());
m_test_dir = fs::TempPath() + DIR_DELIM "mttest_" + buf;
if (!fs::CreateDir(m_test_dir))
UASSERT(false);
m_test_dir = fs::CreateTempDir();
UASSERT(!m_test_dir.empty());
return m_test_dir;
}