summaryrefslogtreecommitdiffstats
path: root/emfio
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2021-07-06 11:32:01 +0200
committerMiklos Vajna <vmiklos@collabora.com>2021-07-06 14:39:45 +0200
commit3ca124b78ab078da5f54bb800e2322c3dd8661e5 (patch)
tree2b44cee75a902d568c91e1c1c00a25d2eea97ec9 /emfio
parenttdf#142464: do not escape '/' is AM/PM when importing DOCX. (diff)
downloadcore-3ca124b78ab078da5f54bb800e2322c3dd8661e5.tar.gz
core-3ca124b78ab078da5f54bb800e2322c3dd8661e5.zip
CppunitTest_emfio_emf: add some tolerance in TestDrawStringAlign
Commit 574dc1e8ff6ea4214fefd91216fca5146a4ff13e (EMF+ tdf#142995 tdf#142997 tdf#143076 Add alignment support for DrawString, 2021-06-24) added this test, it seems the result depends on what fonts are installed, so add some tolerance. Probably it fails for me (and not on Jenkins) as I have lots of additional fonts installed, e.g. Arial (and not only Liberation Sans). Change-Id: Ie93d1f1efe1fbbf1851ad46f33f5f83c8812e6d3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118470 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins (cherry picked from commit 4f33e723900c280c17c75898fb7a59e2e749f93e) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118492
Diffstat (limited to 'emfio')
-rw-r--r--emfio/qa/cppunit/emf/EmfImportTest.cxx21
1 files changed, 15 insertions, 6 deletions
diff --git a/emfio/qa/cppunit/emf/EmfImportTest.cxx b/emfio/qa/cppunit/emf/EmfImportTest.cxx
index 63e1d575803b..7e28b2a326d0 100644
--- a/emfio/qa/cppunit/emf/EmfImportTest.cxx
+++ b/emfio/qa/cppunit/emf/EmfImportTest.cxx
@@ -251,8 +251,11 @@ void Test::TestDrawStringAlign()
"text", "HCVT");
// TODO Make the position of the text the same across the platforms (Arial vs Liberation Sans).
- assertXPath(pDocument, "/primitive2D/metafile/transform/mask/transform[3]/textsimpleportion",
- "x", "276");
+ // This is usually 276, but can be 275 as well; depends on what fonts are installed?
+ sal_Int32 nX = getXPath(pDocument, "/primitive2D/metafile/transform/mask/transform[3]/textsimpleportion",
+ "x").toInt32();
+ CPPUNIT_ASSERT(nX >= 275);
+ CPPUNIT_ASSERT(nX <= 276);
assertXPath(pDocument, "/primitive2D/metafile/transform/mask/transform[3]/textsimpleportion",
"y", "22");
assertXPath(pDocument, "/primitive2D/metafile/transform/mask/transform[3]/textsimpleportion",
@@ -272,8 +275,11 @@ void Test::TestDrawStringAlign()
assertXPath(pDocument, "/primitive2D/metafile/transform/mask/transform[5]/textsimpleportion",
"text", "HCVC");
- assertXPath(pDocument, "/primitive2D/metafile/transform/mask/transform[6]/textsimpleportion",
- "x", "274");
+ // This is usually 274, but can be 273 as well; depends on what fonts are installed?
+ nX = getXPath(pDocument, "/primitive2D/metafile/transform/mask/transform[6]/textsimpleportion",
+ "x").toInt32();
+ CPPUNIT_ASSERT(nX >= 273);
+ CPPUNIT_ASSERT(nX <= 274);
assertXPath(pDocument, "/primitive2D/metafile/transform/mask/transform[6]/textsimpleportion",
"y", "66");
assertXPath(pDocument, "/primitive2D/metafile/transform/mask/transform[6]/textsimpleportion",
@@ -293,8 +299,11 @@ void Test::TestDrawStringAlign()
assertXPath(pDocument, "/primitive2D/metafile/transform/mask/transform[8]/textsimpleportion",
"text", "HCVB");
- assertXPath(pDocument, "/primitive2D/metafile/transform/mask/transform[9]/textsimpleportion",
- "x", "275");
+ // This is usually 275, but can be 274 as well; depends on what fonts are installed?
+ nX = getXPath(pDocument, "/primitive2D/metafile/transform/mask/transform[9]/textsimpleportion",
+ "x").toInt32();
+ CPPUNIT_ASSERT(nX >= 274);
+ CPPUNIT_ASSERT(nX <= 275);
assertXPath(pDocument, "/primitive2D/metafile/transform/mask/transform[9]/textsimpleportion",
"y", "110");
assertXPath(pDocument, "/primitive2D/metafile/transform/mask/transform[9]/textsimpleportion",