summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2010-10-11 08:07:35 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2010-10-11 08:07:35 (GMT)
commit9849d8f5f1c0c3f03d3f83cc51eea2beb3d9cbbc (patch)
treed2858b4e2da4597f740e472789aab07e55cac2e5
parente67800d9e0dc82a38b01c9b8eff4dc1a10f306d8 (diff)
downloadQt-9849d8f5f1c0c3f03d3f83cc51eea2beb3d9cbbc.zip
Qt-9849d8f5f1c0c3f03d3f83cc51eea2beb3d9cbbc.tar.gz
Qt-9849d8f5f1c0c3f03d3f83cc51eea2beb3d9cbbc.tar.bz2
Fix autotest on windows
-rw-r--r--src/declarative/qml/qdeclarativeengine.cpp12
-rw-r--r--tests/auto/declarative/qdeclarativemoduleplugin/tst_qdeclarativemoduleplugin.cpp7
2 files changed, 18 insertions, 1 deletions
diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp
index 7ed925a..d768882 100644
--- a/src/declarative/qml/qdeclarativeengine.cpp
+++ b/src/declarative/qml/qdeclarativeengine.cpp
@@ -2196,7 +2196,19 @@ bool QDeclarative_isFileCaseCorrect(const QString &fileName)
QFileInfo info(fileName);
QString absolute = info.absoluteFilePath();
+
+#if defined(Q_OS_MAC)
QString canonical = info.canonicalFilePath();
+#elif defined(Q_OS_WIN)
+ wchar_t buffer[1024];
+
+ DWORD rv = ::GetShortPathName((wchar_t*)absolute.utf16(), buffer, 1024);
+ if (rv == 0 || rv >= 1024) return true;
+ rv = ::GetLongPathName(buffer, buffer, 1024);
+ if (rv == 0 || rv >= 1024) return true;
+
+ QString canonical((QChar *)buffer);
+#endif
int absoluteLength = absolute.length();
int canonicalLength = canonical.length();
diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/tst_qdeclarativemoduleplugin.cpp b/tests/auto/declarative/qdeclarativemoduleplugin/tst_qdeclarativemoduleplugin.cpp
index 587a86a..51f66a5 100644
--- a/tests/auto/declarative/qdeclarativemoduleplugin/tst_qdeclarativemoduleplugin.cpp
+++ b/tests/auto/declarative/qdeclarativemoduleplugin/tst_qdeclarativemoduleplugin.cpp
@@ -132,7 +132,12 @@ void tst_qdeclarativemoduleplugin::incorrectPluginCase()
QCOMPARE(errors.count(), 1);
#if defined(Q_OS_MAC) || defined(Q_OS_WIN)
- 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/libPluGin.dylib") + QLatin1String("\"");
+#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