diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2024-06-13 01:32:03 +0500 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2024-06-13 07:49:19 +0200 |
commit | e74c94c1a6ae47eb507eec610e231ebb6b02a8be (patch) | |
tree | 23e47d9aa3eca1aaf3c49bc7c80a5ef46a507a5f /test | |
parent | daedc81fa22690ce1a08b477a52360f05e4f5ed9 (diff) |
tdf#161509: Output the same special style names and identifiers as Word
Take care to match the case of the names. Some tools rely on specific
case; so standardize on what Word outputs.
getXPath is modified to tell which XPath has failed (needed for the
unit test).
Change-Id: I3e71f5905b26d7e784d68ba11ff205eefedaaa2c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168755
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'test')
-rw-r--r-- | test/source/xmltesttools.cxx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/test/source/xmltesttools.cxx b/test/source/xmltesttools.cxx index 06678b1f33f1..a86e39e4b778 100644 --- a/test/source/xmltesttools.cxx +++ b/test/source/xmltesttools.cxx @@ -90,16 +90,16 @@ OUString XmlTestTools::getXPath(const xmlDocUniquePtr& pXmlDoc, const OString& r { CPPUNIT_ASSERT(pXmlDoc); xmlXPathObjectPtr pXmlObj = getXPathNode(pXmlDoc, rXPath); - CPPUNIT_ASSERT(pXmlObj); + OString docAndXPath = OString::Concat("In <") + pXmlDoc->name + ">, XPath '" + rXPath; + CPPUNIT_ASSERT_MESSAGE(docAndXPath.getStr(), pXmlObj); xmlNodeSetPtr pXmlNodes = pXmlObj->nodesetval; - CPPUNIT_ASSERT(pXmlNodes); - CPPUNIT_ASSERT_EQUAL_MESSAGE(OString(OString::Concat("In <") + pXmlDoc->name + ">, XPath '" + rXPath + "' number of nodes is incorrect").getStr(), + CPPUNIT_ASSERT_MESSAGE(OString(docAndXPath + "' not found").getStr(), pXmlNodes); + CPPUNIT_ASSERT_EQUAL_MESSAGE(OString(docAndXPath + "' number of nodes is incorrect").getStr(), 1, xmlXPathNodeSetGetLength(pXmlNodes)); CPPUNIT_ASSERT(!rAttribute.isEmpty()); xmlNodePtr pXmlNode = pXmlNodes->nodeTab[0]; xmlChar * prop = xmlGetProp(pXmlNode, BAD_CAST(rAttribute.getStr())); - OString sAttAbsent = OString::Concat("In <") + pXmlDoc->name + ">, XPath '" + rXPath - + "' no attribute '" + rAttribute + "' exist"; + OString sAttAbsent = docAndXPath + "' no attribute '" + rAttribute + "' exist"; CPPUNIT_ASSERT_MESSAGE(sAttAbsent.getStr(), prop); OUString s(convert(prop)); xmlFree(prop); |