OSDN Git Service

skip the QFileIconProvider::iconType() test case if there is no system icon theme
authorIvailo Monev <xakepa10@gmail.com>
Wed, 8 Jun 2022 01:12:24 +0000 (04:12 +0300)
committerIvailo Monev <xakepa10@gmail.com>
Wed, 8 Jun 2022 01:12:24 +0000 (04:12 +0300)
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
tests/auto/qfileiconprovider/tst_qfileiconprovider.cpp

index 365cfbd..0bb5768 100644 (file)
@@ -74,6 +74,12 @@ void tst_QFileIconProvider::iconType_data()
 void tst_QFileIconProvider::iconType()
 {
     QFETCH(QFileIconProvider::IconType, type);
+
+    const QString icontheme = QIcon::themeName();
+    if (icontheme.isEmpty() || icontheme == QLatin1String("hicolor")) {
+        QSKIP("This test requires system icon theme", SkipAll);
+    }
+
     SubQFileIconProvider provider;
     QVERIFY(!provider.icon(type).isNull());
 }
@@ -104,7 +110,6 @@ void tst_QFileIconProvider::iconInfo()
         QVERIFY(info.exists());
     }
     SubQFileIconProvider provider;
-    // we should always get an icon
     QVERIFY(!provider.icon(info).isNull());
 }