diff --git a/include/test/xmltesttools.hxx b/include/test/xmltesttools.hxx index a9f30f7d227d..09f06af5eb0d 100644 --- a/include/test/xmltesttools.hxx +++ b/include/test/xmltesttools.hxx @@ -65,10 +65,6 @@ protected: * Get the number of the nodes returned by the rXPath. */ int countXPathNodes(const xmlDocUniquePtr& pXmlDoc, const OString& rXPath); - /** - * Assert that rXPath exists, and returns exactly one node. - */ - void assertXPath(const xmlDocUniquePtr& pXmlDoc, const OString& rXPath); /** * Assert that rXPath exists, returns exactly one node, and the rXPath's attribute's value * equals to the rExpected value. @@ -78,10 +74,10 @@ protected: void assertXPathAttrs(const xmlDocUniquePtr& pXmlDoc, const OString& rXPath, const std::vector>& aPairVector); /** - * Assert that rXPath exists, and returns exactly nNumberOfNodes nodes. - * Useful for checking that we do _not_ export some node (nNumberOfNodes == 0). + * Assert that rXPath exists, and returns exactly nNumberOfNodes nodes (1 by default). + * Also useful for checking that we do _not_ export some node (nNumberOfNodes == 0). */ - void assertXPath(const xmlDocUniquePtr& pXmlDoc, const OString& rXPath, int nNumberOfNodes); + void assertXPath(const xmlDocUniquePtr& pXmlDoc, const OString& rXPath, int nNumberOfNodes = 1); /** * Assert that rXPath exists, and its content equals rContent. */ diff --git a/test/source/xmltesttools.cxx b/test/source/xmltesttools.cxx index 26973b440c61..e329bc968760 100644 --- a/test/source/xmltesttools.cxx +++ b/test/source/xmltesttools.cxx @@ -162,11 +162,6 @@ OUString XmlTestTools::getXPathContent(const xmlDocUniquePtr& pXmlDoc, const OSt CPPUNIT_FAIL("Invalid XPath type"); } -void XmlTestTools::assertXPath(const xmlDocUniquePtr& pXmlDoc, const OString& rXPath) -{ - getXPath(pXmlDoc, rXPath, ""); // it asserts that rXPath exists, and returns exactly one node -} - void XmlTestTools::assertXPath(const xmlDocUniquePtr& pXmlDoc, const OString& rXPath, const OString& rAttribute, const OUString& rExpectedValue) { OUString aValue = getXPath(pXmlDoc, rXPath, rAttribute);