forked from Mirrorlandia_minetest/minetest
Fix temporary path crash in TestAuthDatabase (#7753)
The constructor of TestAuthDatabase was called immediately, at a time when the settings weren't initialized properly yet.
This commit is contained in:
parent
ce2d33eb97
commit
b9343a7da4
@ -90,12 +90,7 @@ private:
|
|||||||
class TestAuthDatabase : public TestBase
|
class TestAuthDatabase : public TestBase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
TestAuthDatabase()
|
TestAuthDatabase() { TestManager::registerTestModule(this); }
|
||||||
{
|
|
||||||
TestManager::registerTestModule(this);
|
|
||||||
// fixed directory, for persistence
|
|
||||||
test_dir = getTestTempDirectory();
|
|
||||||
}
|
|
||||||
const char *getName() { return "TestAuthDatabase"; }
|
const char *getName() { return "TestAuthDatabase"; }
|
||||||
|
|
||||||
void runTests(IGameDef *gamedef);
|
void runTests(IGameDef *gamedef);
|
||||||
@ -112,7 +107,6 @@ public:
|
|||||||
void testDelete();
|
void testDelete();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::string test_dir;
|
|
||||||
AuthDatabaseProvider *auth_provider;
|
AuthDatabaseProvider *auth_provider;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -120,6 +114,9 @@ static TestAuthDatabase g_test_instance;
|
|||||||
|
|
||||||
void TestAuthDatabase::runTests(IGameDef *gamedef)
|
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:
|
// Each set of tests is run twice for each database type:
|
||||||
// one where we reuse the same AuthDatabase object (to test local caching),
|
// one where we reuse the same AuthDatabase object (to test local caching),
|
||||||
// and one where we create a new AuthDatabase object for each call
|
// and one where we create a new AuthDatabase object for each call
|
||||||
|
Loading…
Reference in New Issue
Block a user