summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@digia.com>2013-10-15 10:09:46 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-11-01 09:13:32 +0100
commit960afee2cf5041d873f596e91eeafb42d3144e98 (patch)
treedfa7de1278dfb53bae38bde91a455ef0d694f59c
parentc282e56d3250a32b4458c892f0dbb3159f079028 (diff)
tests: fix tst_qdeclarativemoduleplugin::incorrectPluginCase()
It gives different error message based on the case sensitivity of the file system on Mac. Task-number: QTBUG-32646 Change-Id: I8b5986a4bc8886924e678692c6679e571a11dd33 Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com>
-rw-r--r--tests/auto/declarative/qdeclarativemoduleplugin/tst_qdeclarativemoduleplugin.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/tst_qdeclarativemoduleplugin.cpp b/tests/auto/declarative/qdeclarativemoduleplugin/tst_qdeclarativemoduleplugin.cpp
index e1664739..8c1cd6af 100644
--- a/tests/auto/declarative/qdeclarativemoduleplugin/tst_qdeclarativemoduleplugin.cpp
+++ b/tests/auto/declarative/qdeclarativemoduleplugin/tst_qdeclarativemoduleplugin.cpp
@@ -167,15 +167,19 @@ void tst_qdeclarativemoduleplugin::incorrectPluginCase()
QList<QDeclarativeError> errors = component.errors();
QCOMPARE(errors.count(), 1);
+ QString expectedError = QLatin1String("module \"org.qtproject.WrongCase\" plugin \"PluGin\" not found");
+
#if defined(Q_OS_MAC) || defined(Q_OS_WIN32)
+ bool caseSensitive = true;
#if defined(Q_OS_MAC)
+ caseSensitive = pathconf(QDir::currentPath().toLatin1().constData(), _PC_CASE_SENSITIVE);
QString libname = "libPluGin.dylib";
#elif defined(Q_OS_WIN32)
+ caseSensitive = false;
QString libname = "PluGin.dll";
#endif
- QString expectedError = QLatin1String("plugin cannot be loaded for module \"org.qtproject.WrongCase\": File name case mismatch for \"") + QFileInfo(__FILE__).absoluteDir().filePath("imports/org/qtproject/WrongCase/" + libname) + QLatin1String("\"");
-#else
- QString expectedError = QLatin1String("module \"org.qtproject.WrongCase\" plugin \"PluGin\" not found");
+ if (!caseSensitive)
+ expectedError = QLatin1String("plugin cannot be loaded for module \"org.qtproject.WrongCase\": File name case mismatch for \"") + QDir(importsDirectory()).filePath("org/qtproject/WrongCase/" + libname) + QLatin1String("\"");
#endif
QCOMPARE(errors.at(0).description(), expectedError);