summaryrefslogtreecommitdiffstats
path: root/tests/auto/qurl/tst_qurl.cpp
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-05-18 03:43:35 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-05-18 03:43:35 (GMT)
commit19bf1fec0ec3341fae97e27d3cb0baf8fb27b9f3 (patch)
tree16d04a9a1d3f87f6e42d94c8ea85875dfa2b5809 /tests/auto/qurl/tst_qurl.cpp
parent379b4dc81177b95c15de30c5925efca1136e4041 (diff)
parent91a1f7a1c408052b1d284d6b901819964e338fe5 (diff)
downloadQt-19bf1fec0ec3341fae97e27d3cb0baf8fb27b9f3.zip
Qt-19bf1fec0ec3341fae97e27d3cb0baf8fb27b9f3.tar.gz
Qt-19bf1fec0ec3341fae97e27d3cb0baf8fb27b9f3.tar.bz2
Merge branch 'qt-4.7-from-4.6' of scm.dev.nokia.troll.no:qt/qt-integration into 4.7-integration
* 'qt-4.7-from-4.6' of scm.dev.nokia.troll.no:qt/qt-integration: (69 commits) re-add overriding of tool paths to configure fix regexp Support linked fonts (.ltt) from standard font locations. fix path separators in install targets for MinGW+sh fix QMAKE_QMAKE path separator under mingw+sh in the qmake spec define qtPrepareTool() function and use it throughout QS60Style: In S60 3.x and 5.0 Qt itemviews behaviour is not nativelike QNAM HTTP: And one more testcase QNetworkAccessManager: Backends were tried in wrong order Fix QUrl::isValid if the host contains invalid caracter. Fix anomaly demo control strip icon placement QUrl: parsing of host name with an undercore. Fixed race condition compiling xmlpatterns tests. Remove qdbusserver from tests/auto/dbus.pro QNAM HTTP: Preemptive anti crash if() statement QNAM HTTP: More testcases Fixing compiling issues. Remove garbage test. OpenVG blending modes from VG_KHR_advanced_blending extension Fix spurious mouse click when dismissing a native menu ...
Diffstat (limited to 'tests/auto/qurl/tst_qurl.cpp')
-rw-r--r--tests/auto/qurl/tst_qurl.cpp53
1 files changed, 46 insertions, 7 deletions
diff --git a/tests/auto/qurl/tst_qurl.cpp b/tests/auto/qurl/tst_qurl.cpp
index fa42adc..820e32d 100644
--- a/tests/auto/qurl/tst_qurl.cpp
+++ b/tests/auto/qurl/tst_qurl.cpp
@@ -1410,7 +1410,7 @@ void tst_QUrl::setUrl()
void tst_QUrl::i18n_data()
{
QTest::addColumn<QString>("input");
- QTest::addColumn<QByteArray>("punyOutput");
+ QTest::addColumn<QByteArray>("punyOutput");
QTest::newRow("øl") << QString::fromLatin1("http://ole:passord@www.øl.no/index.html?ole=æsemann&ilder gud=hei#top")
<< QByteArray("http://ole:passord@www.xn--l-4ga.no/index.html?ole=%C3%A6semann&ilder%20gud=hei#top");
@@ -2165,25 +2165,25 @@ void tst_QUrl::toPercentEncoding_data()
QTest::addColumn<QByteArray>("includeInEncoding");
QTest::newRow("test_01") << QString::fromLatin1("abcdevghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012345678-._~")
- << QByteArray("abcdevghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012345678-._~")
+ << QByteArray("abcdevghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012345678-._~")
<< QByteArray("")
<< QByteArray("");
QTest::newRow("test_02") << QString::fromLatin1("{\t\n\r^\"abc}")
- << QByteArray("%7B%09%0A%0D%5E%22abc%7D")
+ << QByteArray("%7B%09%0A%0D%5E%22abc%7D")
<< QByteArray("")
<< QByteArray("");
QTest::newRow("test_03") << QString::fromLatin1("://?#[]@!$&'()*+,;=")
- << QByteArray("%3A%2F%2F%3F%23%5B%5D%40%21%24%26%27%28%29%2A%2B%2C%3B%3D")
+ << QByteArray("%3A%2F%2F%3F%23%5B%5D%40%21%24%26%27%28%29%2A%2B%2C%3B%3D")
<< QByteArray("")
<< QByteArray("");
QTest::newRow("test_04") << QString::fromLatin1("://?#[]@!$&'()*+,;=")
- << QByteArray("%3A%2F%2F%3F%23%5B%5D%40!$&'()*+,;=")
+ << QByteArray("%3A%2F%2F%3F%23%5B%5D%40!$&'()*+,;=")
<< QByteArray("!$&'()*+,;=")
<< QByteArray("");
QTest::newRow("test_05") << QString::fromLatin1("abcd")
<< QByteArray("a%62%63d")
<< QByteArray("")
- << QByteArray("bc");
+ << QByteArray("bc");
}
void tst_QUrl::toPercentEncoding()
@@ -2193,7 +2193,7 @@ void tst_QUrl::toPercentEncoding()
QFETCH(QByteArray, excludeInEncoding);
QFETCH(QByteArray, includeInEncoding);
- QByteArray encodedUrl = QUrl::toPercentEncoding(original, excludeInEncoding, includeInEncoding);
+ QByteArray encodedUrl = QUrl::toPercentEncoding(original, excludeInEncoding, includeInEncoding);
QCOMPARE(encodedUrl.constData(), encoded.constData());
QCOMPARE(original, QUrl::fromPercentEncoding(encodedUrl));
}
@@ -2461,6 +2461,8 @@ void tst_QUrl::isValid()
QUrl url = QUrl::fromEncoded("http://strange<username>@ok-hostname/", QUrl::StrictMode);
QVERIFY(!url.isValid());
// < and > are not allowed in userinfo in strict mode
+ url.setUserName("normal_username");
+ QVERIFY(url.isValid());
}
{
QUrl url = QUrl::fromEncoded("http://strange<username>@ok-hostname/");
@@ -2471,7 +2473,18 @@ void tst_QUrl::isValid()
QUrl url = QUrl::fromEncoded("http://strange;hostname/here");
QVERIFY(!url.isValid());
QCOMPARE(url.path(), QString("/here"));
+ url.setAuthority("foobar@bar");
+ QVERIFY(url.isValid());
}
+
+ {
+ QUrl url = QUrl::fromEncoded("foo://stuff;1/g");
+ QVERIFY(!url.isValid());
+ QCOMPARE(url.path(), QString("/g"));
+ url.setHost("stuff-1");
+ QVERIFY(url.isValid());
+ }
+
}
void tst_QUrl::schemeValidator_data()
@@ -3194,6 +3207,32 @@ void tst_QUrl::ace_testsuite_data()
QTest::newRow("separator-3002") << QString::fromUtf8("example\343\200\202com")
<< "example.com" << "." << "example.com";
+
+ QString egyptianIDN =
+ QString::fromUtf8("\331\210\330\262\330\247\330\261\330\251\055\330\247\331\204\330"
+ "\243\330\252\330\265\330\247\331\204\330\247\330\252.\331\205"
+ "\330\265\330\261");
+ QTest::newRow("egyptian-tld-ace")
+ << "xn----rmckbbajlc6dj7bxne2c.xn--wgbh1c"
+ << "xn----rmckbbajlc6dj7bxne2c.xn--wgbh1c"
+ << "."
+ << egyptianIDN;
+ QTest::newRow("egyptian-tld-unicode")
+ << egyptianIDN
+ << "xn----rmckbbajlc6dj7bxne2c.xn--wgbh1c"
+ << "."
+ << egyptianIDN;
+ QTest::newRow("egyptian-tld-mix1")
+ << QString::fromUtf8("\331\210\330\262\330\247\330\261\330\251\055\330\247\331\204\330"
+ "\243\330\252\330\265\330\247\331\204\330\247\330\252.xn--wgbh1c")
+ << "xn----rmckbbajlc6dj7bxne2c.xn--wgbh1c"
+ << "."
+ << egyptianIDN;
+ QTest::newRow("egyptian-tld-mix2")
+ << QString::fromUtf8("xn----rmckbbajlc6dj7bxne2c.\331\205\330\265\330\261")
+ << "xn----rmckbbajlc6dj7bxne2c.xn--wgbh1c"
+ << "."
+ << egyptianIDN;
}
void tst_QUrl::ace_testsuite()