summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-08-02 17:20:30 +0300
committerAndrei Karas <akaras@inbox.ru>2016-08-02 17:20:30 +0300
commitbb6e522a1c35b463e2fc51b048a4aaa5c3fc35ba (patch)
treea026321de2bf68fbdb9972ee3fdbf894097d5f04 /src/gui
parent70a9ee7cc6a2402c33c3cdd33bc86f02fcb59ade (diff)
downloadplus-bb6e522a1c35b463e2fc51b048a4aaa5c3fc35ba.tar.gz
plus-bb6e522a1c35b463e2fc51b048a4aaa5c3fc35ba.tar.bz2
plus-bb6e522a1c35b463e2fc51b048a4aaa5c3fc35ba.tar.xz
plus-bb6e522a1c35b463e2fc51b048a4aaa5c3fc35ba.zip
Fix some broken window draw unit tests.
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/widgets/characterdisplay.cpp6
-rw-r--r--src/gui/windowmanager_unittest.cc12
2 files changed, 14 insertions, 4 deletions
diff --git a/src/gui/widgets/characterdisplay.cpp b/src/gui/widgets/characterdisplay.cpp
index 7aa9fe795..9ab8c2488 100644
--- a/src/gui/widgets/characterdisplay.cpp
+++ b/src/gui/widgets/characterdisplay.cpp
@@ -111,12 +111,14 @@ void CharacterDisplay::update()
void CharacterDisplay::widgetHidden(const Event &event A_UNUSED)
{
- textPopup->setVisible(Visible_false);
+ if (textPopup)
+ textPopup->setVisible(Visible_false);
}
void CharacterDisplay::mouseExited(MouseEvent &event A_UNUSED)
{
- textPopup->setVisible(Visible_false);
+ if (textPopup)
+ textPopup->setVisible(Visible_false);
}
void CharacterDisplay::mouseMoved(MouseEvent &event A_UNUSED)
diff --git a/src/gui/windowmanager_unittest.cc b/src/gui/windowmanager_unittest.cc
index 5366f3e9a..b58d610d2 100644
--- a/src/gui/windowmanager_unittest.cc
+++ b/src/gui/windowmanager_unittest.cc
@@ -47,6 +47,7 @@
#include "gui/windows/buydialog.h"
#include "gui/windows/buyingstoreselldialog.h"
#include "gui/windows/buyselldialog.h"
+#include "gui/windows/charselectdialog.h"
#include "gui/windows/changeemaildialog.h"
#include "gui/windows/changepassworddialog.h"
#include "gui/windows/chatwindow.h"
@@ -97,6 +98,7 @@
#include "net/logindata.h"
+#include "net/eathena/charserverhandler.h"
#include "net/eathena/inventoryhandler.h"
#include "net/eathena/serverfeatures.h"
#include "net/eathena/playerhandler.h"
@@ -145,6 +147,7 @@ TEST_CASE("Windows tests", "windowmanager")
gui->postInit(mainGraphics);
touchManager.init();
Units::loadUnits();
+ charServerHandler = new EAthena::CharServerHandler;
serverFeatures = new EAthena::ServerFeatures;
inventoryHandler = new EAthena::InventoryHandler;
playerHandler = new EAthena::PlayerHandler;
@@ -203,24 +206,29 @@ TEST_CASE("Windows tests", "windowmanager")
mainGraphics->updateScreen();
delete2(dialog);
}
-/*
SECTION("CharSelectDialog")
{
LoginData data;
CharSelectDialog *dialog;
CREATEWIDGETV(dialog, CharSelectDialog, data);
+ gui->draw();
+ mainGraphics->updateScreen();
+ delete2(dialog);
}
SECTION("CharCreateDialog")
{
+/*
LoginData data;
CharSelectDialog *dialog2;
CREATEWIDGETV(dialog2, CharSelectDialog, data);
CharCreateDialog *dialog;
CREATEWIDGETV(dialog, CharCreateDialog, dialog2, 0);
+ gui->draw();
+ mainGraphics->updateScreen();
delete2(dialog);
delete2(dialog2);
- }
*/
+ }
SECTION("ChatWindow")
{
CREATEWIDGETV0(chatWindow, ChatWindow);