summaryrefslogtreecommitdiff
path: root/include/test/xmltesttools.hxx
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 /include/test/xmltesttools.hxx
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 'include/test/xmltesttools.hxx')
-rw-r--r--include/test/xmltesttools.hxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/test/xmltesttools.hxx b/include/test/xmltesttools.hxx
index 09f06af5eb0d..d18b5d51e813 100644
--- a/include/test/xmltesttools.hxx
+++ b/include/test/xmltesttools.hxx
@@ -73,6 +73,14 @@ protected:
const OUString& rExpectedValue);
void assertXPathAttrs(const xmlDocUniquePtr& pXmlDoc, const OString& rXPath,
const std::vector<std::pair<OString, OUString>>& aPairVector);
+
+ /**
+ * Given a double for the rExpected value, assert that rXPath exists, returns exactly one node,
+ * and the rXPath's attribute's value matches the rExpected value within tolerance provided
+ * by delta. This is used to account for HiDPI scaling.
+ */
+ void assertXPathDoubleValue(const xmlDocUniquePtr& pXmlDoc, const OString& rXPath, const OString& rAttribute,
+ double expectedValue, double delta);
/**
* Assert that rXPath exists, and returns exactly nNumberOfNodes nodes (1 by default).
* Also useful for checking that we do _not_ export some node (nNumberOfNodes == 0).