summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMorten Johan Sørvig <morten.sorvig@qt.io>2021-02-16 14:59:27 +0100
committerMorten Johan Sørvig <morten.sorvig@qt.io>2021-02-23 15:34:05 +0100
commit700d1037aa38f71813826e5104533f357fc41e04 (patch)
tree7537e331de699eb110d5fc2420c981d295e3667d
parent462410a08b8bbfb068b6e06573adb0701c527d06 (diff)
Verify that QFileIconProvider returns valid pixmaps
Extend and rename the pixmap() crash test to also verify that a non-null pixmap is returned. Change-Id: Ia972c4f705724cfa1394521a2dfd87451d9c5d64 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
-rw-r--r--tests/auto/widgets/itemviews/qfileiconprovider/tst_qfileiconprovider.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/auto/widgets/itemviews/qfileiconprovider/tst_qfileiconprovider.cpp b/tests/auto/widgets/itemviews/qfileiconprovider/tst_qfileiconprovider.cpp
index 9e9625854e..39f6946b1d 100644
--- a/tests/auto/widgets/itemviews/qfileiconprovider/tst_qfileiconprovider.cpp
+++ b/tests/auto/widgets/itemviews/qfileiconprovider/tst_qfileiconprovider.cpp
@@ -47,7 +47,7 @@ private slots:
void type_data();
void type();
- void taskQTBUG_46755_QFileIconEngine_crash();
+ void iconPixmaps();
};
void tst_QFileIconProvider::qfileiconprovider()
@@ -129,14 +129,14 @@ static QIcon getIcon()
return fip.icon(QFileInfo(QDir::currentPath()));
}
-void tst_QFileIconProvider::taskQTBUG_46755_QFileIconEngine_crash()
+void tst_QFileIconProvider::iconPixmaps()
{
const QIcon &icon = getIcon();
const auto sizes = icon.availableSizes();
- for (const QSize &size : sizes)
- icon.pixmap(size);
-
- // No crash, all good.
+ for (const QSize &size : sizes) {
+ QPixmap pixmap = icon.pixmap(size);
+ QVERIFY(!pixmap.isNull());
+ }
}
QTEST_MAIN(tst_QFileIconProvider)