Changed qimage unittest to work from installation.
authorKurt Korbatits <kurt.korbatits@nokia.com>
Mon, 16 Jan 2012 04:00:48 +0000 (14:00 +1000)
committerQt by Nokia <qt-info@nokia.com>
Tue, 17 Jan 2012 03:54:07 +0000 (04:54 +0100)
- Changed to use QFINDTESTDATA and TESTDATA

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

index afa279f..d9252f0 100644 (file)
@@ -4,11 +4,4 @@ SOURCES  += tst_qimage.cpp
 
 QT += core-private gui-private testlib
 
-wince*: {
-   addImages.files = images/*
-   addImages.path = images
-   DEPLOYMENT += addImages
-   DEFINES += SRCDIR=\\\".\\\"
-} else {
-   DEFINES += SRCDIR=\\\"$$PWD\\\"
-}
+TESTDATA += images/*
index 479acea..e510252 100644 (file)
@@ -261,7 +261,10 @@ void tst_QImage::formatHandlersInput_data()
 {
     QTest::addColumn<QString>("testFormat");
     QTest::addColumn<QString>("testFile");
-    const QString prefix = QLatin1String(SRCDIR) + "/images/";
+
+    const QString prefix = QFINDTESTDATA("images/");
+    if (prefix.isEmpty())
+        QFAIL("can not find images directory!");
 
     // add a new line here when a file is added
     QTest::newRow("ICO") << "ICO" << prefix + "image.ico";