mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-11-23 14:33:07 +00:00
test: each game test starts without the CDClient the one before it opened
Tests that open an in-memory CDClient with only their tables left it connected, so later tests that make their own tables when none is connected failed (DestroyableTest, MovementBlockerScenarioTest, QuickBuildCompleteTests in a full run). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -84,6 +84,12 @@ void CDClientDatabase::Reconnect(const std::string& filename) {
|
|||||||
sqlite3_close_v2(old->handle());
|
sqlite3_close_v2(old->handle());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CDClientDatabase::Disconnect() {
|
||||||
|
g_Running.clear();
|
||||||
|
conn->close();
|
||||||
|
isConnected = false;
|
||||||
|
}
|
||||||
|
|
||||||
//! Queries the CDClient
|
//! Queries the CDClient
|
||||||
CppSQLite3Query CDClientDatabase::ExecuteQuery(const std::string& query) {
|
CppSQLite3Query CDClientDatabase::ExecuteQuery(const std::string& query) {
|
||||||
return conn->execQuery(query.c_str());
|
return conn->execQuery(query.c_str());
|
||||||
|
|||||||
@@ -32,6 +32,9 @@ namespace CDClientDatabase {
|
|||||||
*/
|
*/
|
||||||
void Reconnect(const std::string& filename);
|
void Reconnect(const std::string& filename);
|
||||||
|
|
||||||
|
//! Closes the connection (tests: each test starts without one)
|
||||||
|
void Disconnect();
|
||||||
|
|
||||||
//! Queries the CDClient
|
//! Queries the CDClient
|
||||||
/*!
|
/*!
|
||||||
\param query The query
|
\param query The query
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
#include "Game.h"
|
#include "Game.h"
|
||||||
#include "Logger.h"
|
#include "Logger.h"
|
||||||
#include "dServer.h"
|
#include "dServer.h"
|
||||||
|
#include "CDClientDatabase.h"
|
||||||
#include "CDClientManager.h"
|
#include "CDClientManager.h"
|
||||||
#include "EntityInfo.h"
|
#include "EntityInfo.h"
|
||||||
#include "EntityManager.h"
|
#include "EntityManager.h"
|
||||||
@@ -85,6 +86,8 @@ protected:
|
|||||||
}
|
}
|
||||||
delete Game::config;
|
delete Game::config;
|
||||||
Game::config = nullptr;
|
Game::config = nullptr;
|
||||||
|
// A CDClient a test opened (often an in-memory one with only the tables it needs) isn't the next test's
|
||||||
|
CDClientDatabase::Disconnect();
|
||||||
}
|
}
|
||||||
|
|
||||||
EntityInfo info{};
|
EntityInfo info{};
|
||||||
|
|||||||
Reference in New Issue
Block a user