diff options
Diffstat (limited to 'src/unittests/utils')
-rw-r--r-- | src/unittests/utils/itemxmlutils.cc | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/src/unittests/utils/itemxmlutils.cc b/src/unittests/utils/itemxmlutils.cc index 44eba8e61..825bc2f97 100644 --- a/src/unittests/utils/itemxmlutils.cc +++ b/src/unittests/utils/itemxmlutils.cc @@ -171,6 +171,41 @@ TEST_CASE("itemxmlutils readItemStatsString 1", "") } } + SECTION("test4") + { + XmlNodePtr node = XML::findFirstChildByName(root, "test4"); + readItemStatsString(effect, node, fields); + REQUIRE(effect == "HP +10 - +15"); + } + + SECTION("test5") + { + XmlNodePtr node = XML::findFirstChildByName(root, "test5"); + readItemStatsString(effect, node, fields); + REQUIRE(effect == "Weight 2"); + } + + SECTION("test6") + { + XmlNodePtr node = XML::findFirstChildByName(root, "test6"); + readItemStatsString(effect, node, fields); + REQUIRE(effect == "Weight 2 - 3"); + } + + SECTION("test7") + { + XmlNodePtr node = XML::findFirstChildByName(root, "test7"); + readItemStatsString(effect, node, fields); + REQUIRE(effect == "Weight 2-"); + } + + SECTION("test8") + { + XmlNodePtr node = XML::findFirstChildByName(root, "test8"); + readItemStatsString(effect, node, fields); + REQUIRE(effect == "Weight -2"); + } + delete2(userPalette); delete2(theme); delete2(client); @@ -329,6 +364,46 @@ TEST_CASE("itemxmlutils readItemStatsVector 1", "") } } + SECTION("test4") + { + XmlNodePtr node = XML::findFirstChildByName(root, "test4"); + readItemStatsVector(effect, node, fields); + REQUIRE(effect.size() == 1); + REQUIRE(effect[0] == "HP +10 - +15"); + } + + SECTION("test5") + { + XmlNodePtr node = XML::findFirstChildByName(root, "test5"); + readItemStatsVector(effect, node, fields); + REQUIRE(effect.size() == 1); + REQUIRE(effect[0] == "Weight 2"); + } + + SECTION("test6") + { + XmlNodePtr node = XML::findFirstChildByName(root, "test6"); + readItemStatsVector(effect, node, fields); + REQUIRE(effect.size() == 1); + REQUIRE(effect[0] == "Weight 2 - 3"); + } + + SECTION("test7") + { + XmlNodePtr node = XML::findFirstChildByName(root, "test7"); + readItemStatsVector(effect, node, fields); + REQUIRE(effect.size() == 1); + REQUIRE(effect[0] == "Weight 2-"); + } + + SECTION("test8") + { + XmlNodePtr node = XML::findFirstChildByName(root, "test8"); + readItemStatsVector(effect, node, fields); + REQUIRE(effect.size() == 1); + REQUIRE(effect[0] == "Weight -2"); + } + delete2(userPalette); delete2(theme); delete2(client); |