From 5ef5b8f4192c18c0df79d16f49a687b361d5baf7 Mon Sep 17 00:00:00 2001 From: Kurt Korbatits Date: Tue, 17 Jan 2012 09:36:37 +1000 Subject: [PATCH] Changed qicoimageformat unittest to work from installation directory - Changed to use QFINDTESTDATA and TESTDATA Change-Id: Icbc823d87cdf6fd36a8ef10ade8e4bca7d9b1c3b Reviewed-by: Kurt Korbatits Reviewed-by: Jason McDonald Reviewed-by: Rohan McGovern --- tests/auto/gui/image/qicoimageformat/qicoimageformat.pro | 8 ++------ .../gui/image/qicoimageformat/tst_qicoimageformat.cpp | 6 +++--- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/tests/auto/gui/image/qicoimageformat/qicoimageformat.pro b/tests/auto/gui/image/qicoimageformat/qicoimageformat.pro index 0ad195f629..fc25d7567a 100644 --- a/tests/auto/gui/image/qicoimageformat/qicoimageformat.pro +++ b/tests/auto/gui/image/qicoimageformat/qicoimageformat.pro @@ -4,16 +4,12 @@ SOURCES+= tst_qicoimageformat.cpp QT += testlib wince*: { - DEFINES += SRCDIR=\\\".\\\" - addFiles.files = icons - addFiles.path = . CONFIG(debug, debug|release):{ addPlugins.files = $$QT_BUILD_TREE/plugins/imageformats/qico4d.dll } else { addPlugins.files = $$QT_BUILD_TREE/plugins/imageformats/qico4.dll } addPlugins.path = imageformats - DEPLOYMENT += addFiles addPlugins -} else { - DEFINES += SRCDIR=\\\"$$PWD\\\" + DEPLOYMENT += addPlugins } +TESTDATA += icons/* diff --git a/tests/auto/gui/image/qicoimageformat/tst_qicoimageformat.cpp b/tests/auto/gui/image/qicoimageformat/tst_qicoimageformat.cpp index 40cd9b848a..365b570761 100644 --- a/tests/auto/gui/image/qicoimageformat/tst_qicoimageformat.cpp +++ b/tests/auto/gui/image/qicoimageformat/tst_qicoimageformat.cpp @@ -80,8 +80,6 @@ private: tst_QIcoImageFormat::tst_QIcoImageFormat() { - m_IconPath = QLatin1String(SRCDIR) + "/icons"; - qDebug() << m_IconPath; } tst_QIcoImageFormat::~tst_QIcoImageFormat() @@ -101,7 +99,9 @@ void tst_QIcoImageFormat::cleanup() void tst_QIcoImageFormat::initTestCase() { - + m_IconPath = QFINDTESTDATA("icons"); + if (m_IconPath.isEmpty()) + QFAIL("Cannot find icons directory containing testdata!"); } void tst_QIcoImageFormat::cleanupTestCase()