diff options
author | Edward Welbourne <edward.welbourne@qt.io> | 2020-07-23 13:50:34 +0200 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2020-07-27 11:25:49 +0200 |
commit | d3c8757731d0b0d9e7a6448f1d1c21997136a19d (patch) | |
tree | d9393c862c2456b86c3a77bd1cc783b0aa01382d /tests/auto/corelib/io | |
parent | f144507829a39f9327ac1abe99c18e5f79e7ebcf (diff) |
Purge redundant recoding of URL fragments from QByteArray
QUrl::fromEncodedComponent_helper() only existed to support some old
methods deprecated since 5.0, that I recently removed.
It was the only caller of qt_urlRecodeByteArray() aside from that
function's own autotest.
Both were private.
Task-number: QTBUG-85700
Change-Id: I5d09fd44e768847ce51a1ae7043150922cb5314c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Diffstat (limited to 'tests/auto/corelib/io')
-rw-r--r-- | tests/auto/corelib/io/qurlinternal/tst_qurlinternal.cpp | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/tests/auto/corelib/io/qurlinternal/tst_qurlinternal.cpp b/tests/auto/corelib/io/qurlinternal/tst_qurlinternal.cpp index 452f9417e1..da9477ca84 100644 --- a/tests/auto/corelib/io/qurlinternal/tst_qurlinternal.cpp +++ b/tests/auto/corelib/io/qurlinternal/tst_qurlinternal.cpp @@ -84,8 +84,6 @@ private Q_SLOTS: void encodingRecode(); void encodingRecodeInvalidUtf8_data(); void encodingRecodeInvalidUtf8(); - void recodeByteArray_data(); - void recodeByteArray(); }; #include "tst_qurlinternal.moc" @@ -1067,34 +1065,4 @@ void tst_QUrlInternal::encodingRecodeInvalidUtf8() } } -void tst_QUrlInternal::recodeByteArray_data() -{ - QTest::addColumn<QByteArray>("input"); - QTest::addColumn<QString>("expected"); - - QTest::newRow("null") << QByteArray() << QString(); - QTest::newRow("empty") << QByteArray("") << QString(""); - QTest::newRow("normal") << QByteArray("Hello") << "Hello"; - QTest::newRow("valid-utf8") << QByteArray("\xc3\xa9") << "%C3%A9"; - QTest::newRow("percent-encoded") << QByteArray("%C3%A9%00%C0%80") << "%C3%A9%00%C0%80"; - QTest::newRow("invalid-utf8-1") << QByteArray("\xc3\xc3") << "%C3%C3"; - QTest::newRow("invalid-utf8-2") << QByteArray("\xc0\x80") << "%C0%80"; - - // note: percent-encoding the control characters ("\0" -> "%00") would also - // be correct, but it's unnecessary for this function - QTest::newRow("binary") << QByteArray("\0\x1f", 2) << QString::fromLatin1("\0\x1f", 2);; - QTest::newRow("binary+percent-encoded") << QByteArray("\0%25", 4) << QString::fromLatin1("\0%25", 4); -} - -void tst_QUrlInternal::recodeByteArray() -{ - QFETCH(QByteArray, input); - QFETCH(QString, expected); - QString output = qt_urlRecodeByteArray(input); - - QCOMPARE(output.isNull(), input.isNull()); - QCOMPARE(output.isEmpty(), input.isEmpty()); - QCOMPARE(output, expected); -} - QTEST_APPLESS_MAIN(tst_QUrlInternal) |