diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2013-07-03 16:47:30 -0700 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-08-04 04:48:05 +0200 |
commit | 1fa5ea7a6a0719f4c52ac9ba3e61fc8ad0cd10bf (patch) | |
tree | 6f87d487aadbd93489803f932f7d5f9ddf1a1232 /tests/auto/corelib/io/qurl | |
parent | 6aa15690ffba0772ffeebf3d5199d94fa0d72bff (diff) |
Remove fully-decoded QUrl user info and authority sections
Those sections contain more than one components of a URL, separated by
delimiters. For that reason, QUrl::FullyDecoded and QUrl::DecodedMode do
not make sense, since they would cause the returned value to be
ambiguous and/or fail to parse again.
In fact, there was a comment in the test saying "look how it becomes
ambiguous".
Those modes are already forbidden in the setters and getters of the full
URL (setUrl(), url(), toString() and toEncoded()).
[ChangeLog][Important Behavior Changes][QUrl and QUrlQuery] QUrl no
longer supports QUrl::FullyDecoded mode in authority() and userInfo(),
nor QUrl::DecodedMode in setAuthority() and setUserInfo().
Change-Id: I538f7981a9f5a09f07d3879d31ccf6f0c8bfd940
Reviewed-by: David Faure (KDE) <faure@kde.org>
Diffstat (limited to 'tests/auto/corelib/io/qurl')
-rw-r--r-- | tests/auto/corelib/io/qurl/tst_qurl.cpp | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/tests/auto/corelib/io/qurl/tst_qurl.cpp b/tests/auto/corelib/io/qurl/tst_qurl.cpp index a55f87b20f..f2e4682418 100644 --- a/tests/auto/corelib/io/qurl/tst_qurl.cpp +++ b/tests/auto/corelib/io/qurl/tst_qurl.cpp @@ -3503,9 +3503,6 @@ void tst_QUrl::setComponents_data() QTest::newRow("invalid-scheme-encode") << QUrl("http://example.com") << int(Scheme) << "http%61" << Decoded << false << PrettyDecoded << "" << ""; - QTest::newRow("userinfo-encode") << QUrl("http://example.com") - << int(UserInfo) << "h%61llo:world@" << Decoded << true - << PrettyDecoded << "h%2561llo:world@" << "http://h%2561llo:world%40@example.com"; QTest::newRow("username-encode") << QUrl("http://example.com") << int(UserName) << "h%61llo:world" << Decoded << true << PrettyDecoded << "h%2561llo:world" << "http://h%2561llo%3Aworld@example.com"; @@ -3516,9 +3513,6 @@ void tst_QUrl::setComponents_data() QTest::newRow("invalid-host-encode") << QUrl("http://example.com") << int(Host) << "ex%61mple.com" << Decoded << false << PrettyDecoded << "" << ""; - QTest::newRow("invalid-authority-encode") << QUrl("http://example.com") - << int(Authority) << "ex%61mple.com" << Decoded << false - << PrettyDecoded << "" << ""; QTest::newRow("path-encode") << QUrl("http://example.com/foo") << int(Path) << "/bar%23" << Decoded << true << PrettyDecoded << "/bar%2523" << "http://example.com/bar%2523"; @@ -3528,11 +3522,7 @@ void tst_QUrl::setComponents_data() QTest::newRow("fragment-encode") << QUrl("http://example.com/foo#z") << int(Fragment) << "bar%23" << Decoded << true << PrettyDecoded << "bar%2523" << "http://example.com/foo#bar%2523"; - // force decoding; note how the userinfo becomes ambiguous - QTest::newRow("userinfo-decode") << QUrl("http://example.com") - << int(UserInfo) << "hello%3Aworld:}}>b9o%25kR(" << Tolerant << true - << FullyDecoded << "hello:world:}}>b9o%kR(" - << "http://hello%3Aworld:%7D%7D%3Eb9o%25kR(@example.com"; + // force decoding QTest::newRow("username-decode") << QUrl("http://example.com") << int(UserName) << "hello%3Aworld%25" << Tolerant << true << FullyDecoded << "hello:world%" << "http://hello%3Aworld%25@example.com"; |