mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-24 02:42:55 +00:00
add case-sensitivity test for QFontDatabase
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
a06e3b8be8
commit
aa39dbb344
1 changed files with 32 additions and 0 deletions
|
@ -86,6 +86,9 @@ private slots:
|
|||
|
||||
void fontInfo_data();
|
||||
void fontInfo();
|
||||
|
||||
void caseInsensitive_data();
|
||||
void caseInsensitive();
|
||||
};
|
||||
|
||||
void tst_QFontDatabase::styles_data()
|
||||
|
@ -275,6 +278,35 @@ void tst_QFontDatabase::fontInfo()
|
|||
QCOMPARE(fdbfont.fixedPitch(), fi.fixedPitch());
|
||||
}
|
||||
|
||||
void tst_QFontDatabase::caseInsensitive_data()
|
||||
{
|
||||
QTest::addColumn<QString>("font");
|
||||
QTest::addColumn<QString>("style");
|
||||
|
||||
// actual font families
|
||||
QTest::newRow("FreeSans") << QString("FreeSans") << QString("rEGular");
|
||||
QTest::newRow("freeSans [gNu ]") << QString("freeSans [gNu ]") << QString("obLique");
|
||||
QTest::newRow("freeMono") << QString("freeMono") << QString("BOLD");
|
||||
// aliases
|
||||
QTest::newRow("sans serif") << QString("sans serif") << QString("bold");
|
||||
QTest::newRow("MoNoSpAcE") << QString("MoNoSpAcE") << QString("BoLd");
|
||||
}
|
||||
|
||||
|
||||
void tst_QFontDatabase::caseInsensitive()
|
||||
{
|
||||
QFETCH(QString, font);
|
||||
QFETCH(QString, style);
|
||||
|
||||
QFontDatabase fdb;
|
||||
// qDebug() << fdb.families();
|
||||
if (!fdb.hasFamily(font)) {
|
||||
QSKIP("Font not installed", SkipSingle);
|
||||
}
|
||||
|
||||
QVERIFY(!fdb.smoothSizes(font, style).isEmpty());
|
||||
}
|
||||
|
||||
QTEST_MAIN(tst_QFontDatabase)
|
||||
|
||||
#include "moc_tst_qfontdatabase.cpp"
|
||||
|
|
Loading…
Add table
Reference in a new issue