diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2012-04-11 14:05:32 -0300 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-04-12 05:02:39 +0200 |
commit | 31c5b237c4f0eb6848c7d2e3ae84232c6f8f6d26 (patch) | |
tree | 73a68de5416102f2fd8286ffc10d9b336a573a9e /tests/auto/qml/qqmlproperty | |
parent | 2d393ae042d5badf0862c0f95122f9662042f2a9 (diff) |
Update test after QUrl minor behaviour change
Changes required:
- Uppercase the hex in percent-encodings
- The tolerant decoder treats all % as broken if any one is broken
(Input "%2B50%" is rendered now "%252B50%25", where previously it
was "%2B50%25)
The extra test is just so we use QString first. If the test fails, we
get a nicer output from QtTest, instead of the hex dump it uses for
QByteArray.
Change-Id: I4c5cbfa3be962c648b50a69dc8bc3c4acc551e62
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Diffstat (limited to 'tests/auto/qml/qqmlproperty')
-rw-r--r-- | tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp b/tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp index f2521e93ef..d99ed303ba 100644 --- a/tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp +++ b/tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp @@ -1431,10 +1431,10 @@ void tst_qqmlproperty::urlHandling_data() << QByteArray("http://www.example.com/main%20file.qml"); QTest::newRow("preencodedName") - << QByteArray("http://www.example.com/resources%7cmain%20file.qml") + << QByteArray("http://www.example.com/resources%7Cmain%20file.qml") << QString("http") << QString("/resources|main file.qml") - << QByteArray("http://www.example.com/resources%7cmain%20file.qml"); + << QByteArray("http://www.example.com/resources%7Cmain%20file.qml"); QTest::newRow("encodableQuery") << QByteArray("http://www.example.com/main.qml?type=text/qml&comment=now working?") @@ -1443,10 +1443,10 @@ void tst_qqmlproperty::urlHandling_data() << QByteArray("http://www.example.com/main.qml?type=text/qml&comment=now%20working?"); QTest::newRow("preencodedQuery") - << QByteArray("http://www.example.com/main.qml?type=text%2fqml&comment=now working%3f") + << QByteArray("http://www.example.com/main.qml?type=text%2Fqml&comment=now working%3F") << QString("http") << QString("/main.qml") - << QByteArray("http://www.example.com/main.qml?type=text%2fqml&comment=now%20working%3f"); + << QByteArray("http://www.example.com/main.qml?type=text%2Fqml&comment=now%20working%3F"); QTest::newRow("encodableFragment") << QByteArray("http://www.example.com/main.qml?type=text/qml#start+30000|volume+50%") @@ -1454,11 +1454,11 @@ void tst_qqmlproperty::urlHandling_data() << QString("/main.qml") << QByteArray("http://www.example.com/main.qml?type=text/qml#start+30000%7Cvolume+50%25"); - QTest::newRow("preencodedFragment") - << QByteArray("http://www.example.com/main.qml?type=text/qml#start+30000%7cvolume%2b50%") + QTest::newRow("improperlyEncodedFragment") + << QByteArray("http://www.example.com/main.qml?type=text/qml#start+30000%7Cvolume%2B50%") << QString("http") << QString("/main.qml") - << QByteArray("http://www.example.com/main.qml?type=text/qml#start+30000%7cvolume%2b50%25"); + << QByteArray("http://www.example.com/main.qml?type=text/qml#start+30000%257Cvolume%252B50%25"); } void tst_qqmlproperty::urlHandling() @@ -1480,6 +1480,7 @@ void tst_qqmlproperty::urlHandling() QCOMPARE(byteArrayResult.scheme(), scheme); QCOMPARE(byteArrayResult.path(), path); + QCOMPARE(byteArrayResult.toString(QUrl::FullyEncoded), QString::fromUtf8(encoded)); QCOMPARE(byteArrayResult.toEncoded(), encoded); } @@ -1493,6 +1494,7 @@ void tst_qqmlproperty::urlHandling() QCOMPARE(stringResult.scheme(), scheme); QCOMPARE(stringResult.path(), path); + QCOMPARE(stringResult.toString(QUrl::FullyEncoded), QString::fromUtf8(encoded)); QCOMPARE(stringResult.toEncoded(), encoded); } } |