aboutsummaryrefslogtreecommitdiff
path: root/src/unittest
diff options
context:
space:
mode:
authorLars Müller <34514239+appgurueu@users.noreply.github.com>2022-07-29 10:19:36 +0200
committerGitHub <noreply@github.com>2022-07-29 10:19:36 +0200
commit99c8295e71eb86333ae21b1083b6f55fb9479565 (patch)
treeaec177f62fac0b3efe0c6e745e2bb31219b20d95 /src/unittest
parent6611d7e1ee3b078b5c3414bf57833755d8b43620 (diff)
downloadminetest-99c8295e71eb86333ae21b1083b6f55fb9479565.tar.gz
minetest-99c8295e71eb86333ae21b1083b6f55fb9479565.tar.bz2
minetest-99c8295e71eb86333ae21b1083b6f55fb9479565.zip
Fix media overriding regression (#12602)
Diffstat (limited to 'src/unittest')
-rw-r--r--src/unittest/test_servermodmanager.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/unittest/test_servermodmanager.cpp b/src/unittest/test_servermodmanager.cpp
index 4c473d8b5..91bf5d3a4 100644
--- a/src/unittest/test_servermodmanager.cpp
+++ b/src/unittest/test_servermodmanager.cpp
@@ -22,6 +22,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "server/mods.h"
#include "settings.h"
#include "test_config.h"
+#include "util/string.h"
class TestServerModManager : public TestBase
{
@@ -190,4 +191,11 @@ void TestServerModManager::testGetModMediaPaths()
std::vector<std::string> result;
sm.getModsMediaPaths(result);
UASSERTEQ(bool, result.empty(), false);
+
+ // Test media overriding:
+ // unittests depends on basenodes to override default_dirt.png,
+ // thus the unittests texture path must come first in the returned media paths to take priority
+ auto it = std::find(result.begin(), result.end(), sm.getModSpec("unittests")->path + DIR_DELIM + "textures");
+ UASSERT(it != result.end());
+ UASSERT(std::find(++it, result.end(), sm.getModSpec("basenodes")->path + DIR_DELIM + "textures") != result.end());
}