[Libreoffice-commits] core.git: vcl/qa

Tomaž Vajngerl tomaz.vajngerl at collabora.co.uk
Thu Jul 5 15:56:43 UTC 2018


 vcl/qa/cppunit/FontFeatureTest.cxx |   14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

New commits:
commit 07cac0079fce384ce0e97875d84bc7c9888ed94a
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
Date:   Thu Jul 5 15:21:51 2018 +0200

    FontFeatureTest set weight/italcs explicitly
    
    Font featrues can depend on the state. To make the state more
    stable we need to set the the font properties explicitly. This
    sets the weight, italics, width type to "NORMAL", which changes
    the number of available features.
    
    Change-Id: Ida6be4191762c3acfeb7b95182b80717e9774c62
    Reviewed-on: https://gerrit.libreoffice.org/57011
    Tested-by: Jenkins
    Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>

diff --git a/vcl/qa/cppunit/FontFeatureTest.cxx b/vcl/qa/cppunit/FontFeatureTest.cxx
index 018c3ee222e4..b37cac87a283 100644
--- a/vcl/qa/cppunit/FontFeatureTest.cxx
+++ b/vcl/qa/cppunit/FontFeatureTest.cxx
@@ -43,8 +43,15 @@ void FontFeatureTest::testGetFontFeatures()
                                               DeviceFormat::DEFAULT, DeviceFormat::DEFAULT);
     aVDev->SetOutputSizePixel(Size(10, 10));
 
+    OUString aFontName("Linux Libertine G");
+    if (aVDev->IsFontAvailable(aFontName))
+        return; // Can't test this because the font is not available, so exit
+
     vcl::Font aFont = aVDev->GetFont();
     aFont.SetFamilyName("Linux Libertine G");
+    aFont.SetWeight(FontWeight::WEIGHT_NORMAL);
+    aFont.SetItalic(FontItalic::ITALIC_NORMAL);
+    aFont.SetWidthType(FontWidth::WIDTH_NORMAL);
     aVDev->SetFont(aFont);
 
     std::vector<vcl::font::Feature> rFontFeatures;
@@ -63,12 +70,11 @@ void FontFeatureTest::testGetFontFeatures()
         }
     }
 
-    CPPUNIT_ASSERT_EQUAL(size_t(27), rDefaultFontFeatures.size());
+    CPPUNIT_ASSERT_EQUAL(size_t(20), rDefaultFontFeatures.size());
 
     OUString aExpectedFeaturesString = "aalt c2sc case dlig frac hlig liga lnum "
-                                       "nalt onum pnum salt sinf smcp ss01 ss02 "
-                                       "ss03 ss04 ss05 ss06 sups tnum zero cpsp "
-                                       "kern lfbd rtbd ";
+                                       "onum pnum salt sinf smcp ss01 ss02 ss03 "
+                                       "sups tnum zero cpsp ";
     CPPUNIT_ASSERT_EQUAL(aExpectedFeaturesString, aFeaturesString);
 
     // Check C2SC feature


More information about the Libreoffice-commits mailing list