summaryrefslogtreecommitdiff
path: root/sw/qa/unit
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2024-07-29 20:42:44 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2024-07-30 13:49:32 +0200
commit3371a9b36fb455501449d6575250ff19e5ffa18b (patch)
treef8979735119f2c8d81cda3a3debb9d613ddf55b2 /sw/qa/unit
parent4f0c25dda41b5a8f418c1e283a4a85143393ae4c (diff)
sw: get rid of parseDump
So parseLayoutDump is only called once per test Change-Id: Ia199e0a7eeac26fbde94f6450d2aa49828940806 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171219 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org> Tested-by: Jenkins
Diffstat (limited to 'sw/qa/unit')
-rw-r--r--sw/qa/unit/swmodeltestbase.cxx40
1 files changed, 0 insertions, 40 deletions
diff --git a/sw/qa/unit/swmodeltestbase.cxx b/sw/qa/unit/swmodeltestbase.cxx
index 84437dffd5e5..8c6b85cf428b 100644
--- a/sw/qa/unit/swmodeltestbase.cxx
+++ b/sw/qa/unit/swmodeltestbase.cxx
@@ -170,46 +170,6 @@ xmlDocUniquePtr SwModelTestBase::parseLayoutDump(const uno::Reference<lang::XCom
return pXmlDoc;
}
-OUString SwModelTestBase::parseDump(const OString& aXPath, const OString& aAttribute)
-{
- xmlDocUniquePtr pXmlDoc = parseLayoutDump();
-
- xmlXPathContextPtr pXmlXpathCtx = xmlXPathNewContext(pXmlDoc.get());
- xmlXPathObjectPtr pXmlXpathObj
- = xmlXPathEvalExpression(BAD_CAST(aXPath.getStr()), pXmlXpathCtx);
- CPPUNIT_ASSERT_MESSAGE("xpath evaluation failed", pXmlXpathObj);
- xmlChar* pXpathStrResult;
- if (pXmlXpathObj->type == XPATH_NODESET)
- {
- xmlNodeSetPtr pXmlNodes = pXmlXpathObj->nodesetval;
- int nNodes = xmlXPathNodeSetGetLength(pXmlNodes);
- OString aMessage("xpath ('" + aXPath + "') should match exactly 1 node");
- CPPUNIT_ASSERT_EQUAL_MESSAGE(aMessage.getStr(), 1, nNodes);
- CPPUNIT_ASSERT(pXmlNodes);
- xmlNodePtr pXmlNode = pXmlNodes->nodeTab[0];
- if (aAttribute.getLength())
- pXpathStrResult = xmlGetProp(pXmlNode, BAD_CAST(aAttribute.getStr()));
- else
- pXpathStrResult = xmlNodeGetContent(pXmlNode);
- }
- else
- {
- // the xpath expression evaluated to a value, not a node
- CPPUNIT_ASSERT_EQUAL_MESSAGE("attr name should not be supplied when xpath evals to a value",
- sal_Int32(0), aAttribute.getLength());
- pXpathStrResult = xmlXPathCastToString(pXmlXpathObj);
- CPPUNIT_ASSERT_MESSAGE("xpath result cannot be cast to string", pXpathStrResult);
- }
-
- OUString aRet(reinterpret_cast<char*>(pXpathStrResult), xmlStrlen(pXpathStrResult),
- RTL_TEXTENCODING_UTF8);
- xmlFree(pXpathStrResult);
- xmlFree(pXmlXpathObj);
- xmlFree(pXmlXpathCtx);
-
- return aRet;
-}
-
bool SwModelTestBase::hasProperty(const uno::Reference<uno::XInterface>& obj,
const OUString& name) const
{