Commit c6f68e54 authored by Kevin Funk's avatar Kevin Funk

test_path: Fix unit tests

There's a behaviorial change in Qt, starting with
qtbase.git commit f62768d046528636789f901ac79e2cfa1843a7b7 (included in
Qt 5.9.3).

See commit diff for details.

(cherry picked from commit 8eb7bc717d3c96cac806851a7e6e80dfa3006594)
parent ad234814
......@@ -427,8 +427,12 @@ void TestPath::testPathAddData()
QUrl baseUrl = QUrl::fromUserInput(base);
if (QDir::isRelativePath(pathToAdd)) {
baseUrl = resolvedUrl(baseUrl, QUrl(pathToAdd));
} else {
} else if (QDir::isRelativePath(pathToAdd) || baseUrl.path() != QLatin1String("/")) {
// if pathToAdd == /absolute && baseUrl == "/", below call would lead to an invalid QUrl
// with qtbase.git/f62768d046528636789f901ac79e2cfa1843a7b7
baseUrl.setPath(baseUrl.path() + pathToAdd);
} else {
baseUrl.setPath(pathToAdd);
}
baseUrl = baseUrl.adjusted(QUrl::NormalizePathSegments);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment