summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-06-01 01:09:49 +0300
committerAndrei Karas <akaras@inbox.ru>2017-06-01 01:09:49 +0300
commitf9bf8c53dae0fbe170d036727ced2012888d8bbe (patch)
treeaf860fb03da121b7d50fd2c44bc7b0ee815d7e0d
parentdb48ba035f350f2d34af2cec49ed6a74fe8d9019 (diff)
downloadmanaplus-f9bf8c53dae0fbe170d036727ced2012888d8bbe.tar.gz
manaplus-f9bf8c53dae0fbe170d036727ced2012888d8bbe.tar.bz2
manaplus-f9bf8c53dae0fbe170d036727ced2012888d8bbe.tar.xz
manaplus-f9bf8c53dae0fbe170d036727ced2012888d8bbe.zip
Add other constructors into windows creation tests.
-rw-r--r--src/gui/windowmanager_unittest.cc65
1 files changed, 62 insertions, 3 deletions
diff --git a/src/gui/windowmanager_unittest.cc b/src/gui/windowmanager_unittest.cc
index 3810252ab..0928cb121 100644
--- a/src/gui/windowmanager_unittest.cc
+++ b/src/gui/windowmanager_unittest.cc
@@ -51,6 +51,7 @@
#include "gui/popups/textpopup.h"
#include "gui/widgets/desktop.h"
+#include "gui/widgets/emoteshortcutcontainer.h"
#include "gui/widgets/createwidget.h"
#include "gui/windows/bankwindow.h"
@@ -212,7 +213,15 @@ TEST_CASE("Windows tests", "windowmanager")
mainGraphics->updateScreen();
delete2(bankWindow);
}
- SECTION("buyDialog")
+ SECTION("buyDialog1")
+ {
+ BuyDialog *dialog;
+ CREATEWIDGETV0(dialog, BuyDialog);
+ gui->draw();
+ mainGraphics->updateScreen();
+ delete2(dialog);
+ }
+ SECTION("buyDialog2")
{
BuyDialog *dialog;
CREATEWIDGETV(dialog, BuyDialog,
@@ -222,6 +231,37 @@ TEST_CASE("Windows tests", "windowmanager")
mainGraphics->updateScreen();
delete2(dialog);
}
+#ifdef TMWA_SUPPORT
+ SECTION("buyDialog3")
+ {
+ BuyDialog *dialog;
+ CREATEWIDGETV(dialog, BuyDialog,
+ "user",
+ DEFAULT_CURRENCY);
+ gui->draw();
+ mainGraphics->updateScreen();
+ delete2(dialog);
+ }
+#endif // TMWA_SUPPORT
+ SECTION("buyDialog4")
+ {
+ BuyDialog *dialog;
+ BeingTypeId id = static_cast<BeingTypeId>(1);
+ Map *map = new Map("test map",
+ 10, 10,
+ 32, 32);
+ Being *being = new Being(BeingId_zero,
+ ActorType::Avatar,
+ id,
+ map);
+ CREATEWIDGETV(dialog, BuyDialog,
+ being,
+ DEFAULT_CURRENCY);
+ gui->draw();
+ mainGraphics->updateScreen();
+ delete2(dialog);
+ delete2(being);
+ }
SECTION("BuyingStoreSellDialog")
{
BuyingStoreSellDialog *dialog;
@@ -231,7 +271,7 @@ TEST_CASE("Windows tests", "windowmanager")
mainGraphics->updateScreen();
delete2(dialog);
}
- SECTION("BuySellDialog")
+ SECTION("BuySellDialog1")
{
BuySellDialog *dialog;
CREATEWIDGETV(dialog, BuySellDialog, BeingId_zero);
@@ -239,6 +279,14 @@ TEST_CASE("Windows tests", "windowmanager")
mainGraphics->updateScreen();
delete2(dialog);
}
+ SECTION("BuySellDialog2")
+ {
+ BuySellDialog *dialog;
+ CREATEWIDGETV(dialog, BuySellDialog, "user");
+ gui->draw();
+ mainGraphics->updateScreen();
+ delete2(dialog);
+ }
SECTION("ChangeEmailDialog")
{
LoginData data;
@@ -561,7 +609,18 @@ TEST_CASE("Windows tests", "windowmanager")
mainGraphics->updateScreen();
delete2(shopWindow);
}
- SECTION("ShortcutWindow")
+ SECTION("ShortcutWindow1")
+ {
+ EmoteShortcutContainer *container =
+ new EmoteShortcutContainer(nullptr);
+ CREATEWIDGETV(itemShortcutWindow, ShortcutWindow,
+ "name",
+ container);
+ gui->draw();
+ mainGraphics->updateScreen();
+ delete2(itemShortcutWindow);
+ }
+ SECTION("ShortcutWindow2")
{
CREATEWIDGETV(itemShortcutWindow, ShortcutWindow, "");
gui->draw();