summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2012-05-04 12:40:28 +0200
committerQt by Nokia <qt-info@nokia.com>2012-05-04 15:24:52 +0200
commit26e47c0353cb7340488a60fa08bc72b4b6b8fe3c (patch)
tree2e52e32a1ebcde3f0c52f1e28e44e7b95b6d6466 /tests/auto
parent4ececbba5817445d59f66209fd48388f950673c5 (diff)
Slightly improve the query encode/decode test in QUrl
Show that nothing is changed either way, regardless of the encoding flags used. Change-Id: I31fba5f87eae777d4b708ab789b32169004bcbcc Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/corelib/io/qurl/tst_qurl.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/tests/auto/corelib/io/qurl/tst_qurl.cpp b/tests/auto/corelib/io/qurl/tst_qurl.cpp
index dc799b47e5..92717e96f9 100644
--- a/tests/auto/corelib/io/qurl/tst_qurl.cpp
+++ b/tests/auto/corelib/io/qurl/tst_qurl.cpp
@@ -2782,18 +2782,19 @@ void tst_QUrl::componentEncodings_data()
// test the query
// since QUrl doesn't know what chars the user wants to use for the pair and value delimiters,
// it keeps the delimiters alone except for "#", which must always be encoded.
- QTest::newRow("unencoded-delims-query") << QUrl("?!$()*+,;=:/?[]@")
+ // In the following test, all delimiter characters appear both as encoded and as decoded (except for "#")
+ QTest::newRow("unencoded-delims-query") << QUrl("?!$()*+,;=:/?[]@%21%24%26%27%28%29%2a%2b%2c%2f%3a%3b%3d%3f%40%5b%5d")
<< int(QUrl::FullyEncoded)
<< QString() << QString() << QString()
<< QString() << QString()
- << QString() << "!$()*+,;=:/?[]@" << QString()
- << "?!$()*+,;=:/?[]@";
- QTest::newRow("undecoded-delims-query") << QUrl("?%21%24%26%27%28%29%2a%2b%2c%2f%3a%3b%3d%3f%40%5b%5d")
+ << QString() << "!$()*+,;=:/?[]@%21%24%26%27%28%29%2A%2B%2C%2F%3A%3B%3D%3F%40%5B%5D" << QString()
+ << "?!$()*+,;=:/?[]@%21%24%26%27%28%29%2A%2B%2C%2F%3A%3B%3D%3F%40%5B%5D";
+ QTest::newRow("undecoded-delims-query") << QUrl("?!$()*+,;=:/?[]@%21%24%26%27%28%29%2a%2b%2c%2f%3a%3b%3d%3f%40%5b%5d")
<< int(QUrl::MostDecoded)
<< QString() << QString() << QString()
<< QString() << QString()
- << QString() << "%21%24%26%27%28%29%2A%2B%2C%2F%3A%3B%3D%3F%40%5B%5D" << QString()
- << "?%21%24%26%27%28%29%2A%2B%2C%2F%3A%3B%3D%3F%40%5B%5D";
+ << QString() << "!$()*+,;=:/?[]@%21%24%26%27%28%29%2A%2B%2C%2F%3A%3B%3D%3F%40%5B%5D" << QString()
+ << "?!$()*+,;=:/?[]@%21%24%26%27%28%29%2A%2B%2C%2F%3A%3B%3D%3F%40%5B%5D";
// reserved characters: '"' / "<" / ">" / "^" / "\" / "{" / "|" "}"
// the RFC does not allow them undecoded anywhere, but we do