From 030eda2c4d6cad6d44c35499bcfc43ba89c88bb9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 15 Apr 2024 11:43:56 +0200 Subject: Adding upstream version 4:24.2.2. Signed-off-by: Daniel Baumann --- test/source/xmltesttools.cxx | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'test/source/xmltesttools.cxx') diff --git a/test/source/xmltesttools.cxx b/test/source/xmltesttools.cxx index eff0247c85..143819cc6c 100644 --- a/test/source/xmltesttools.cxx +++ b/test/source/xmltesttools.cxx @@ -292,6 +292,19 @@ int XmlTestTools::getXPathPosition(const xmlDocUniquePtr& pXmlDoc, const OString return nRet; } +void XmlTestTools::assertXPathNodeName(const xmlDocUniquePtr& pXmlDoc, const OString& rXPath, + const OString& rExpectedName) +{ + xmlXPathObjectPtr pXmlObj = getXPathNode(pXmlDoc, rXPath); + xmlNodeSetPtr pXmlNodes = pXmlObj->nodesetval; + CPPUNIT_ASSERT_EQUAL_MESSAGE(OString(OString::Concat("In <") + pXmlDoc->name + ">, XPath '" + rXPath + "' number of nodes is incorrect").getStr(), + 1, + xmlXPathNodeSetGetLength(pXmlNodes)); + xmlNodePtr pXmlNode = pXmlNodes->nodeTab[0]; + CPPUNIT_ASSERT_EQUAL_MESSAGE(OString(OString::Concat("In XPath '" + rXPath + "' name of node is incorrect")).getStr(), + rExpectedName, oconvert(pXmlNode->name)); +} + void XmlTestTools::registerODFNamespaces(xmlXPathContextPtr& pXmlXpathCtx) { xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("manifest"), -- cgit v1.2.3