summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorKarsten Heimrich <karsten.heimrich@qt.io>2021-05-18 23:14:25 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-05-19 22:05:07 +0000
commitad6870a855a6d10ca2cc937f0743754a7c50cda6 (patch)
treee3a3fdf260e301a4aa3b0d12f26c0b8743aae34e /tests
parent115016c1726fbdb1bef8987d439438153ef5fa9f (diff)
Fix QUrl::fromLocalFile with long path prefix
After commit 3966b571 the function was kinda broken already, though this got unnoticed since it was not covered by an the auto-test. This commit adds another test case with Windows native separators and removes the use of QDir::fromNativeSeparators. Instead use the original code from QDir::fromNativeSeparators to replace the backslashes. Change-Id: I190560d0e75cb8c177d63b142aa4be5b01498da2 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 06689a2d7a18882535819ed13ac7248c81330529) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/corelib/io/qurl/tst_qurl.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/auto/corelib/io/qurl/tst_qurl.cpp b/tests/auto/corelib/io/qurl/tst_qurl.cpp
index 835dd1e573..dae137cf10 100644
--- a/tests/auto/corelib/io/qurl/tst_qurl.cpp
+++ b/tests/auto/corelib/io/qurl/tst_qurl.cpp
@@ -1333,6 +1333,10 @@ void tst_QUrl::fromLocalFile_data()
<< QString(QString("//somehost") + suffix).replace('/', '\\')
<< QString("file://somehost") + suffix
<< QString(suffix);
+ QTest::addRow("windows-backslash-extlen-%s", pathDescription)
+ << QString(QString("//?") + suffix).replace('/', '\\')
+ << QString("file:////%3F") + suffix
+ << QString("//?") + suffix;
#endif
QTest::addRow("windows-extlen-%s", pathDescription)
<< QString("//?") + suffix