summaryrefslogtreecommitdiff
path: root/src/resources
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-06-08 01:22:43 +0300
committerAndrei Karas <akaras@inbox.ru>2017-06-08 01:22:43 +0300
commit34a83475636164cf43551d9ec83ec30da5a7e7f2 (patch)
treec6b3e22f789422e06a96c2ca87dd94fc61eb1dd1 /src/resources
parentaf4fcff19a986990d58c50c62bc498690c8293b8 (diff)
downloadmanaverse-34a83475636164cf43551d9ec83ec30da5a7e7f2.tar.gz
manaverse-34a83475636164cf43551d9ec83ec30da5a7e7f2.tar.bz2
manaverse-34a83475636164cf43551d9ec83ec30da5a7e7f2.tar.xz
manaverse-34a83475636164cf43551d9ec83ec30da5a7e7f2.zip
Replace size() to empty() where is possible
Diffstat (limited to 'src/resources')
-rw-r--r--src/resources/map/maplayer_unittest.cc12
-rw-r--r--src/resources/resourcemanager/resourcemanager_unittest.cc12
2 files changed, 12 insertions, 12 deletions
diff --git a/src/resources/map/maplayer_unittest.cc b/src/resources/map/maplayer_unittest.cc
index 5c001f543..194128815 100644
--- a/src/resources/map/maplayer_unittest.cc
+++ b/src/resources/map/maplayer_unittest.cc
@@ -1682,7 +1682,7 @@ TEST_CASE("MapLayer drawSpecialLayer (specialLayer)", "")
0,
0, 1,
0, 0);
- REQUIRE(mock->mDraws.size() == 0);
+ REQUIRE(mock->mDraws.empty());
specialLayer->setTile(0, 0, MapItemType::ARROW_UP);
layer->drawSpecialLayer(mock,
@@ -1957,13 +1957,13 @@ TEST_CASE("MapLayer drawSpecialLayer (specialLayer)", "")
4,
0, maxX,
0, 0);
- REQUIRE(mock->mDraws.size() == 0);
+ REQUIRE(mock->mDraws.empty());
layer->drawSpecialLayer(mock,
6,
0, maxX,
0, 0);
- REQUIRE(mock->mDraws.size() == 0);
+ REQUIRE(mock->mDraws.empty());
layer->drawSpecialLayer(mock,
20,
@@ -2027,7 +2027,7 @@ TEST_CASE("MapLayer drawSpecialLayer (tempLayer)", "")
0,
0, 1,
0, 0);
- REQUIRE(mock->mDraws.size() == 0);
+ REQUIRE(mock->mDraws.empty());
specialLayer->setTile(0, 0, MapItemType::ARROW_UP);
layer->drawSpecialLayer(mock,
@@ -2308,13 +2308,13 @@ TEST_CASE("MapLayer drawSpecialLayer (tempLayer)", "")
4,
0, maxX,
0, 0);
- REQUIRE(mock->mDraws.size() == 0);
+ REQUIRE(mock->mDraws.empty());
layer->drawSpecialLayer(mock,
6,
0, maxX,
0, 0);
- REQUIRE(mock->mDraws.size() == 0);
+ REQUIRE(mock->mDraws.empty());
layer->drawSpecialLayer(mock,
20,
diff --git a/src/resources/resourcemanager/resourcemanager_unittest.cc b/src/resources/resourcemanager/resourcemanager_unittest.cc
index 231d5cfc0..fe3e2e995 100644
--- a/src/resources/resourcemanager/resourcemanager_unittest.cc
+++ b/src/resources/resourcemanager/resourcemanager_unittest.cc
@@ -274,7 +274,7 @@ TEST_CASE("resourcemanager", "resourcemanager")
REQUIRE(res2 != nullptr);
REQUIRE(testResouceCounter == 1);
REQUIRE(res2->mRefCount == 1);
- REQUIRE(res2->mSource == "");
+ REQUIRE(res2->mSource.empty());
REQUIRE(ResourceManager::getResources().size() == 1 + resSize);
REQUIRE(ResourceManager::getResources()["test1"] == res2);
REQUIRE(ResourceManager::getOrphanedResources().empty() == true);
@@ -302,7 +302,7 @@ TEST_CASE("resourcemanager", "resourcemanager")
REQUIRE(res2 != nullptr);
REQUIRE(testResouceCounter == 2);
REQUIRE(res2->mRefCount == 1);
- REQUIRE(res2->mSource == "");
+ REQUIRE(res2->mSource.empty());
REQUIRE(ResourceManager::getResources().size() == 2 + resSize);
REQUIRE(ResourceManager::getResources()["test1"] == res);
REQUIRE(ResourceManager::getResources()["test2"] == res2);
@@ -331,7 +331,7 @@ TEST_CASE("resourcemanager", "resourcemanager")
REQUIRE(testResouceCounter == 1);
REQUIRE(res2->mRefCount == 2);
REQUIRE(res == res2);
- REQUIRE(res2->mSource == "");
+ REQUIRE(res2->mSource.empty());
REQUIRE(ResourceManager::getResources().size() == 1 + resSize);
REQUIRE(ResourceManager::getResources()["test1"] == res2);
REQUIRE(ResourceManager::getOrphanedResources().empty() == true);
@@ -360,7 +360,7 @@ TEST_CASE("resourcemanager", "resourcemanager")
REQUIRE(testResouceCounter == 1);
REQUIRE(res2->mRefCount == 1);
REQUIRE(res == res2);
- REQUIRE(res2->mSource == "");
+ REQUIRE(res2->mSource.empty());
REQUIRE(ResourceManager::getResources().size() == 1 + resSize);
REQUIRE(ResourceManager::getResources()["test1"] == res2);
REQUIRE(ResourceManager::getOrphanedResources().empty() == true);
@@ -388,7 +388,7 @@ TEST_CASE("resourcemanager", "resourcemanager")
REQUIRE(res2 != nullptr);
REQUIRE(testResouceCounter == 2);
REQUIRE(res2->mRefCount == 1);
- REQUIRE(res2->mSource == "");
+ REQUIRE(res2->mSource.empty());
REQUIRE(ResourceManager::getResources().size() == 2 + resSize);
REQUIRE(ResourceManager::getResources()["test1"] == res);
REQUIRE(ResourceManager::getResources()["test2"] == res2);
@@ -473,7 +473,7 @@ TEST_CASE("resourcemanager", "resourcemanager")
REQUIRE(testResouceCounter == 1);
REQUIRE(res2->mRefCount == 1);
REQUIRE(res == res2);
- REQUIRE(res2->mSource == "");
+ REQUIRE(res2->mSource.empty());
REQUIRE(ResourceManager::getResources().size() == 1 + resSize);
REQUIRE(ResourceManager::getResources()["test1"] == res2);
REQUIRE(ResourceManager::getOrphanedResources().empty() == true);