From 9fefb2942865846ccb7dbdac4ebd4515b8c851a2 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 4 Jan 2017 18:25:48 +0300 Subject: Add physfs deinit function for unit tests. But not using it for now. --- src/utils/stringutils_unittest.cc | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/utils/stringutils_unittest.cc') diff --git a/src/utils/stringutils_unittest.cc b/src/utils/stringutils_unittest.cc index a8347cdd5..481289087 100644 --- a/src/utils/stringutils_unittest.cc +++ b/src/utils/stringutils_unittest.cc @@ -19,13 +19,17 @@ */ #include "catch.hpp" +#include "logger.h" +#include "utils/physfstools.h" #include "utils/stringutils.h" #include "resources/iteminfo.h" #include "resources/db/itemdb.h" +#include "resources/resourcemanager/resourcemanager.h" + #include "debug.h" TEST_CASE("stringuntils trim 1") @@ -619,6 +623,13 @@ TEST_CASE("stringuntils escapeString") TEST_CASE("stringuntils replaceItemLinks") { + PHYSFS_init("manaplus"); + dirSeparator = "/"; + logger = new Logger(); + ResourceManager::init(); + resourceManager->addToSearchPath("data", Append_false); + resourceManager->addToSearchPath("../data", Append_false); + ItemDB::NamedItemInfos &namedInfos = ItemDB::getNamedItemInfosTest(); ItemDB::ItemInfos &infos = ItemDB::getItemInfosTest(); ItemInfo *info = new ItemInfo; @@ -833,4 +844,6 @@ TEST_CASE("stringuntils replaceItemLinks") replaceItemLinks(str); REQUIRE(str == "[[test name 1 ,test name2[] test name 1]"); } + ResourceManager::deleteInstance(); +// PhysFs::deinit(); } -- cgit v1.2.3-70-g09d2