From c963418a6a073f4d69a818f5f763133b0c4d44d5 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 29 Mar 2016 01:01:26 +0300 Subject: Add test for function readXmlStringMap. --- src/utils/xmlutils_unittest.cc | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'src/utils') 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 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"); +} -- cgit v1.2.3-70-g09d2