diff options
author | Gunnar Sletta <gunnar.sletta@nokia.com> | 2011-08-25 12:50:29 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-08-25 12:50:29 +0200 |
commit | 9e04c60ac070348f8208fb0254e62d6e593320c3 (patch) | |
tree | cd038cf2612faf8dadeae5fb8b807b66e2291026 /tests/auto/qglyphrun/tst_qglyphrun.cpp | |
parent | bfa8d15e15fdeb0bbfb6575e37be1c32445ab7cc (diff) | |
parent | 04d0a9626ce61b2e05a40f9562c2bcf12e234639 (diff) |
Merge "Merge branch 'master' into refactor" into refactor
Diffstat (limited to 'tests/auto/qglyphrun/tst_qglyphrun.cpp')
-rw-r--r-- | tests/auto/qglyphrun/tst_qglyphrun.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/auto/qglyphrun/tst_qglyphrun.cpp b/tests/auto/qglyphrun/tst_qglyphrun.cpp index a18a2ac8dd..e84915428f 100644 --- a/tests/auto/qglyphrun/tst_qglyphrun.cpp +++ b/tests/auto/qglyphrun/tst_qglyphrun.cpp @@ -55,6 +55,7 @@ class tst_QGlyphRun: public QObject #if !defined(QT_NO_RAWFONT) private slots: void initTestCase(); + void init(); void cleanupTestCase(); void constructionAndDestruction(); @@ -78,6 +79,7 @@ private slots: private: int m_testFontId; QFont m_testFont; + bool m_testFont_ok; #endif // QT_NO_RAWFONT }; @@ -88,12 +90,27 @@ Q_DECLARE_METATYPE(QGlyphRun); void tst_QGlyphRun::initTestCase() { + m_testFont_ok = false; + m_testFontId = QFontDatabase::addApplicationFont(SRCDIR "test.ttf"); QVERIFY(m_testFontId >= 0); m_testFont = QFont("QtsSpecialTestFont"); +#ifdef Q_WS_QPA + QEXPECT_FAIL("", "QTBUG-20760 fails on qpa", Abort); +#endif + QCOMPARE(QFontInfo(m_testFont).family(), QString::fromLatin1("QtsSpecialTestFont")); + + m_testFont_ok = true; +} + +void tst_QGlyphRun::init() +{ + if (!m_testFont_ok) { + QSKIP("Test font is not working correctly", SkipAll); + } } void tst_QGlyphRun::cleanupTestCase() @@ -237,6 +254,7 @@ void tst_QGlyphRun::textLayoutGlyphIndexes() layout.endLayout(); QList<QGlyphRun> listOfGlyphs = layout.glyphRuns(); + QCOMPARE(listOfGlyphs.size(), 1); QGlyphRun glyphs = listOfGlyphs.at(0); |