From ce755299684b06ddd936b5cf8ad7907d79000a43 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Tue, 24 Apr 2012 13:06:33 +0300 Subject: 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 --- tests/auto/gui/text/qrawfont/qrawfont.pro | 2 -- tests/auto/gui/text/qrawfont/tst_qrawfont.cpp | 11 ++++++++++- 2 files changed, 10 insertions(+), 3 deletions(-) (limited to 'tests') 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 advances = font.advancesForGlyphIndexes(glyphIndices); for (int i=0; ifontEngine->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 -- cgit v1.2.3