summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorDavid Faure <david.faure@kdab.com>2015-02-06 11:51:57 +0100
committerDavid Faure <david.faure@kdab.com>2015-02-24 14:06:45 +0000
commit85712bae5b4ef8f43c697883130f189f20c8b8ea (patch)
treec3b52a75b8e88338b1e730cc7101b75b1e4e713d /tests
parentedd555425a08f9e074f0a4d9333862636ccaae8d (diff)
Autotest: fix existence check after c8c68ec.
The files were moved to a qrc resource, so the string is never empty, we need to use QFile::exists to make sure they exist. And the error message was wrong, pointing to current dir. Change-Id: I532bda9f6221fb5c69b779b8b48baac9ede90eba Reviewed-by: Rainer Keller <rainer.keller@theqtcompany.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp b/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp
index 686e25c800..1513a75148 100644
--- a/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp
+++ b/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp
@@ -109,14 +109,11 @@ void tst_QMimeDatabase::initTestCase()
if (m_testSuite.isEmpty())
qWarning("%s", qPrintable(testSuiteWarning()));
+ const QString errorMessage = QString::fromLatin1("Cannot find '%1'");
m_yastMimeTypes = QLatin1String(RESOURCE_PREFIX) + yastFileName;
- QVERIFY2(!m_yastMimeTypes.isEmpty(),
- qPrintable(QString::fromLatin1("Cannot find '%1' starting from '%2'").
- arg(yastFileName, QDir::currentPath())));
+ QVERIFY2(QFile::exists(m_yastMimeTypes), qPrintable(errorMessage.arg(yastFileName)));
m_qmlAgainFileName = QLatin1String(RESOURCE_PREFIX) + qmlAgainFileName;
- QVERIFY2(!m_qmlAgainFileName.isEmpty(),
- qPrintable(QString::fromLatin1("Cannot find '%1' starting from '%2'").
- arg(qmlAgainFileName, QDir::currentPath())));
+ QVERIFY2(QFile::exists(m_qmlAgainFileName), qPrintable(errorMessage.arg(qmlAgainFileName)));
init();
}