mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-11-23 14:07:20 +00:00
5942182486
* Logger: Rename logger to Logger from dLogger * Logger: Add compile time filename Fix include issues Add writers Add macros Add macro to force compilation * Logger: Replace calls with macros Allows for filename and line number to be logged * Logger: Add comments and remove extra define Logger: Replace with unique_ptr also flush console at exit. regular file writer should be flushed on file close. Logger: Remove constexpr on variable * Logger: Simplify code * Update Logger.cpp
52 lines
1.3 KiB
C++
52 lines
1.3 KiB
C++
#ifndef __GAMEDEPENDENCIES__H__
|
|
#define __GAMEDEPENDENCIES__H__
|
|
|
|
#include "Game.h"
|
|
#include "Logger.h"
|
|
#include "dServer.h"
|
|
#include "EntityInfo.h"
|
|
#include "EntityManager.h"
|
|
#include "dConfig.h"
|
|
#include <gtest/gtest.h>
|
|
|
|
class dZoneManager;
|
|
class AssetManager;
|
|
|
|
class dServerMock : public dServer {
|
|
RakNet::BitStream* sentBitStream = nullptr;
|
|
public:
|
|
dServerMock() {};
|
|
~dServerMock() {};
|
|
RakNet::BitStream* GetMostRecentBitStream() { return sentBitStream; };
|
|
void Send(RakNet::BitStream* bitStream, const SystemAddress& sysAddr, bool broadcast) override { sentBitStream = bitStream; };
|
|
};
|
|
|
|
class GameDependenciesTest : public ::testing::Test {
|
|
protected:
|
|
void SetUpDependencies() {
|
|
info.pos = NiPoint3::ZERO;
|
|
info.rot = NiQuaternion::IDENTITY;
|
|
info.scale = 1.0f;
|
|
info.spawner = nullptr;
|
|
info.lot = 999;
|
|
Game::logger = new Logger("./testing.log", true, true);
|
|
Game::server = new dServerMock();
|
|
Game::config = new dConfig("worldconfig.ini");
|
|
Game::entityManager = new EntityManager();
|
|
}
|
|
|
|
void TearDownDependencies() {
|
|
if (Game::server) delete Game::server;
|
|
if (Game::entityManager) delete Game::entityManager;
|
|
if (Game::logger) {
|
|
Game::logger->Flush();
|
|
delete Game::logger;
|
|
}
|
|
if (Game::config) delete Game::config;
|
|
}
|
|
|
|
EntityInfo info{};
|
|
};
|
|
|
|
#endif //!__GAMEDEPENDENCIES__H__
|