diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-08-23 22:08:12 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-08-24 21:08:16 +0300 |
commit | c97f245c597ebe8f488e72c435960dbee9bf66c6 (patch) | |
tree | 472aa07dfc05d06f8732e5fc24c7960a07d10494 | |
parent | c2a7004213529c403faeb6fdcc374699aa2f53b5 (diff) | |
download | plus-c97f245c597ebe8f488e72c435960dbee9bf66c6.tar.gz plus-c97f245c597ebe8f488e72c435960dbee9bf66c6.tar.bz2 plus-c97f245c597ebe8f488e72c435960dbee9bf66c6.tar.xz plus-c97f245c597ebe8f488e72c435960dbee9bf66c6.zip |
fix Client creation in unit tests.
-rw-r--r-- | src/animatedsprite_unittest.cc | 9 | ||||
-rw-r--r-- | src/gui/widgets/browserbox_unittest.cc | 5 |
2 files changed, 11 insertions, 3 deletions
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; } diff --git a/src/gui/widgets/browserbox_unittest.cc b/src/gui/widgets/browserbox_unittest.cc index 30ec6d6dd..1c38d735f 100644 --- a/src/gui/widgets/browserbox_unittest.cc +++ b/src/gui/widgets/browserbox_unittest.cc @@ -46,7 +46,7 @@ TEST(browserbox, test1) PHYSFS_init("manaplus"); dirSeparator = "/"; Client::Options options; - Client client(options); + client = new Client(options); logger = new Logger(); imageHelper = new SDLImageHelper(); @@ -148,4 +148,7 @@ TEST(browserbox, test1) box->addRow(row); row = "##1%%2"; box->addRow(row); + + delete client; + client = nullptr; } |