From 85712bae5b4ef8f43c697883130f189f20c8b8ea Mon Sep 17 00:00:00 2001 From: David Faure Date: Fri, 6 Feb 2015 11:51:57 +0100 Subject: 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 --- tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'tests/auto/corelib/mimetypes') 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(); } -- cgit v1.2.3