From 95661918ce5da32cce84055e80fcc15343591638 Mon Sep 17 00:00:00 2001 From: Piotr Dziwinski Date: Fri, 20 Dec 2013 20:18:30 +0100 Subject: Some further refactoring and test corrections --- test/unit/ui/edit_test.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'test/unit/ui/edit_test.cpp') diff --git a/test/unit/ui/edit_test.cpp b/test/unit/ui/edit_test.cpp index 21af00f..4a4063e 100644 --- a/test/unit/ui/edit_test.cpp +++ b/test/unit/ui/edit_test.cpp @@ -51,6 +51,7 @@ protected: }; using ::testing::_; +using ::testing::An; using ::testing::Return; TEST_F(CEditTest, WriteTest) @@ -58,7 +59,7 @@ TEST_F(CEditTest, WriteTest) ASSERT_TRUE(true); CTextMock * text = dynamic_cast(m_engine->GetText()); EXPECT_CALL(*text, GetCharWidth(_, _, _, _)).WillRepeatedly(Return(1.0f)); - EXPECT_CALL(*text, GetStringWidth(_, _, _, _)).WillOnce(Return(1.0f)); + EXPECT_CALL(*text, GetStringWidth(An(), _, _, _)).WillOnce(Return(1.0f)); std::string filename = "test.file"; m_edit->SetMaxChar(Ui::EDITSTUDIOMAX); m_edit->SetAutoIndent(true); -- 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/ui/edit_test.cpp') 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