summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2013-01-08 12:34:46 -0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-01-28 21:07:41 +0100
commit2a3d690a195607ee640d84aac762153c8096bf5b (patch)
tree28b13892492cd355d2b28334154286a54d2f11dc /tests
parent7bb43454b83ab0f055248b80defe0b985e59ed64 (diff)
Forward-port tests on invalid port numbers from Qt 4
These tests were added to Qt 4 on commit a17fc85b51a6bdcfa33dcff183d2b7efd667fb92 Task-number: QTBUG-28985 Change-Id: I3cf595384f14272197dcfb85943213c8f8ddeba0 Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/corelib/io/qurl/tst_qurl.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/auto/corelib/io/qurl/tst_qurl.cpp b/tests/auto/corelib/io/qurl/tst_qurl.cpp
index 124ccbb456..a76a4c4155 100644
--- a/tests/auto/corelib/io/qurl/tst_qurl.cpp
+++ b/tests/auto/corelib/io/qurl/tst_qurl.cpp
@@ -687,6 +687,13 @@ void tst_QUrl::setUrl()
QCOMPARE(url.encodedPath().constData(), "text/javascript,d5%20=%20'five%5Cu0027s';");
}
+ {
+ // invalid port number
+ QUrl url;
+ url.setEncodedUrl("foo://tel:2147483648");
+ QVERIFY(!url.isValid());
+ }
+
{ //check it calls detach
QUrl u1("http://aaa.com");
QUrl u2 = u1;
@@ -2644,6 +2651,7 @@ void tst_QUrl::fromUserInput_data()
QTest::newRow("trash-0") << "example.org/test?someData=42%&someOtherData=abcde#anchor" << QUrl::fromEncoded("http://example.org/test?someData=42%25&someOtherData=abcde#anchor");
QTest::newRow("other-scheme-0") << "spotify:track:0hO542doVbfGDAGQULMORT" << QUrl("spotify:track:0hO542doVbfGDAGQULMORT");
QTest::newRow("other-scheme-1") << "weirdscheme:80:otherstuff" << QUrl("weirdscheme:80:otherstuff");
+ QTest::newRow("number-path-0") << "tel:2147483648" << QUrl("tel:2147483648");
// FYI: The scheme in the resulting url user
QUrl authUrl("user:pass@domain.com");