summaryrefslogtreecommitdiff
path: root/src/unittests
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-12-28 02:36:11 +0300
committerAndrei Karas <akaras@inbox.ru>2017-12-28 02:36:11 +0300
commit28e53f73dff6f889a9eaeb69d19767dfc71afddd (patch)
treed3d638be1ddeb179937aca805c2be95a30ebe445 /src/unittests
parent2134c91e8f9793d07206febf22d5310132f3bc7e (diff)
downloadmv-28e53f73dff6f889a9eaeb69d19767dfc71afddd.tar.gz
mv-28e53f73dff6f889a9eaeb69d19767dfc71afddd.tar.bz2
mv-28e53f73dff6f889a9eaeb69d19767dfc71afddd.tar.xz
mv-28e53f73dff6f889a9eaeb69d19767dfc71afddd.zip
Fix unit tests compilation.
Diffstat (limited to 'src/unittests')
-rw-r--r--src/unittests/gui/fonts/textchunklist.cc94
-rw-r--r--src/unittests/gui/widgets/browserbox.cc92
-rw-r--r--src/unittests/gui/windowmanager.cc16
-rw-r--r--src/unittests/resources/map/speciallayer.cc2
-rw-r--r--src/unittests/resources/resourcemanager/resourcemanager.cc6
5 files changed, 110 insertions, 100 deletions
diff --git a/src/unittests/gui/fonts/textchunklist.cc b/src/unittests/gui/fonts/textchunklist.cc
index c8df87455..7c970f793 100644
--- a/src/unittests/gui/fonts/textchunklist.cc
+++ b/src/unittests/gui/fonts/textchunklist.cc
@@ -41,7 +41,7 @@ TEST_CASE("TextChunkList add 1", "TextChunkList")
TextChunkList list;
TextChunk *const chunk = new TextChunk("test",
- Color(1, 2, 3), Color(2, 3, 4), nullptr);
+ Color(1, 2, 3, 255U), Color(2, 3, 4, 255U), nullptr);
list.insertFirst(chunk);
@@ -65,9 +65,9 @@ TEST_CASE("TextChunkList add 2", "TextChunkList")
TextChunkList list;
TextChunk *const chunk1 = new TextChunk("test",
- Color(1, 2, 3), Color(3, 4, 5), nullptr);
+ Color(1, 2, 3, 255U), Color(3, 4, 5, 255U), nullptr);
TextChunk *const chunk2 = new TextChunk("test",
- Color(2, 3, 4), Color(4, 5, 6), nullptr);
+ Color(2, 3, 4, 255U), Color(4, 5, 6, 255U), nullptr);
list.insertFirst(chunk2);
list.insertFirst(chunk1);
@@ -97,7 +97,7 @@ TEST_CASE("TextChunkList addRemoveBack 1", "TextChunkList")
TextChunkList list;
TextChunk *const chunk = new TextChunk("test",
- Color(1, 2, 3), Color(1, 2, 3), nullptr);
+ Color(1, 2, 3, 255U), Color(1, 2, 3, 255U), nullptr);
list.insertFirst(chunk);
list.removeBack();
@@ -114,9 +114,9 @@ TEST_CASE("TextChunkList addRemoveBack 2", "TextChunkList")
TextChunkList list;
TextChunk *const chunk1 = new TextChunk("test",
- Color(1, 2, 3), Color(1, 2, 3), nullptr);
+ Color(1, 2, 3, 255U), Color(1, 2, 3, 255U), nullptr);
TextChunk *const chunk2 = new TextChunk("test2",
- Color(1, 2, 4), Color(1, 2, 5), nullptr);
+ Color(1, 2, 4, 255U), Color(1, 2, 5, 255U), nullptr);
list.insertFirst(chunk2);
list.insertFirst(chunk1);
@@ -142,9 +142,9 @@ TEST_CASE("TextChunkList addRemoveBack 3", "TextChunkList")
TextChunkList list;
TextChunk *const chunk1 = new TextChunk("test",
- Color(1, 2, 3), Color(1, 2, 3), nullptr);
+ Color(1, 2, 3, 255U), Color(1, 2, 3, 255U), nullptr);
TextChunk *const chunk2 = new TextChunk("test2",
- Color(2, 3, 4), Color(2, 3, 4), nullptr);
+ Color(2, 3, 4, 255U), Color(2, 3, 4, 255U), nullptr);
list.insertFirst(chunk2);
list.insertFirst(chunk1);
@@ -163,11 +163,11 @@ TEST_CASE("TextChunkList addRemoveBack 4", "TextChunkList")
TextChunkList list;
TextChunk *const chunk1 = new TextChunk("test",
- Color(1, 2, 3), Color(1, 2, 3), nullptr);
+ Color(1, 2, 3, 255U), Color(1, 2, 3, 255U), nullptr);
TextChunk *const chunk2 = new TextChunk("test2",
- Color(2, 3, 4), Color(2, 3, 4), nullptr);
+ Color(2, 3, 4, 255U), Color(2, 3, 4, 255U), nullptr);
TextChunk *const chunk3 = new TextChunk("test",
- Color(3, 4, 5), Color(3, 4, 5), nullptr);
+ Color(3, 4, 5, 255U), Color(3, 4, 5, 255U), nullptr);
list.insertFirst(chunk3);
list.insertFirst(chunk2);
@@ -194,7 +194,7 @@ TEST_CASE("TextChunkList moveToFirst 1", "TextChunkList")
TextChunkList list;
TextChunk *const chunk = new TextChunk("test",
- Color(1, 2, 3), Color(2, 3, 4), nullptr);
+ Color(1, 2, 3, 255U), Color(2, 3, 4, 255U), nullptr);
list.insertFirst(chunk);
list.moveToFirst(chunk);
@@ -212,9 +212,9 @@ TEST_CASE("TextChunkList moveToFirst 2", "TextChunkList")
TextChunkList list;
TextChunk *const chunk1 = new TextChunk("test",
- Color(1, 2, 3), Color(1, 2, 3), nullptr);
+ Color(1, 2, 3, 255U), Color(1, 2, 3, 255U), nullptr);
TextChunk *const chunk2 = new TextChunk("test",
- Color(2, 3, 4), Color(1, 2, 3), nullptr);
+ Color(2, 3, 4, 255U), Color(1, 2, 3, 255U), nullptr);
list.insertFirst(chunk1);
list.insertFirst(chunk2);
@@ -236,11 +236,11 @@ TEST_CASE("TextChunkList moveToFirst 3", "TextChunkList")
TextChunkList list;
TextChunk *const chunk1 = new TextChunk("test",
- Color(1, 2, 3), Color(1, 2, 3), nullptr);
+ Color(1, 2, 3, 255U), Color(1, 2, 3, 255U), nullptr);
TextChunk *const chunk2 = new TextChunk("test",
- Color(1, 2, 4), Color(1, 2, 3), nullptr);
+ Color(1, 2, 4, 255U), Color(1, 2, 3, 255U), nullptr);
TextChunk *const chunk3 = new TextChunk("test",
- Color(1, 2, 5), Color(1, 2, 3), nullptr);
+ Color(1, 2, 5, 255U), Color(1, 2, 3, 255U), nullptr);
list.insertFirst(chunk3);
list.insertFirst(chunk1);
@@ -316,11 +316,11 @@ TEST_CASE("TextChunkList clear 2", "TextChunkList")
const int chunksLeft = textChunkCnt;
TextChunk *const chunk1 = new TextChunk("test",
- Color(1, 2, 3), Color(2, 0, 0), nullptr);
+ Color(1, 2, 3, 255U), Color(2, 0, 0, 255U), nullptr);
TextChunk *const chunk2 = new TextChunk("test",
- Color(1, 2, 3), Color(2, 0, 1), nullptr);
+ Color(1, 2, 3, 255U), Color(2, 0, 1, 255U), nullptr);
TextChunk *const chunk3 = new TextChunk("test",
- Color(1, 2, 3), Color(2, 0, 2), nullptr);
+ Color(1, 2, 3, 255U), Color(2, 0, 2, 255U), nullptr);
list.insertFirst(chunk1);
list.insertFirst(chunk2);
@@ -341,11 +341,11 @@ TEST_CASE("TextChunkList clear 3", "TextChunkList")
const int chunksLeft = textChunkCnt;
TextChunk *const chunk1 = new TextChunk("test",
- Color(1, 2, 3), Color(2, 0, 0), nullptr);
+ Color(1, 2, 3, 255U), Color(2, 0, 0, 255U), nullptr);
TextChunk *const chunk2 = new TextChunk("test",
- Color(1, 2, 3), Color(2, 0, 1), nullptr);
+ Color(1, 2, 3, 255U), Color(2, 0, 1, 255U), nullptr);
TextChunk *const chunk3 = new TextChunk("test",
- Color(1, 2, 3), Color(2, 0, 2), nullptr);
+ Color(1, 2, 3, 255U), Color(2, 0, 2, 255U), nullptr);
list.insertFirst(chunk1);
list.insertFirst(chunk2);
@@ -372,11 +372,11 @@ TEST_CASE("TextChunkList clear 4", "TextChunkList")
const int chunksLeft = textChunkCnt;
TextChunk *const chunk1 = new TextChunk("test",
- Color(1, 2, 3), Color(2, 0, 0), nullptr);
+ Color(1, 2, 3, 255U), Color(2, 0, 0, 255U), nullptr);
TextChunk *const chunk2 = new TextChunk("test",
- Color(1, 2, 3), Color(2, 0, 1), nullptr);
+ Color(1, 2, 3, 255U), Color(2, 0, 1, 255U), nullptr);
TextChunk *const chunk3 = new TextChunk("test3",
- Color(1, 2, 3), Color(2, 0, 2), nullptr);
+ Color(1, 2, 3, 255U), Color(2, 0, 2, 255U), nullptr);
list.insertFirst(chunk1);
list.insertFirst(chunk2);
@@ -423,11 +423,11 @@ TEST_CASE("TextChunkList remove 2", "TextChunkList")
const int chunksLeft = textChunkCnt;
TextChunk *const chunk1 = new TextChunk("test1",
- Color(1, 2, 3), Color(2, 0, 0), nullptr);
+ Color(1, 2, 3, 255U), Color(2, 0, 0, 255U), nullptr);
TextChunk *const chunk2 = new TextChunk("test2",
- Color(1, 2, 3), Color(2, 0, 1), nullptr);
+ Color(1, 2, 3, 255U), Color(2, 0, 1, 255U), nullptr);
TextChunk *const chunk3 = new TextChunk("test3",
- Color(1, 2, 3), Color(2, 0, 2), nullptr);
+ Color(1, 2, 3, 255U), Color(2, 0, 2, 255U), nullptr);
list.insertFirst(chunk1);
list.insertFirst(chunk2);
@@ -451,11 +451,11 @@ TEST_CASE("TextChunkList remove 3", "TextChunkList")
const int chunksLeft = textChunkCnt;
TextChunk *const chunk1 = new TextChunk("test1",
- Color(1, 2, 3), Color(2, 0, 0), nullptr);
+ Color(1, 2, 3, 255U), Color(2, 0, 0, 255U), nullptr);
TextChunk *const chunk2 = new TextChunk("test2",
- Color(1, 2, 3), Color(2, 0, 1), nullptr);
+ Color(1, 2, 3, 255U), Color(2, 0, 1, 255U), nullptr);
TextChunk *const chunk3 = new TextChunk("test3",
- Color(1, 2, 3), Color(2, 0, 2), nullptr);
+ Color(1, 2, 3, 255U), Color(2, 0, 2, 255U), nullptr);
list.insertFirst(chunk1);
list.insertFirst(chunk2);
@@ -476,11 +476,11 @@ TEST_CASE("TextChunkList remove 3", "TextChunkList")
TEST_CASE("TextChunkList sort 1", "TextChunkList")
{
TextChunkSmall item1("test line1",
- Color(1, 2, 3), Color(1, 2, 3));
+ Color(1, 2, 3, 255U), Color(1, 2, 3, 255U));
TextChunkSmall item2("test line1",
- Color(1, 2, 3), Color(1, 2, 3));
+ Color(1, 2, 3, 255U), Color(1, 2, 3, 255U));
TextChunkSmall item3("test line2",
- Color(1, 2, 3), Color(1, 2, 3));
+ Color(1, 2, 3, 255U), Color(1, 2, 3, 255U));
REQUIRE(false == (item1 < item2));
REQUIRE(false == (item2 < item1));
REQUIRE(item1 < item3);
@@ -490,9 +490,9 @@ TEST_CASE("TextChunkList sort 1", "TextChunkList")
TEST_CASE("TextChunkList sort 2", "TextChunkList")
{
TextChunkSmall item1("test line1",
- Color(1, 2, 3), Color(1, 2, 3));
+ Color(1, 2, 3, 255U), Color(1, 2, 3, 255U));
TextChunkSmall item2("test line1",
- Color(2, 3, 4), Color(1, 2, 3));
+ Color(2, 3, 4, 255U), Color(1, 2, 3, 255U));
REQUIRE(item1 < item2);
REQUIRE(false == (item2 < item1));
}
@@ -500,9 +500,9 @@ TEST_CASE("TextChunkList sort 2", "TextChunkList")
TEST_CASE("TextChunkList sort 3", "TextChunkList")
{
TextChunkSmall item1("test line1",
- Color(1, 2, 3), Color(1, 2, 3));
+ Color(1, 2, 3, 255U), Color(1, 2, 3, 255U));
TextChunkSmall item2("test line1",
- Color(1, 3, 4), Color(1, 2, 3));
+ Color(1, 3, 4, 255U), Color(1, 2, 3, 255U));
REQUIRE(item1 < item2);
REQUIRE(false == (item2 < item1));
}
@@ -510,9 +510,9 @@ TEST_CASE("TextChunkList sort 3", "TextChunkList")
TEST_CASE("TextChunkList sort 4", "TextChunkList")
{
TextChunkSmall item1("test line1",
- Color(1, 2, 3), Color(1, 2, 3));
+ Color(1, 2, 3, 255U), Color(1, 2, 3, 255U));
TextChunkSmall item2("test line1",
- Color(1, 2, 4), Color(1, 2, 3));
+ Color(1, 2, 4, 255U), Color(1, 2, 3, 255U));
REQUIRE(item1 < item2);
REQUIRE(false == (item2 < item1));
}
@@ -520,9 +520,9 @@ TEST_CASE("TextChunkList sort 4", "TextChunkList")
TEST_CASE("TextChunkList sort 5", "TextChunkList")
{
TextChunkSmall item1("test line1",
- Color(1, 2, 3), Color(1, 2, 3));
+ Color(1, 2, 3, 255U), Color(1, 2, 3, 255U));
TextChunkSmall item2("test line1",
- Color(1, 2, 3), Color(2, 2, 3));
+ Color(1, 2, 3, 255U), Color(2, 2, 3, 255U));
REQUIRE(item1 < item2);
REQUIRE(false == (item2 < item1));
}
@@ -530,9 +530,9 @@ TEST_CASE("TextChunkList sort 5", "TextChunkList")
TEST_CASE("TextChunkList sort 6", "TextChunkList")
{
TextChunkSmall item1("test line1",
- Color(1, 2, 3), Color(1, 2, 3));
+ Color(1, 2, 3, 255U), Color(1, 2, 3, 255U));
TextChunkSmall item2("test line1",
- Color(1, 2, 3), Color(1, 3, 3));
+ Color(1, 2, 3, 255U), Color(1, 3, 3, 255U));
REQUIRE(item1 < item2);
REQUIRE(false == (item2 < item1));
}
@@ -540,9 +540,9 @@ TEST_CASE("TextChunkList sort 6", "TextChunkList")
TEST_CASE("TextChunkList sort 7", "TextChunkList")
{
TextChunkSmall item1("test line1",
- Color(1, 2, 3), Color(1, 2, 3));
+ Color(1, 2, 3, 255U), Color(1, 2, 3, 255U));
TextChunkSmall item2("test line1",
- Color(1, 2, 3), Color(1, 2, 4));
+ Color(1, 2, 3, 255U), Color(1, 2, 4, 255U));
REQUIRE(item1 < item2);
REQUIRE(false == (item2 < item1));
}
diff --git a/src/unittests/gui/widgets/browserbox.cc b/src/unittests/gui/widgets/browserbox.cc
index 46a5f3b23..712b76260 100644
--- a/src/unittests/gui/widgets/browserbox.cc
+++ b/src/unittests/gui/widgets/browserbox.cc
@@ -88,99 +88,99 @@ TEST_CASE("BrowserBox tests", "browserbox")
"");
box->setWidth(100);
std::string row = "test";
- box->addRow(row);
+ box->addRow(row, false);
REQUIRE(box->hasRows() == true);
box->clearRows();
row = "@@";
- box->addRow(row);
+ box->addRow(row, false);
row = "@@|";
- box->addRow(row);
+ box->addRow(row, false);
row = "|@@";
- box->addRow(row);
+ box->addRow(row, false);
row = "@@|@@";
- box->addRow(row);
+ box->addRow(row, false);
row = "|@@@@";
- box->addRow(row);
+ box->addRow(row, false);
row = "@@11|22@@";
- box->addRow(row);
+ box->addRow(row, false);
row = "##@@11|22@@";
- box->addRow(row);
+ box->addRow(row, false);
row = "@@##|22@@";
- box->addRow(row);
+ box->addRow(row, false);
row = "@@11|##22@@";
- box->addRow(row);
+ box->addRow(row, false);
row = "@@11|22##@@";
- box->addRow(row);
+ box->addRow(row, false);
row = "@@11|22@@##";
- box->addRow(row);
+ box->addRow(row, false);
row = "<##@@11|22@@";
- box->addRow(row);
+ box->addRow(row, false);
row = "@@<##|22@@";
- box->addRow(row);
+ box->addRow(row, false);
row = "@@11|<##22@@";
- box->addRow(row);
+ box->addRow(row, false);
row = "@@11|22<##@@";
- box->addRow(row);
+ box->addRow(row, false);
row = "@@11|22@@<##";
- box->addRow(row);
+ box->addRow(row, false);
row = "<##11|22@@";
- box->addRow(row);
+ box->addRow(row, false);
row = "<##|22@@";
- box->addRow(row);
+ box->addRow(row, false);
row = "11|<##22@@";
- box->addRow(row);
+ box->addRow(row, false);
row = "11|22<##@@";
- box->addRow(row);
+ box->addRow(row, false);
row = "11|22@@<##";
- box->addRow(row);
+ box->addRow(row, false);
row = "##>@@11|22@@";
- box->addRow(row);
+ box->addRow(row, false);
row = "@@##>|22@@";
- box->addRow(row);
+ box->addRow(row, false);
row = "@@11|##>22@@";
- box->addRow(row);
+ box->addRow(row, false);
row = "@@11|22##>@@";
- box->addRow(row);
+ box->addRow(row, false);
row = "@@11|22@@##>";
- box->addRow(row);
+ box->addRow(row, false);
row = "<##11|22##>";
- box->addRow(row);
+ box->addRow(row, false);
row = "<##|22##>";
- box->addRow(row);
+ box->addRow(row, false);
row = "11|<##22##>";
- box->addRow(row);
+ box->addRow(row, false);
row = "11|22<####>";
- box->addRow(row);
+ box->addRow(row, false);
row = "11|22##><##";
- box->addRow(row);
+ box->addRow(row, false);
row = "%%@@11|22@@";
- box->addRow(row);
+ box->addRow(row, false);
row = "%%2@@11|22@@";
- box->addRow(row);
+ box->addRow(row, false);
row = "<%%11|22@@";
- box->addRow(row);
+ box->addRow(row, false);
row = "@@%%>|22@@";
- box->addRow(row);
+ box->addRow(row, false);
row = "<%%|22%%>";
- box->addRow(row);
+ box->addRow(row, false);
row = "11|22<%%%%>";
- box->addRow(row);
+ box->addRow(row, false);
row = "%%";
- box->addRow(row);
+ box->addRow(row, false);
row = "%%1";
- box->addRow(row);
+ box->addRow(row, false);
row = "%%##";
- box->addRow(row);
+ box->addRow(row, false);
row = "%%###";
- box->addRow(row);
+ box->addRow(row, false);
row = "##%%";
- box->addRow(row);
+ box->addRow(row, false);
row = "##1%%";
- box->addRow(row);
+ box->addRow(row, false);
row = "##%%2";
- box->addRow(row);
+ box->addRow(row, false);
row = "##1%%2";
- box->addRow(row);
+ box->addRow(row, false);
delete Widget::getGloablFont();
Widget::setGlobalFont(nullptr);
diff --git a/src/unittests/gui/windowmanager.cc b/src/unittests/gui/windowmanager.cc
index 92ea50920..fac9bc212 100644
--- a/src/unittests/gui/windowmanager.cc
+++ b/src/unittests/gui/windowmanager.cc
@@ -473,7 +473,10 @@ TEST_CASE("Windows tests", "windowmanager")
Equipm_true,
Equipped_false);
ItemAmountWindow *dialog = CREATEWIDGETR(ItemAmountWindow,
- ItemAmountWindowUsage::ItemDrop, nullptr, item);
+ ItemAmountWindowUsage::ItemDrop,
+ nullptr,
+ item,
+ 0);
gui->draw();
mainGraphics->updateScreen();
delete2(dialog);
@@ -633,14 +636,21 @@ TEST_CASE("Windows tests", "windowmanager")
new EmoteShortcutContainer(nullptr);
CREATEWIDGETV(itemShortcutWindow, ShortcutWindow,
"name",
- container);
+ container,
+ std::string(),
+ 0,
+ 0);
gui->draw();
mainGraphics->updateScreen();
delete2(itemShortcutWindow);
}
SECTION("ShortcutWindow2")
{
- CREATEWIDGETV(itemShortcutWindow, ShortcutWindow, "");
+ CREATEWIDGETV(itemShortcutWindow, ShortcutWindow,
+ std::string(),
+ std::string(),
+ 0,
+ 0);
gui->draw();
mainGraphics->updateScreen();
delete2(itemShortcutWindow);
diff --git a/src/unittests/resources/map/speciallayer.cc b/src/unittests/resources/map/speciallayer.cc
index 2e72d6e19..ce8714458 100644
--- a/src/unittests/resources/map/speciallayer.cc
+++ b/src/unittests/resources/map/speciallayer.cc
@@ -279,7 +279,7 @@ TEST_CASE("SpecialLayer updateCache", "")
}
delete layer;
- ResourceManager::cleanOrphans();
+ ResourceManager::cleanOrphans(false);
delete2(userPalette);
delete2(theme);
delete2(client);
diff --git a/src/unittests/resources/resourcemanager/resourcemanager.cc b/src/unittests/resources/resourcemanager/resourcemanager.cc
index 4b67af82e..5e240e65d 100644
--- a/src/unittests/resources/resourcemanager/resourcemanager.cc
+++ b/src/unittests/resources/resourcemanager/resourcemanager.cc
@@ -265,7 +265,7 @@ TEST_CASE("resourcemanager", "resourcemanager")
REQUIRE(ResourceManager::getDeletedResources().empty() == true);
sleep(33);
- ResourceManager::cleanOrphans();
+ ResourceManager::cleanOrphans(false);
REQUIRE(ResourceManager::isInCache("test1") == false);
REQUIRE(testResouceCounter == 0);
REQUIRE(ResourceManager::getResources().size() == 0 + resSize);
@@ -647,7 +647,7 @@ TEST_CASE("resourcemanager", "resourcemanager")
REQUIRE(ResourceManager::getOrphanedResources().empty() == true);
REQUIRE(ResourceManager::getDeletedResources().size() == 1);
- ResourceManager::clearDeleted();
+ ResourceManager::clearDeleted(true);
REQUIRE(testResouceCounter == 1);
REQUIRE(res->mRefCount == 1);
REQUIRE(ResourceManager::getResources().size() == 0 + resSize);
@@ -678,7 +678,7 @@ TEST_CASE("resourcemanager", "resourcemanager")
REQUIRE(ResourceManager::getDeletedResources().size() == 1);
res->decRef();
- ResourceManager::clearDeleted();
+ ResourceManager::clearDeleted(true);
REQUIRE(testResouceCounter == 0);
REQUIRE(ResourceManager::getResources().size() == 0 + resSize);
REQUIRE(ResourceManager::getOrphanedResources().empty() == true);