From 9e16f95bd0083af4eeacba5850c22d95529cce79 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 14 Feb 2018 23:19:48 +0300 Subject: Add unit test for creation window CharCreateDialog. --- data/test/CMakeLists.txt | 4 + data/test/Makefile.am | 6 +- .../graphics/sprites/hairstyles/hairstyle01.png | Bin 0 -> 119 bytes .../graphics/sprites/hairstyles/hairstyle01.xml | 188 +++++++++++++++++++++ .../graphics/sprites/hairstyles/hairstyle02.png | Bin 0 -> 1643 bytes .../graphics/sprites/hairstyles/hairstyle02.xml | 11 ++ data/test/items.xml | 78 --------- src/unittests/fs/virtfs/virtfs.cc | 4 +- src/unittests/fs/virtfs/virtfs1_enumerate.cc | 4 +- src/unittests/gui/windowmanager.cc | 19 ++- 10 files changed, 222 insertions(+), 92 deletions(-) create mode 100644 data/test/graphics/sprites/hairstyles/hairstyle01.png create mode 100644 data/test/graphics/sprites/hairstyles/hairstyle01.xml create mode 100644 data/test/graphics/sprites/hairstyles/hairstyle02.png create mode 100644 data/test/graphics/sprites/hairstyles/hairstyle02.xml diff --git a/data/test/CMakeLists.txt b/data/test/CMakeLists.txt index cca62955c..051d2beb8 100644 --- a/data/test/CMakeLists.txt +++ b/data/test/CMakeLists.txt @@ -21,6 +21,10 @@ SET(FILES test5.zip testintmap.xml units.xml + graphics/sprites/hairstyles/hairstyle01.png + graphics/sprites/hairstyles/hairstyle01.xml + graphics/sprites/hairstyles/hairstyle02.png + graphics/sprites/hairstyles/hairstyle02.xml ) INSTALL(FILES ${FILES} DESTINATION ${DATA_DIR}/test) diff --git a/data/test/Makefile.am b/data/test/Makefile.am index fd185e722..0fb49e6a1 100644 --- a/data/test/Makefile.am +++ b/data/test/Makefile.am @@ -24,7 +24,11 @@ test_DATA = \ test4.zip \ test5.zip \ testintmap.xml \ - units.xml + units.xml \ + graphics/sprites/hairstyles/hairstyle01.png \ + graphics/sprites/hairstyles/hairstyle01.xml \ + graphics/sprites/hairstyles/hairstyle02.png \ + graphics/sprites/hairstyles/hairstyle02.xml EXTRA_DIST = \ $(test_DATA) \ diff --git a/data/test/graphics/sprites/hairstyles/hairstyle01.png b/data/test/graphics/sprites/hairstyles/hairstyle01.png new file mode 100644 index 000000000..1ef26f96f Binary files /dev/null and b/data/test/graphics/sprites/hairstyles/hairstyle01.png differ diff --git a/data/test/graphics/sprites/hairstyles/hairstyle01.xml b/data/test/graphics/sprites/hairstyles/hairstyle01.xml new file mode 100644 index 000000000..52fd83e46 --- /dev/null +++ b/data/test/graphics/sprites/hairstyles/hairstyle01.xml @@ -0,0 +1,188 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/data/test/graphics/sprites/hairstyles/hairstyle02.png b/data/test/graphics/sprites/hairstyles/hairstyle02.png new file mode 100644 index 000000000..99177930c Binary files /dev/null and b/data/test/graphics/sprites/hairstyles/hairstyle02.png differ diff --git a/data/test/graphics/sprites/hairstyles/hairstyle02.xml b/data/test/graphics/sprites/hairstyles/hairstyle02.xml new file mode 100644 index 000000000..f11e4c31b --- /dev/null +++ b/data/test/graphics/sprites/hairstyles/hairstyle02.xml @@ -0,0 +1,11 @@ + + + + + + + diff --git a/data/test/items.xml b/data/test/items.xml index b18453974..c3a36f5c3 100644 --- a/data/test/items.xml +++ b/data/test/items.xml @@ -34,84 +34,6 @@ Colors for dyeable equipments or items are now set up by itemcolors.xml. hairstyles/hairstyle02.xml - - hairstyles/hairstyle03.xml - - - hairstyles/hairstyle04.xml - - - hairstyles/hairstyle05.xml - - - hairstyles/hairstyle06.xml - - - hairstyles/hairstyle07.xml - - - hairstyles/hairstyle08.xml - - - hairstyles/hairstyle09.xml - - - hairstyles/hairstyle10.xml - - - hairstyles/hairstyle11.xml - - - hairstyles/hairstyle12.xml - - - hairstyles/hairstyle13.xml - - - hairstyles/hairstyle14.xml - - - hairstyles/hairstyle15.xml - - - hairstyles/hairstyle16.xml - - - hairstyles/hairstyle17.xml - - - hairstyles/hairstyle18.xml - - - hairstyles/hairstyle19.xml - - - hairstyles/hairstyle20.xml - - - hairstyles/hairstyle21.xml - - - hairstyles/hairstyle22.xml - - - hairstyles/hairstyle23.xml - - - hairstyles/hairstyle24.xml - - - hairstyles/hairstyle25.xml - - - hairstyles/hairstyle26.xml - - - hairstyles/hairstyle27.xml - - - hairstyles/hairstyle28.xml - diff --git a/src/unittests/fs/virtfs/virtfs.cc b/src/unittests/fs/virtfs/virtfs.cc index 5bdfda2ea..d316b4ac5 100644 --- a/src/unittests/fs/virtfs/virtfs.cc +++ b/src/unittests/fs/virtfs/virtfs.cc @@ -256,8 +256,8 @@ TEST_CASE("VirtFs enumerateFiles1", "") VirtFs::List *list = nullptr; - const int cnt1 = VirtFs::exists("test/test2.txt") ? 28 : 27; - const int cnt2 = 28; + const int cnt1 = VirtFs::exists("test/test2.txt") ? 29 : 28; + const int cnt2 = 29; VirtFs::permitLinks(false); list = VirtFs::enumerateFiles("test"); diff --git a/src/unittests/fs/virtfs/virtfs1_enumerate.cc b/src/unittests/fs/virtfs/virtfs1_enumerate.cc index 22db74cb2..25f523adf 100644 --- a/src/unittests/fs/virtfs/virtfs1_enumerate.cc +++ b/src/unittests/fs/virtfs/virtfs1_enumerate.cc @@ -82,8 +82,8 @@ TEST_CASE("VirtFs1 enumerateFiles1", "") VirtFs::List *list = nullptr; - const int cnt1 = VirtFs::exists("test/test2.txt") ? 28 : 27; - const int cnt2 = 28; + const int cnt1 = VirtFs::exists("test/test2.txt") ? 29 : 28; + const int cnt2 = 29; VirtFs::permitLinks(false); list = VirtFs::enumerateFiles("test"); diff --git a/src/unittests/gui/windowmanager.cc b/src/unittests/gui/windowmanager.cc index fb937f0b4..fa708648b 100644 --- a/src/unittests/gui/windowmanager.cc +++ b/src/unittests/gui/windowmanager.cc @@ -60,6 +60,7 @@ #include "gui/windows/buydialog.h" #include "gui/windows/buyingstoreselldialog.h" #include "gui/windows/buyselldialog.h" +#include "gui/windows/charcreatedialog.h" #include "gui/windows/charselectdialog.h" #include "gui/windows/changeemaildialog.h" #include "gui/windows/changepassworddialog.h" @@ -323,15 +324,15 @@ TEST_CASE("Windows tests", "windowmanager") } 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); + 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") { -- cgit v1.2.3-60-g2f50