diff options
Diffstat (limited to 'tests/auto/qfontdatabase')
-rw-r--r-- | tests/auto/qfontdatabase/qfontdatabase.pro | 2 | ||||
-rw-r--r-- | tests/auto/qfontdatabase/tst_qfontdatabase.cpp | 35 |
2 files changed, 35 insertions, 2 deletions
diff --git a/tests/auto/qfontdatabase/qfontdatabase.pro b/tests/auto/qfontdatabase/qfontdatabase.pro index 35811f1..e7dfc3c 100644 --- a/tests/auto/qfontdatabase/qfontdatabase.pro +++ b/tests/auto/qfontdatabase/qfontdatabase.pro @@ -3,7 +3,7 @@ SOURCES += tst_qfontdatabase.cpp !symbian:DEFINES += SRCDIR=\\\"$$PWD\\\" wince*|symbian { - additionalFiles.sources = FreeMono.ttf + additionalFiles.files = FreeMono.ttf additionalFiles.path = . DEPLOYMENT += additionalFiles } diff --git a/tests/auto/qfontdatabase/tst_qfontdatabase.cpp b/tests/auto/qfontdatabase/tst_qfontdatabase.cpp index ead000c..fe216e7 100644 --- a/tests/auto/qfontdatabase/tst_qfontdatabase.cpp +++ b/tests/auto/qfontdatabase/tst_qfontdatabase.cpp @@ -70,6 +70,11 @@ private slots: void fixedPitch_data(); void fixedPitch(); +#ifdef Q_WS_MAC + void trickyFonts_data(); + void trickyFonts(); +#endif + void widthTwoTimes_data(); void widthTwoTimes(); @@ -131,10 +136,16 @@ void tst_QFontDatabase::fixedPitch_data() QTest::newRow( "Times New Roman" ) << QString( "Times New Roman" ) << false; QTest::newRow( "Arial" ) << QString( "Arial" ) << false; - QTest::newRow( "Script" ) << QString( "Script" ) << false; + QTest::newRow( "Andale Mono" ) << QString( "Andale Mono" ) << true; QTest::newRow( "Courier" ) << QString( "Courier" ) << true; QTest::newRow( "Courier New" ) << QString( "Courier New" ) << true; +#ifndef Q_WS_MAC + QTest::newRow( "Script" ) << QString( "Script" ) << false; QTest::newRow( "Lucida Console" ) << QString( "Lucida Console" ) << true; +#else + QTest::newRow( "Menlo" ) << QString( "Menlo" ) << true; + QTest::newRow( "Monaco" ) << QString( "Monaco" ) << true; +#endif } void tst_QFontDatabase::fixedPitch() @@ -156,6 +167,28 @@ void tst_QFontDatabase::fixedPitch() QCOMPARE(fi.fixedPitch(), fixedPitch); } +#ifdef Q_WS_MAC +void tst_QFontDatabase::trickyFonts_data() +{ + QTest::addColumn<QString>("font"); + + QTest::newRow( "Geeza Pro" ) << QString( "Geeza Pro" ); +} + +void tst_QFontDatabase::trickyFonts() +{ + QFETCH(QString, font); + + QFontDatabase fdb; + if (!fdb.families().contains(font)) + QSKIP( "Font not installed", SkipSingle); + + QFont qfont(font); + QFontInfo fi(qfont); + QCOMPARE(fi.family(), font); +} +#endif + void tst_QFontDatabase::widthTwoTimes_data() { QTest::addColumn<QString>("font"); |