[Libreoffice-commits] core.git: Branch 'libreoffice-7-2' - emfio/qa

Miklos Vajna (via logerrit) logerrit at kemper.freedesktop.org
Tue Jul 6 12:40:22 UTC 2021


 emfio/qa/cppunit/emf/EmfImportTest.cxx |   21 +++++++++++++++------
 1 file changed, 15 insertions(+), 6 deletions(-)

New commits:
commit 3ca124b78ab078da5f54bb800e2322c3dd8661e5
Author:     Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Tue Jul 6 11:32:01 2021 +0200
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Tue Jul 6 14:39:45 2021 +0200

    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 at collabora.com>
    Tested-by: Jenkins
    (cherry picked from commit 4f33e723900c280c17c75898fb7a59e2e749f93e)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118492

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",


More information about the Libreoffice-commits mailing list