]> git.lizzy.rs Git - minetest.git/blobdiff - src/unittest/test_authdatabase.cpp
Fix segfault in deprecation logging due to tail call, log by default (#10174)
[minetest.git] / src / unittest / test_authdatabase.cpp
index 1e8fd233d3aca5d89a371660fc8f826750f21243..1e1744d40eaef423c58027f7c2eebe4f31564fd4 100644 (file)
@@ -90,12 +90,7 @@ class SQLite3Provider : public AuthDatabaseProvider
 class TestAuthDatabase : public TestBase
 {
 public:
-       TestAuthDatabase()
-       {
-               TestManager::registerTestModule(this);
-               // fixed directory, for persistence
-               test_dir = getTestTempDirectory();
-       }
+       TestAuthDatabase() { TestManager::registerTestModule(this); }
        const char *getName() { return "TestAuthDatabase"; }
 
        void runTests(IGameDef *gamedef);
@@ -112,7 +107,6 @@ class TestAuthDatabase : public TestBase
        void testDelete();
 
 private:
-       std::string test_dir;
        AuthDatabaseProvider *auth_provider;
 };
 
@@ -120,6 +114,9 @@ static TestAuthDatabase g_test_instance;
 
 void TestAuthDatabase::runTests(IGameDef *gamedef)
 {
+       // fixed directory, for persistence
+       thread_local const std::string test_dir = getTestTempDirectory();
+
        // Each set of tests is run twice for each database type:
        // one where we reuse the same AuthDatabase object (to test local caching),
        // and one where we create a new AuthDatabase object for each call