summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorIlmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>2023-09-28 16:42:18 +0300
committerIlmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>2023-10-06 12:48:17 +0200
commitb693d19884a09b5f841b30f2e8b586778584ed16 (patch)
tree04523abac3e7f37aca0076464a47dd4085832f92 /test
parent757a73379dba01fde853443a09583d862c404531 (diff)
xmltesttools: add assertXPathDoubleValue that takes a double with delta
and use it to make WmfTest::testSetTextAlignWmf independent of DPI Change-Id: I2048239088a8dcc3e3ab1db96413894b5bcc56d6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157377 Tested-by: Jenkins Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org> Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
Diffstat (limited to 'test')
-rw-r--r--test/source/xmltesttools.cxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/source/xmltesttools.cxx b/test/source/xmltesttools.cxx
index db743e5688aa..8f96a399caff 100644
--- a/test/source/xmltesttools.cxx
+++ b/test/source/xmltesttools.cxx
@@ -171,6 +171,14 @@ void XmlTestTools::assertXPath(const xmlDocUniquePtr& pXmlDoc, const OString& rX
rExpectedValue, aValue);
}
+void XmlTestTools::assertXPathDoubleValue(const xmlDocUniquePtr& pXmlDoc, const OString& rXPath, const OString& rAttribute, double expectedValue, double delta)
+{
+ OUString aValue = getXPath(pXmlDoc, rXPath, rAttribute);
+ double pathValue = aValue.toDouble();
+ CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(std::string("In <") + std::string(pXmlDoc->name ? pXmlDoc->name : "") + ">, attribute '" + std::string(rAttribute) + "' of '" + std::string(rXPath) + "' incorrect value.",
+ expectedValue, pathValue, delta);
+}
+
void XmlTestTools::assertXPathAttrs(const xmlDocUniquePtr& pXmlDoc, const OString& rXPath,
const std::vector<std::pair<OString, OUString>>& aPairVector)
{