From 52cf9e2815688481f689e03e67c5fc983ed1351b Mon Sep 17 00:00:00 2001 From: Piotr Dziwinski Date: Tue, 24 Jun 2014 17:38:28 +0200 Subject: Fix test compilation --- test/unit/CMakeLists.txt | 1 + test/unit/ui/CMakeLists.txt | 1 + test/unit/ui/stubs/app_stub.cpp | 10 ---------- 3 files changed, 2 insertions(+), 10 deletions(-) (limited to 'test/unit') diff --git a/test/unit/CMakeLists.txt b/test/unit/CMakeLists.txt index 269ffc2..bdb5a67 100644 --- a/test/unit/CMakeLists.txt +++ b/test/unit/CMakeLists.txt @@ -23,6 +23,7 @@ configure_file(${SRC_DIR}/common/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/comm # Code sources set(COLOBOT_SOURCES ${SRC_DIR}/app/app.cpp +${SRC_DIR}/app/gamedata.cpp ${SRC_DIR}/app/pausemanager.cpp ${SRC_DIR}/app/system.cpp ${SRC_DIR}/app/${SYSTEM_CPP_MODULE} diff --git a/test/unit/ui/CMakeLists.txt b/test/unit/ui/CMakeLists.txt index 503f84b..7f7b2f8 100644 --- a/test/unit/ui/CMakeLists.txt +++ b/test/unit/ui/CMakeLists.txt @@ -17,6 +17,7 @@ else() endif() add_executable(edit_test +${SRC_DIR}/app/gamedata.cpp ${SRC_DIR}/app/system.cpp ${SRC_DIR}/app/${SYSTEM_CPP_MODULE} ${SRC_DIR}/app/system_other.cpp diff --git a/test/unit/ui/stubs/app_stub.cpp b/test/unit/ui/stubs/app_stub.cpp index 960972f..95430d8 100644 --- a/test/unit/ui/stubs/app_stub.cpp +++ b/test/unit/ui/stubs/app_stub.cpp @@ -21,11 +21,6 @@ CApplication::~CApplication() { } -std::string CApplication::GetDataFilePath(DataDir /* dataDir */, const std::string& subpath) const -{ - return subpath; -} - CSoundInterface* CApplication::GetSound() { return nullptr; @@ -36,11 +31,6 @@ CEventQueue* CApplication::GetEventQueue() return nullptr; } -std::string CApplication::GetDataDirPath() const -{ - return ""; -} - Event CApplication::CreateUpdateEvent() { return Event(EVENT_NULL); -- cgit v1.2.3-1-g7c22 From 76d01b44f762357dffe91b0e884687bb34fa537d Mon Sep 17 00:00:00 2001 From: Piotr Dziwinski Date: Tue, 24 Jun 2014 19:51:48 +0200 Subject: Fix test compilation --- test/unit/graphics/core/device_mock.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'test/unit') diff --git a/test/unit/graphics/core/device_mock.h b/test/unit/graphics/core/device_mock.h index 9e75daf..498239f 100644 --- a/test/unit/graphics/core/device_mock.h +++ b/test/unit/graphics/core/device_mock.h @@ -105,4 +105,6 @@ public: MOCK_METHOD1(SetFillMode, void(Gfx::FillMode mode)); MOCK_METHOD0(GetFillMode, Gfx::FillMode()); + + MOCK_CONST_METHOD0(GetFrameBufferPixels, void*()); }; -- cgit v1.2.3-1-g7c22 From 092e7cc68de3d4e46505a2931ce266b4e5aabaab Mon Sep 17 00:00:00 2001 From: krzys-h Date: Thu, 26 Jun 2014 22:14:30 +0200 Subject: Fixed tests --- test/unit/ui/edit_test.cpp | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'test/unit') diff --git a/test/unit/ui/edit_test.cpp b/test/unit/ui/edit_test.cpp index 4a4063e..34af013 100644 --- a/test/unit/ui/edit_test.cpp +++ b/test/unit/ui/edit_test.cpp @@ -1,4 +1,5 @@ #include "app/app.h" +#include "app/gamedata.h" #include "ui/edit.h" @@ -14,6 +15,7 @@ class CEditTest : public testing::Test public: CEditTest() : m_robotMain(nullptr) + , m_gameData(nullptr) , m_engine(nullptr) , m_edit(nullptr) {} @@ -21,21 +23,24 @@ public: virtual void SetUp() { m_robotMain = new CRobotMain(&m_app, false); - + + m_gameData = new CGameData(); + m_engine = new Gfx::CEngine(nullptr); - + m_edit = new Ui::CEdit; } virtual void TearDown() { - delete m_robotMain; - m_robotMain = nullptr; - delete m_engine; - m_engine = nullptr; delete m_edit; m_edit = nullptr; - + delete m_engine; + m_engine = nullptr; + delete m_gameData; + m_gameData = nullptr; + delete m_robotMain; + m_robotMain = nullptr; } virtual ~CEditTest() { @@ -45,6 +50,7 @@ public: protected: CApplication m_app; CRobotMain* m_robotMain; + CGameData * m_gameData; Gfx::CEngine * m_engine; Ui::CEdit * m_edit; CLogger m_logger; -- cgit v1.2.3-1-g7c22