diff options
Diffstat (limited to 'src/utils')
-rw-r--r-- | src/utils/xmlutils_unittest.cc | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/utils/xmlutils_unittest.cc b/src/utils/xmlutils_unittest.cc index 0143c16f3..9ea9921aa 100644 --- a/src/utils/xmlutils_unittest.cc +++ b/src/utils/xmlutils_unittest.cc @@ -58,3 +58,30 @@ TEST_CASE("xmlutils readXmlIntVector 1") REQUIRE(1 == arr[3]); REQUIRE(1 == arr[4]); } + +TEST_CASE("xmlutils readXmlStringMap 1") +{ + client = new Client; + PHYSFS_init("manaplus"); + dirSeparator = "/"; + XML::initXML(); + logger = new Logger(); + ResourceManager::init(); + resourceManager->addToSearchPath("data", Append_false); + resourceManager->addToSearchPath("../data", Append_false); + + std::map<std::string, std::string> arr; + + readXmlStringMap("graphics/sprites/manaplus_emotes.xml", + "emotes", + "emote", + "sprite", + "name", + "variant", + arr); + + REQUIRE(arr.size() == 27); + REQUIRE(arr["Kitty"] == "0"); + REQUIRE(arr["xD"] == "1"); + REQUIRE(arr["Metal"] == "26"); +} |