summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/io/qurl/tst_qurl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/corelib/io/qurl/tst_qurl.cpp')
-rw-r--r--tests/auto/corelib/io/qurl/tst_qurl.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/auto/corelib/io/qurl/tst_qurl.cpp b/tests/auto/corelib/io/qurl/tst_qurl.cpp
index 1f59336fc6..cdd631b437 100644
--- a/tests/auto/corelib/io/qurl/tst_qurl.cpp
+++ b/tests/auto/corelib/io/qurl/tst_qurl.cpp
@@ -79,6 +79,8 @@ private slots:
void toString();
void toString_constructed_data();
void toString_constructed();
+ void toAndFromStringList_data();
+ void toAndFromStringList();
void isParentOf_data();
void isParentOf();
void toLocalFile_data();
@@ -948,6 +950,25 @@ void tst_QUrl::toString()
QCOMPARE(url.toString(QUrl::FormattingOptions(options)), string);
}
+void tst_QUrl::toAndFromStringList_data()
+{
+ QTest::addColumn<QStringList>("strings");
+
+ QTest::newRow("empty") << QStringList();
+ QTest::newRow("local") << (QStringList() << "file:///tmp" << "file:///");
+ QTest::newRow("remote") << (QStringList() << "http://qt-project.org");
+}
+
+void tst_QUrl::toAndFromStringList()
+{
+ QFETCH(QStringList, strings);
+
+ const QList<QUrl> urls = QUrl::fromStringList(strings);
+ QCOMPARE(urls.count(), strings.count());
+ const QStringList converted = QUrl::toStringList(urls);
+ QCOMPARE(converted, strings);
+}
+
//### more tests ... what do we expect ...
void tst_QUrl::isParentOf_data()
{
@@ -2796,6 +2817,12 @@ void tst_QUrl::effectiveTLDs_data()
QTest::newRow("yes6") << QUrl::fromEncoded("http://www.com.com.cn") << ".com.cn";
QTest::newRow("yes7") << QUrl::fromEncoded("http://www.test.org.ws") << ".org.ws";
QTest::newRow("yes9") << QUrl::fromEncoded("http://www.com.co.uk.wallonie.museum") << ".wallonie.museum";
+ QTest::newRow("yes10") << QUrl::fromEncoded("http://www.com.evje-og-hornnes.no") << ".evje-og-hornnes.no";
+ QTest::newRow("yes11") << QUrl::fromEncoded("http://www.bla.kamijima.ehime.jp") << ".kamijima.ehime.jp";
+ QTest::newRow("yes12") << QUrl::fromEncoded("http://www.bla.kakuda.miyagi.jp") << ".kakuda.miyagi.jp";
+ QTest::newRow("yes13") << QUrl::fromEncoded("http://mypage.betainabox.com") << ".betainabox.com";
+ QTest::newRow("yes14") << QUrl::fromEncoded("http://mypage.rhcloud.com") << ".rhcloud.com";
+ QTest::newRow("yes15") << QUrl::fromEncoded("http://mypage.int.az") << ".int.az";
}
void tst_QUrl::effectiveTLDs()