diff --git a/src/unittest/test.cpp b/src/unittest/test.cpp index 8f0eaf855a..6eeb77feb7 100644 --- a/src/unittest/test.cpp +++ b/src/unittest/test.cpp @@ -32,25 +32,6 @@ content_t t_CONTENT_BRICK; //// TestGameDef //// -class TestGameDef : public DummyGameDef { -public: - TestGameDef(); - ~TestGameDef() = default; - - void defineSomeNodes(); - - bool joinModChannel(const std::string &channel); - bool leaveModChannel(const std::string &channel); - bool sendModChannelMessage(const std::string &channel, const std::string &message); - ModChannel *getModChannel(const std::string &channel) - { - return m_modchannel_mgr->getModChannel(channel); - } - -private: - std::unique_ptr m_modchannel_mgr; -}; - TestGameDef::TestGameDef() : DummyGameDef(), diff --git a/src/unittest/test.h b/src/unittest/test.h index dcecb9fb4c..04a02556fe 100644 --- a/src/unittest/test.h +++ b/src/unittest/test.h @@ -4,15 +4,21 @@ #pragma once -#include -#include -#include -#include - +#include "dummygamedef.h" #include "irrlichttypes_bloated.h" -#include "porting.h" #include "filesys.h" #include "mapnode.h" +#include "modchannels.h" +#include "porting.h" + +#include +#include +#include +#include +#include +#include +#include +#include class TestFailedException { // don’t derive from std::exception to avoid accidental catch public: @@ -105,6 +111,25 @@ public: } }; +class TestGameDef : public DummyGameDef { +public: + TestGameDef(); + ~TestGameDef() = default; + + void defineSomeNodes(); + + bool joinModChannel(const std::string &channel); + bool leaveModChannel(const std::string &channel); + bool sendModChannelMessage(const std::string &channel, const std::string &message); + ModChannel *getModChannel(const std::string &channel) + { + return m_modchannel_mgr->getModChannel(channel); + } + +private: + std::unique_ptr m_modchannel_mgr; +}; + // A few item and node definitions for those tests that need them extern content_t t_CONTENT_STONE; extern content_t t_CONTENT_GRASS;