summaryrefslogtreecommitdiffstats
path: root/test/source/xmltesttools.cxx
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2019-04-25 12:51:40 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2019-04-25 14:42:13 +0200
commit3fef9fa3f5d260dd1264b67d8b42aad476332eea (patch)
tree72b6f9ac1231df074f059fd97aaa52a18b589859 /test/source/xmltesttools.cxx
parentUpdate git submodules (diff)
downloadcore-3fef9fa3f5d260dd1264b67d8b42aad476332eea.tar.gz
core-3fef9fa3f5d260dd1264b67d8b42aad476332eea.zip
assertXPath: disallow passing rAttribute without rExpectedValue
Change-Id: I7fb59039429361dad04fb68507f40545f9c4dd6d Reviewed-on: https://gerrit.libreoffice.org/71290 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'test/source/xmltesttools.cxx')
-rw-r--r--test/source/xmltesttools.cxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/source/xmltesttools.cxx b/test/source/xmltesttools.cxx
index 123af01b28db..20149cc03c37 100644
--- a/test/source/xmltesttools.cxx
+++ b/test/source/xmltesttools.cxx
@@ -135,6 +135,11 @@ OUString XmlTestTools::getXPathContent(xmlDocPtr pXmlDoc, const OString& rXPath)
CPPUNIT_FAIL("Invalid XPath type");
}
+void XmlTestTools::assertXPath(xmlDocPtr pXmlDoc, const OString& rXPath)
+{
+ getXPath(pXmlDoc, rXPath, ""); // it asserts that rXPath exists, and returns exactly one node
+}
+
void XmlTestTools::assertXPath(xmlDocPtr pXmlDoc, const OString& rXPath, const OString& rAttribute, const OUString& rExpectedValue)
{
OUString aValue = getXPath(pXmlDoc, rXPath, rAttribute);