summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2016-05-11 13:43:16 +0300
committerTony Sarajärvi <tony.sarajarvi@qt.io>2016-05-13 21:08:07 +0000
commit186d391f256705f58b421e0cf20260e352e79603 (patch)
tree23bcbfdbb14e546637fe51968c2d3cff8c8a70a6
parented38750c035adbaa035257cd222193a5fdf7a254 (diff)
Work around QFont bug in QFontDialog test
The QFontDialog test will currently fail for some PCF bitmap fonts because the list of smooth sizes it uses to populate its size list contains unsupported sizes. We work around this by adding QEXPECT_FAIL when we detect that the failure is going to happen. Task-number: QTBUG-46056 Task-number: QTBUG-53299 Change-Id: Ia665cca220f3622405d1a2336e8d587545cccbc6 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
-rw-r--r--tests/auto/widgets/dialogs/qfontdialog/tst_qfontdialog.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/auto/widgets/dialogs/qfontdialog/tst_qfontdialog.cpp b/tests/auto/widgets/dialogs/qfontdialog/tst_qfontdialog.cpp
index 796b4b9fdb..9aacd3105e 100644
--- a/tests/auto/widgets/dialogs/qfontdialog/tst_qfontdialog.cpp
+++ b/tests/auto/widgets/dialogs/qfontdialog/tst_qfontdialog.cpp
@@ -193,11 +193,14 @@ void tst_QFontDialog::task256466_wrongStyle()
for (int i = 0; i < familyList->model()->rowCount(); ++i) {
QModelIndex currentFamily = familyList->model()->index(i, 0);
familyList->setCurrentIndex(currentFamily);
+ int expectedSize = sizeList->currentIndex().data().toInt();
const QFont current = dialog.currentFont(),
expected = fdb.font(currentFamily.data().toString(),
- styleList->currentIndex().data().toString(), sizeList->currentIndex().data().toInt());
+ styleList->currentIndex().data().toString(), expectedSize);
QCOMPARE(current.family(), expected.family());
QCOMPARE(current.style(), expected.style());
+ if (expectedSize == 0 && !QFontDatabase().isScalable(current.family(), current.styleName()))
+ QEXPECT_FAIL("", "QTBUG-53299: Smooth sizes for unscalable font contains unsupported size", Continue);
QCOMPARE(current.pointSizeF(), expected.pointSizeF());
}
}