summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/io/qdir/tst_qdir.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/corelib/io/qdir/tst_qdir.cpp')
-rw-r--r--tests/auto/corelib/io/qdir/tst_qdir.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/auto/corelib/io/qdir/tst_qdir.cpp b/tests/auto/corelib/io/qdir/tst_qdir.cpp
index cec01eb752..d43e45e12f 100644
--- a/tests/auto/corelib/io/qdir/tst_qdir.cpp
+++ b/tests/auto/corelib/io/qdir/tst_qdir.cpp
@@ -1268,9 +1268,20 @@ tst_QDir::cleanPath_data()
QTest::newRow("drive-above-root") << "A:/.." << "A:/..";
QTest::newRow("unc-server-up") << "//server/path/.." << "//server";
QTest::newRow("unc-server-above-root") << "//server/.." << "//server/..";
+
QTest::newRow("longpath") << "\\\\?\\d:\\" << "d:/";
+ QTest::newRow("longpath-slash") << "//?/d:/" << "d:/";
+ QTest::newRow("longpath-mixed-slashes") << "//?/d:\\" << "d:/";
+ QTest::newRow("longpath-mixed-slashes-2") << "\\\\?\\d:/" << "d:/";
+
QTest::newRow("unc-network-share") << "\\\\?\\UNC\\localhost\\c$\\tmp.txt"
<< "//localhost/c$/tmp.txt";
+ QTest::newRow("unc-network-share-slash") << "//?/UNC/localhost/c$/tmp.txt"
+ << "//localhost/c$/tmp.txt";
+ QTest::newRow("unc-network-share-mixed-slashes") << "//?/UNC/localhost\\c$\\tmp.txt"
+ << "//localhost/c$/tmp.txt";
+ QTest::newRow("unc-network-share-mixed-slashes-2") << "\\\\?\\UNC\\localhost/c$/tmp.txt"
+ << "//localhost/c$/tmp.txt";
#else
QTest::newRow("data15") << "//c:/foo" << "/c:/foo";
#endif // non-windows
@@ -1748,6 +1759,8 @@ void tst_QDir::nativeSeparators()
QCOMPARE(QDir::fromNativeSeparators(QLatin1String("\\\\?\\C:\\")), QString("C:/"));
QCOMPARE(QDir::fromNativeSeparators(QLatin1String(R"(\\?\UNC\localhost\c$\tmp.txt)")),
QString("//localhost/c$/tmp.txt"));
+ QCOMPARE(QDir::fromNativeSeparators(QLatin1String(R"(//?/UNC/localhost\c$\tmp.txt)")),
+ QString("//localhost/c$/tmp.txt"));
#else
QCOMPARE(QDir::toNativeSeparators(QLatin1String("/")), QString("/"));
QCOMPARE(QDir::toNativeSeparators(QLatin1String("\\")), QString("\\"));