diff options
author | Thiago Macieira <thiago.macieira@nokia.com> | 2010-05-14 16:38:14 (GMT) |
---|---|---|
committer | Thiago Macieira <thiago.macieira@nokia.com> | 2010-05-20 14:41:09 (GMT) |
commit | 58fc06e9fe538eb824a3ffef74137628e1742608 (patch) | |
tree | df483a1c825c0d8e1a2054d23a0c00f2f967735f /tests/auto/qurl | |
parent | e4dc3567af533df2e57425952c4609726515d2cd (diff) | |
download | Qt-58fc06e9fe538eb824a3ffef74137628e1742608.zip Qt-58fc06e9fe538eb824a3ffef74137628e1742608.tar.gz Qt-58fc06e9fe538eb824a3ffef74137628e1742608.tar.bz2 |
Revert "Revert "Improve QUrl handling of local file paths""
This reverts commit 98e935eed5549e479f6666680aed1711dc42111c.
Diffstat (limited to 'tests/auto/qurl')
-rw-r--r-- | tests/auto/qurl/tst_qurl.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/tests/auto/qurl/tst_qurl.cpp b/tests/auto/qurl/tst_qurl.cpp index 820e32d..d055b6b 100644 --- a/tests/auto/qurl/tst_qurl.cpp +++ b/tests/auto/qurl/tst_qurl.cpp @@ -314,6 +314,7 @@ void tst_QUrl::constructing() QUrl buildUNC; + buildUNC.setScheme(QString::fromLatin1("file")); buildUNC.setHost(QString::fromLatin1("somehost")); buildUNC.setPath(QString::fromLatin1("somepath")); QCOMPARE(buildUNC.toLocalFile(), QString::fromLatin1("//somehost/somepath")); @@ -1757,7 +1758,15 @@ void tst_QUrl::toLocalFile_data() QTest::newRow("data7") << QString::fromLatin1("file://somehost/") << QString::fromLatin1("//somehost/"); QTest::newRow("data8") << QString::fromLatin1("file://somehost") << QString::fromLatin1("//somehost"); QTest::newRow("data9") << QString::fromLatin1("file:////somehost/somedir/somefile") << QString::fromLatin1("//somehost/somedir/somefile"); - + QTest::newRow("data10") << QString::fromLatin1("FILE:/a.txt") << QString::fromLatin1("/a.txt"); + + // and some that result in empty (i.e., not local) + QTest::newRow("xdata0") << QString::fromLatin1("/a.txt") << QString(); + QTest::newRow("xdata1") << QString::fromLatin1("//a.txt") << QString(); + QTest::newRow("xdata2") << QString::fromLatin1("///a.txt") << QString(); + QTest::newRow("xdata3") << QString::fromLatin1("foo:/a.txt") << QString(); + QTest::newRow("xdata4") << QString::fromLatin1("foo://a.txt") << QString(); + QTest::newRow("xdata5") << QString::fromLatin1("foo:///a.txt") << QString(); } void tst_QUrl::toLocalFile() |