summaryrefslogtreecommitdiffstats
path: root/test/unit/ui/edit_test.cpp
diff options
context:
space:
mode:
authorkrzys-h <krzys_h@interia.pl>2013-03-28 16:00:09 +0100
committerkrzys-h <krzys_h@interia.pl>2013-03-28 16:00:09 +0100
commit85dcc51434629adab3d523d3e1ec3cf1173002ec (patch)
treecb84061a43fd6316e9d834d64c94b9d1a1bb4d43 /test/unit/ui/edit_test.cpp
parentb284fd74f32d31fa287e1e62800c122c2d1efd9d (diff)
parent212f2e41f88a85ad7f47bc526b79fae2b4952d3a (diff)
downloadcolobot-85dcc51434629adab3d523d3e1ec3cf1173002ec.tar.gz
colobot-85dcc51434629adab3d523d3e1ec3cf1173002ec.tar.bz2
colobot-85dcc51434629adab3d523d3e1ec3cf1173002ec.zip
Merge branch 'dev' of github.com:colobot/colobot into dev
Diffstat (limited to 'test/unit/ui/edit_test.cpp')
-rw-r--r--test/unit/ui/edit_test.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/test/unit/ui/edit_test.cpp b/test/unit/ui/edit_test.cpp
index 2f31a89..428b66a 100644
--- a/test/unit/ui/edit_test.cpp
+++ b/test/unit/ui/edit_test.cpp
@@ -9,10 +9,16 @@
class CEditTest : public testing::Test
{
public:
- CEditTest(){};
+ CEditTest()
+ : m_robotMain(nullptr)
+ , m_engine(nullptr)
+ , m_edit(nullptr)
+ {}
virtual void SetUp()
{
+ m_robotMain = new CRobotMain(&m_app);
+
m_engine = new Gfx::CEngine(nullptr);
m_edit = new Ui::CEdit;
@@ -20,6 +26,8 @@ public:
virtual void TearDown()
{
+ delete m_robotMain;
+ m_robotMain = nullptr;
delete m_engine;
m_engine = nullptr;
delete m_edit;
@@ -33,6 +41,7 @@ public:
protected:
CApplication m_app;
+ CRobotMain* m_robotMain;
Gfx::CEngine * m_engine;
Ui::CEdit * m_edit;
CLogger m_logger;
@@ -46,7 +55,7 @@ TEST_F(CEditTest, WriteTest)
ASSERT_TRUE(true);
CTextMock * text = dynamic_cast<CTextMock *>(m_engine->GetText());
EXPECT_CALL(*text, GetCharWidth(_, _, _, _)).WillRepeatedly(Return(1.0f));
- EXPECT_CALL(*text, GetStringWidth(_, _, _)).WillOnce(Return(1.0f));
+ EXPECT_CALL(*text, GetStringWidth(_, _, _, _)).WillOnce(Return(1.0f));
std::string filename = "test.file";
m_edit->SetMaxChar(Ui::EDITSTUDIOMAX);
m_edit->SetAutoIndent(true);