summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/tools
diff options
context:
space:
mode:
authorKurt Korbatits <kurt.korbatits@nokia.com>2012-02-15 14:30:16 +1000
committerQt by Nokia <qt-info@nokia.com>2012-02-17 05:24:37 +0100
commit857775f701cf3e1418e9cdc123a67ed3dde1c439 (patch)
tree7e7b46c46f9c324de03faf0f506b4313ca5fd828 /tests/auto/corelib/tools
parent32060c2115308e2e480a5b1787dbb2ebb1ed7936 (diff)
Changed qcryptographichash unittest to work from installation directory
- Changed qcryptographichash to use TESTDATA and QFINDTESTDATA Change-Id: Ic3a1bdccc9f81605c648dab2a642421d17f7fe80 Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com> Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Diffstat (limited to 'tests/auto/corelib/tools')
-rw-r--r--tests/auto/corelib/tools/qcryptographichash/qcryptographichash.pro12
-rw-r--r--tests/auto/corelib/tools/qcryptographichash/tst_qcryptographichash.cpp4
2 files changed, 4 insertions, 12 deletions
diff --git a/tests/auto/corelib/tools/qcryptographichash/qcryptographichash.pro b/tests/auto/corelib/tools/qcryptographichash/qcryptographichash.pro
index fddd67fbd6..1c4b74e16d 100644
--- a/tests/auto/corelib/tools/qcryptographichash/qcryptographichash.pro
+++ b/tests/auto/corelib/tools/qcryptographichash/qcryptographichash.pro
@@ -3,14 +3,4 @@ TARGET = tst_qcryptographichash
QT = core testlib
SOURCES = tst_qcryptographichash.cpp
-
-wince* {
- addFiles.files = data/*
- addFiles.path = data/
- DEPLOYMENT += addFiles
-
- DEFINES += SRCDIR=\\\".\\\"
-}
-else {
- DEFINES += SRCDIR=\\\"$$PWD/\\\"
-} \ No newline at end of file
+TESTDATA += data/*
diff --git a/tests/auto/corelib/tools/qcryptographichash/tst_qcryptographichash.cpp b/tests/auto/corelib/tools/qcryptographichash/tst_qcryptographichash.cpp
index 0f35089ff7..81cc66f045 100644
--- a/tests/auto/corelib/tools/qcryptographichash/tst_qcryptographichash.cpp
+++ b/tests/auto/corelib/tools/qcryptographichash/tst_qcryptographichash.cpp
@@ -169,7 +169,9 @@ void tst_QCryptographicHash::files()
QFETCH(QCryptographicHash::Algorithm, algorithm);
QFETCH(QByteArray, md5sum);
{
- QFile f(QString::fromLocal8Bit(SRCDIR) + filename);
+ QString testData = QFINDTESTDATA(filename);
+ QVERIFY2(!testData.isEmpty(), qPrintable(QString("Cannot find test data: %1").arg(filename)));
+ QFile f(testData);
QCryptographicHash hash(algorithm);
QVERIFY(! hash.addData(&f)); // file is not open for reading;
if (f.open(QIODevice::ReadOnly)) {