summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qdeclarativemoduleplugin/tst_qdeclarativemoduleplugin.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/declarative/qdeclarativemoduleplugin/tst_qdeclarativemoduleplugin.cpp')
-rw-r--r--tests/auto/declarative/qdeclarativemoduleplugin/tst_qdeclarativemoduleplugin.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/tst_qdeclarativemoduleplugin.cpp b/tests/auto/declarative/qdeclarativemoduleplugin/tst_qdeclarativemoduleplugin.cpp
index e1022e0..51f66a5 100644
--- a/tests/auto/declarative/qdeclarativemoduleplugin/tst_qdeclarativemoduleplugin.cpp
+++ b/tests/auto/declarative/qdeclarativemoduleplugin/tst_qdeclarativemoduleplugin.cpp
@@ -54,6 +54,7 @@ public:
private slots:
void importsPlugin();
+ void incorrectPluginCase();
};
#ifdef Q_OS_SYMBIAN
@@ -120,6 +121,30 @@ void tst_qdeclarativemoduleplugin::importsPlugin()
delete object;
}
+void tst_qdeclarativemoduleplugin::incorrectPluginCase()
+{
+ QDeclarativeEngine engine;
+ engine.addImportPath(QLatin1String(SRCDIR) + QDir::separator() + QLatin1String("imports"));
+
+ QDeclarativeComponent component(&engine, TEST_FILE("data/incorrectCase.qml"));
+
+ QList<QDeclarativeError> errors = component.errors();
+ QCOMPARE(errors.count(), 1);
+
+#if defined(Q_OS_MAC) || defined(Q_OS_WIN)
+#if defined(Q_OS_MAC)
+ QString libname = "libPluGin.dylib";
+#elif defined(Q_OS_WIN)
+ QString libname = "PluGin.dll";
+#endif
+ QString expectedError = QLatin1String("plugin cannot be loaded for module \"com.nokia.WrongCase\": File name case mismatch for \"") + QFileInfo(__FILE__).absoluteDir().filePath("imports/com/nokia/WrongCase/" + libname) + QLatin1String("\"");
+#else
+ QString expectedError = QLatin1String("module \"com.nokia.WrongCase\" plugin \"PluGin\" not found");
+#endif
+
+ QCOMPARE(errors.at(0).description(), expectedError);
+}
+
QTEST_MAIN(tst_qdeclarativemoduleplugin)
#include "tst_qdeclarativemoduleplugin.moc"