diff options
author | Bea Lam <bea.lam@nokia.com> | 2011-02-11 01:33:37 (GMT) |
---|---|---|
committer | Bea Lam <bea.lam@nokia.com> | 2011-02-11 03:08:39 (GMT) |
commit | 33512bc223be373975426ffcc6f8fa783a7582c9 (patch) | |
tree | c92b5b47837e89bcaea472495cf243b21a362c73 /tests/auto/declarative/qdeclarativemoduleplugin | |
parent | 974db3ce58307069fcafdee2c5636ff72b061134 (diff) | |
download | Qt-33512bc223be373975426ffcc6f8fa783a7582c9.zip Qt-33512bc223be373975426ffcc6f8fa783a7582c9.tar.gz Qt-33512bc223be373975426ffcc6f8fa783a7582c9.tar.bz2 |
Make addImportPath() work for windows paths starting with lower case
Was causing assert failure on windows if the 'c:' was lower case,
since it was being added to the import path database with a lower
case and thus later lookups with an upper case 'c:' would fail.
This change fixes the check for whether the path refers to a
local path or not.
Task-number: QTBUG-16885
Change-Id: I0a2a2f705443ed453fb2b13f8599e035c2bd2877
Reviewed-by: Martin Jones
Diffstat (limited to 'tests/auto/declarative/qdeclarativemoduleplugin')
-rw-r--r-- | tests/auto/declarative/qdeclarativemoduleplugin/tst_qdeclarativemoduleplugin.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/tst_qdeclarativemoduleplugin.cpp b/tests/auto/declarative/qdeclarativemoduleplugin/tst_qdeclarativemoduleplugin.cpp index 9ec0f84..8e31fd1 100644 --- a/tests/auto/declarative/qdeclarativemoduleplugin/tst_qdeclarativemoduleplugin.cpp +++ b/tests/auto/declarative/qdeclarativemoduleplugin/tst_qdeclarativemoduleplugin.cpp @@ -191,8 +191,18 @@ void tst_qdeclarativemoduleplugin::incorrectPluginCase() void tst_qdeclarativemoduleplugin::importPluginWithQmlFile() { + QString path = QLatin1String(SRCDIR) + QDir::separator() + QLatin1String("imports"); + + // QTBUG-16885: adding an import path with a lower-case "c:" causes assert failure + // (this only happens if the plugin includes pure QML files) + #ifdef Q_OS_WIN + QVERIFY(path.at(0).isUpper() && path.at(1) == QLatin1Char(':')); + path = path.at(0).toLower() + path.mid(1); + #endif + QDeclarativeEngine engine; - engine.addImportPath(QLatin1String(SRCDIR) + QDir::separator() + QLatin1String("imports")); + engine.addImportPath(path); + QDeclarativeComponent component(&engine, TEST_FILE("data/pluginWithQmlFile.qml")); foreach (QDeclarativeError err, component.errors()) qWarning() << err; |