diff options
author | David Boddie <david.boddie@nokia.com> | 2011-06-09 11:55:14 (GMT) |
---|---|---|
committer | David Boddie <david.boddie@nokia.com> | 2011-06-09 11:55:14 (GMT) |
commit | fc2a790e96be47b4da3e308c5e0272e4840a2618 (patch) | |
tree | 4c1cd7998777252463a060d4ce73f284441d7c22 /tests/auto/qurl/tst_qurl.cpp | |
parent | 7b4e52045d17bcc4b3bb1e0973c3af2e48381c5e (diff) | |
parent | 3916feefc5ebadba3320029a29ecf02d8934e879 (diff) | |
download | Qt-fc2a790e96be47b4da3e308c5e0272e4840a2618.zip Qt-fc2a790e96be47b4da3e308c5e0272e4840a2618.tar.gz Qt-fc2a790e96be47b4da3e308c5e0272e4840a2618.tar.bz2 |
Merge branch '4.8' of scm.dev.nokia.troll.no:qt/qt into 4.8
Conflicts:
doc/src/declarative/righttoleft.qdoc
examples/draganddrop/fridgemagnets/main.cpp
examples/script/context2d/main.cpp
Diffstat (limited to 'tests/auto/qurl/tst_qurl.cpp')
-rw-r--r-- | tests/auto/qurl/tst_qurl.cpp | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/tests/auto/qurl/tst_qurl.cpp b/tests/auto/qurl/tst_qurl.cpp index 613053b..b78679b 100644 --- a/tests/auto/qurl/tst_qurl.cpp +++ b/tests/auto/qurl/tst_qurl.cpp @@ -49,6 +49,7 @@ #include <qurl.h> #include <qtextcodec.h> #include <qmap.h> +#include "private/qtldurl_p.h" // For testsuites #define IDNA_ACE_PREFIX "xn--" @@ -88,6 +89,8 @@ public slots: void init(); void cleanup(); private slots: + void effectiveTLDs_data(); + void effectiveTLDs(); void getSetCheck(); void constructing(); void assignment(); @@ -3167,8 +3170,8 @@ void tst_QUrl::nameprep_testsuite_data() #ifdef QT_BUILD_INTERNAL QT_BEGIN_NAMESPACE -extern void qt_nameprep(QString *source, int from); -extern bool qt_check_std3rules(const QChar *, int); +Q_CORE_EXPORT extern void qt_nameprep(QString *source, int from); +Q_CORE_EXPORT extern bool qt_check_std3rules(const QChar *, int); QT_END_NAMESPACE #endif @@ -4005,5 +4008,28 @@ void tst_QUrl::taskQTBUG_8701() QCOMPARE(foo_uni_bar, QUrl(foo_uni_bar, QUrl::StrictMode).toString()); } +void tst_QUrl::effectiveTLDs_data() +{ + QTest::addColumn<QUrl>("domain"); + QTest::addColumn<QString>("TLD"); + + QTest::newRow("yes0") << QUrl::fromEncoded("http://test.co.uk") << ".co.uk"; + QTest::newRow("yes1") << QUrl::fromEncoded("http://test.com") << ".com"; + QTest::newRow("yes2") << QUrl::fromEncoded("http://www.test.de") << ".de"; + QTest::newRow("yes3") << QUrl::fromEncoded("http://test.ulm.museum") << ".ulm.museum"; + QTest::newRow("yes4") << QUrl::fromEncoded("http://www.com.krodsherad.no") << ".krodsherad.no"; + QTest::newRow("yes5") << QUrl::fromEncoded("http://www.co.uk.1.bg") << ".1.bg"; + 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"; +} + +void tst_QUrl::effectiveTLDs() +{ + QFETCH(QUrl, domain); + QFETCH(QString, TLD); + QCOMPARE(domain.topLevelDomain(), TLD); +} + QTEST_MAIN(tst_QUrl) #include "tst_qurl.moc" |