diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2021-07-06 11:32:01 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2021-07-06 12:22:12 +0200 |
commit | 4f33e723900c280c17c75898fb7a59e2e749f93e (patch) | |
tree | 685c35039b5494416136c5649e3648f90e933568 /emfio | |
parent | ecb63e193e20d5a920fce637e8aa1c0acd743b20 (diff) |
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
Diffstat (limited to 'emfio')
-rw-r--r-- | emfio/qa/cppunit/emf/EmfImportTest.cxx | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/emfio/qa/cppunit/emf/EmfImportTest.cxx b/emfio/qa/cppunit/emf/EmfImportTest.cxx index c60a4870f6f1..f894c2d9a666 100644 --- a/emfio/qa/cppunit/emf/EmfImportTest.cxx +++ b/emfio/qa/cppunit/emf/EmfImportTest.cxx @@ -285,8 +285,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", @@ -306,8 +309,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", @@ -327,8 +333,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", |