summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorMiikka Heikkinen <miikka.heikkinen@digia.com>2012-04-24 13:06:33 +0300
committerQt by Nokia <qt-info@nokia.com>2012-04-25 22:38:45 +0200
commitce755299684b06ddd936b5cf8ad7907d79000a43 (patch)
tree48503f25f2423526d3eca7854031782e7ea43069 /tests/auto
parent67f58040ea10255af2c09149f16ce683f00dc7a2 (diff)
Fix QRawFont autotest in Windows
Can't use style name with Windows native font engine, so do the comparison using style in case multipleRawFontsFromData(). Also XFAILed the advances() case when using Freetype font engine in Windows, as some of the advances returned are one pixel wider than expected. Task-number: QTBUG-24197 Change-Id: Ib5fecd83a93908e57a4c82ffb5495a92474ce45a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/gui/text/qrawfont/qrawfont.pro2
-rw-r--r--tests/auto/gui/text/qrawfont/tst_qrawfont.cpp11
2 files changed, 10 insertions, 3 deletions
diff --git a/tests/auto/gui/text/qrawfont/qrawfont.pro b/tests/auto/gui/text/qrawfont/qrawfont.pro
index 8cac4abc57..149ad6442e 100644
--- a/tests/auto/gui/text/qrawfont/qrawfont.pro
+++ b/tests/auto/gui/text/qrawfont/qrawfont.pro
@@ -9,5 +9,3 @@ SOURCES += \
INCLUDEPATH += $$QT_SOURCE_TREE/src/3rdparty/harfbuzz/src
TESTDATA += testfont_bold_italic.ttf testfont.ttf
-
-win32:CONFIG += insignificant_test # QTBUG-24197
diff --git a/tests/auto/gui/text/qrawfont/tst_qrawfont.cpp b/tests/auto/gui/text/qrawfont/tst_qrawfont.cpp
index 99e53f3261..a3fe7b5368 100644
--- a/tests/auto/gui/text/qrawfont/tst_qrawfont.cpp
+++ b/tests/auto/gui/text/qrawfont/tst_qrawfont.cpp
@@ -295,6 +295,15 @@ void tst_QRawFont::advances()
bool supportsSubPixelPositions = font_d->fontEngine->supportsSubPixelPositions();
QVector<QPointF> advances = font.advancesForGlyphIndexes(glyphIndices);
for (int i=0; i<glyphIndices.size(); ++i) {
+#ifdef Q_OS_WIN
+ // In Windows, freetype engine returns advance of 9 when full hinting is used (default) for
+ // some of the glyphs.
+ if (font_d->fontEngine->type() == QFontEngine::Freetype
+ && (hintingPreference == QFont::PreferFullHinting || hintingPreference == QFont::PreferDefaultHinting)
+ && (i == 0 || i == 5)) {
+ QEXPECT_FAIL("", "Advance for some glyphs is not the expected with Windows Freetype engine (9 instead of 8)", Continue);
+ }
+#endif
QVERIFY(qFuzzyCompare(qRound(advances.at(i).x()), 8.0));
if (supportsSubPixelPositions)
QVERIFY(advances.at(i).x() > 8.0);
@@ -879,7 +888,7 @@ void tst_QRawFont::multipleRawFontsFromData()
testFontBoldItalic.loadFromData(file.readAll(), 11, QFont::PreferDefaultHinting);
QVERIFY(testFont.familyName() != (testFontBoldItalic.familyName())
- || testFont.styleName() != (testFontBoldItalic.styleName()));
+ || testFont.style() != (testFontBoldItalic.style()));
}
#endif // QT_NO_RAWFONT