Fixed qicon unittest to use QFINDTESTDATA
authorKurt Korbatits <kurt.korbatits@nokia.com>
Thu, 26 Jan 2012 23:33:33 +0000 (09:33 +1000)
committerQt by Nokia <qt-info@nokia.com>
Tue, 31 Jan 2012 03:23:29 +0000 (04:23 +0100)
- Two cases of image.png not being found when run from install directory

Change-Id: I5f20b7a0ea0b120ce06c556b83bc20dd658a4f83
Reviewed-by: Kurt Korbatits <kurt.korbatits@nokia.com>
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
tests/auto/gui/image/qicon/tst_qicon.cpp

index 9cf07d8..c391ced 100644 (file)
@@ -385,7 +385,7 @@ void tst_QIcon::detach()
     img.fill(0xffff0000);
     QIcon icon1(QPixmap::fromImage(img));
     QIcon icon2 = icon1;
-    icon2.addFile("image.png", QSize(64, 64));
+    icon2.addFile(QFINDTESTDATA("image.png"), QSize(64, 64));
 
     QImage img1 = icon1.pixmap(64, 64).toImage();
     QImage img2 = icon2.pixmap(64, 64).toImage();
@@ -627,7 +627,7 @@ static inline bool operator<(const QSize &lhs, const QSize &rhs)
 
 void tst_QIcon::task184901_badCache()
 {
-    QPixmap pm("image.png");
+    QPixmap pm(QFINDTESTDATA("image.png"));
     QIcon icon(pm);
 
     //the disabled icon must have an effect (grayed)