Merge two assertXPath overloads that both check number of nodes
Change-Id: I67eec623b90ab20330fa0c268152211b6bbdbe1e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143301 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
This commit is contained in:
@@ -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<std::pair<OString, OUString>>& 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.
|
||||
*/
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user