diff options
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/qicon_svg/tst_qicon_svg.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/auto/qicon_svg/tst_qicon_svg.cpp b/tests/auto/qicon_svg/tst_qicon_svg.cpp index 2271f21..170ec37 100644 --- a/tests/auto/qicon_svg/tst_qicon_svg.cpp +++ b/tests/auto/qicon_svg/tst_qicon_svg.cpp @@ -43,6 +43,8 @@ private slots: void svgActualSize(); void svg(); void availableSizes(); + void isNull(); + private: QString prefix; @@ -139,5 +141,26 @@ void tst_QIcon_Svg::availableSizes() } } +void tst_QIcon_Svg::isNull() +{ + { + //checks that an invalid file results in the icon being null + QIcon icon(prefix + "nonExistentFile.svg"); + QVERIFY(icon.isNull()); + } + { + //valid svg, we're not null + QIcon icon(prefix + "heart.svg"); + QVERIFY(!icon.isNull()); + } + { + //invalid svg, but a pixmap added means we're not null + QIcon icon(prefix + "nonExistentFile.svg"); + icon.addFile(prefix + "image.png", QSize(32,32)); + QVERIFY(!icon.isNull()); + } + +} + QTEST_MAIN(tst_QIcon_Svg) #include "tst_qicon_svg.moc" |