From c97f245c597ebe8f488e72c435960dbee9bf66c6 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 23 Aug 2013 22:08:12 +0300 Subject: fix Client creation in unit tests. --- src/animatedsprite_unittest.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/animatedsprite_unittest.cc') diff --git a/src/animatedsprite_unittest.cc b/src/animatedsprite_unittest.cc index 12449148f..fa47e4808 100644 --- a/src/animatedsprite_unittest.cc +++ b/src/animatedsprite_unittest.cc @@ -52,7 +52,7 @@ static void init() TEST(AnimatedSprite, basic) { Client::Options options; - Client client(options); + client = new Client(options); init(); AnimatedSprite *sprite = AnimatedSprite::load( @@ -70,12 +70,14 @@ TEST(AnimatedSprite, basic) EXPECT_EQ(false, sprite->update(11)); EXPECT_EQ(10, sprite->getFrameTime()); EXPECT_EQ(0, sprite->getFrameIndex()); + delete client; + client = nullptr; } TEST(AnimatedSprite, basic2) { Client::Options options; - Client client(options); + client = new Client(options); init(); AnimatedSprite *sprite = AnimatedSprite::load( @@ -146,5 +148,8 @@ TEST(AnimatedSprite, basic2) EXPECT_EQ(true, sprite2->update(1 + 10 + 20 + 10 + 25 + 10 + 10 + 1)); EXPECT_EQ(1, sprite2->getFrameIndex()); EXPECT_EQ(1, sprite2->getFrameTime()); + + delete client; + client = nullptr; } -- cgit v1.2.3-60-g2f50