summaryrefslogtreecommitdiff
path: root/tests/auto/qxmlquery/tst_qxmlquery.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qxmlquery/tst_qxmlquery.cpp')
-rw-r--r--tests/auto/qxmlquery/tst_qxmlquery.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/auto/qxmlquery/tst_qxmlquery.cpp b/tests/auto/qxmlquery/tst_qxmlquery.cpp
index 27f3964..372bcdb 100644
--- a/tests/auto/qxmlquery/tst_qxmlquery.cpp
+++ b/tests/auto/qxmlquery/tst_qxmlquery.cpp
@@ -2875,7 +2875,15 @@ void tst_QXmlQuery::useUriResolver() const
const QUrl &baseURI) const
{
Q_UNUSED(relative);
- return baseURI.resolved(inputFile(QLatin1String(queriesDirectory) + QLatin1String("simpleDocument.xml")));
+ QString fixedInputFile = inputFile(QLatin1String(queriesDirectory) + QLatin1String("simpleDocument.xml"));
+#ifdef Q_OS_WIN
+ // A file path with drive letter is not a valid relative URI, so remove the drive letter.
+ // Note that can't just use inputFileAsURI() instead of inputFile() as that doesn't
+ // produce a relative URI either.
+ if (fixedInputFile.size() > 1 && fixedInputFile.at(1) == QLatin1Char(':'))
+ fixedInputFile.remove(0, 2);
+#endif
+ return baseURI.resolved(fixedInputFile);
}
};