From b3f503c5d88b2314fca9fc9124f918090c8c427b Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Thu, 13 Jun 2024 01:32:03 +0500 Subject: 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 Tested-by: Jenkins (cherry picked from commit e74c94c1a6ae47eb507eec610e231ebb6b02a8be) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168726 Reviewed-by: Xisco Fauli --- test/source/xmltesttools.cxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'test') 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); -- cgit