diff options
-rw-r--r-- | src/unittests/utils/xml.cc | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/unittests/utils/xml.cc b/src/unittests/utils/xml.cc index 76ddadcb9..4711873ce 100644 --- a/src/unittests/utils/xml.cc +++ b/src/unittests/utils/xml.cc @@ -155,6 +155,23 @@ TEST_CASE("xml doc", "") REQUIRE(!strcmp(XmlChildContent(doc.rootNode()), "this is test")); } + SECTION("load5") + { + XML::Document doc(pathJoin(VirtFs::getRealDir( + "test/serverlistplus.xml"), "test/serverlistplus.xml"), + UseVirtFs_false, + SkipError_false); + REQUIRE(doc.isLoaded() == true); + REQUIRE(doc.isValid() == true); + REQUIRE(doc.rootNode() != nullptr); + REQUIRE(xmlNameEqual(doc.rootNode(), "serverlist") == true); + REQUIRE(xmlNameEqual(doc.rootNode(), "serverlist123") == false); + REQUIRE(xmlTypeEqual(doc.rootNode(), XML_ELEMENT_NODE) == true); + REQUIRE(XmlHasProp(doc.rootNode(), "option1") == false); + REQUIRE(XmlHasProp(doc.rootNode(), "option123") == false); + REQUIRE(XmlHasProp(doc.rootNode(), "version") == true); + } + SECTION("properties") { XML::Document doc("graphics/gui/browserbox.xml", |