summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2020-05-07 14:34:00 +0200
committerLars Knoll <lars.knoll@qt.io>2020-05-14 07:51:45 +0200
commit57037145f59a6d1803cdd81da8bd2af46b5607c4 (patch)
tree2f859cd6d5b99a4eeff8816939a4156d8e8f4bce /tests
parent751a003d1e99735fb77e6870a7672cb5c39a21f9 (diff)
Streamline the code in the conversion to and from utf8
Move pre/and post condition handling out of the main loop to make that one as fast as possible. Remove special handling of a corner case when the input length is zero, where the utf8 decoder did something else than all other decoders. Change-Id: I94992767ea15405b38f7953adadaa6ff98b20b6f Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/corelib/codecs/qtextcodec/tst_qtextcodec.cpp8
-rw-r--r--tests/auto/corelib/text/qstringconverter/tst_qstringconverter.cpp8
2 files changed, 0 insertions, 16 deletions
diff --git a/tests/auto/corelib/codecs/qtextcodec/tst_qtextcodec.cpp b/tests/auto/corelib/codecs/qtextcodec/tst_qtextcodec.cpp
index 4dc75b11c0..08c2954484 100644
--- a/tests/auto/corelib/codecs/qtextcodec/tst_qtextcodec.cpp
+++ b/tests/auto/corelib/codecs/qtextcodec/tst_qtextcodec.cpp
@@ -1641,14 +1641,6 @@ void tst_QTextCodec::utf8stateful_data()
QTest::newRow("2of4+invalid") << QByteArray("\360\220") << QByteArray("a") << QString();
QTest::newRow("3of4+invalid") << QByteArray("\360\220\210") << QByteArray("a") << QString();
- // invalid: sequence too short (the empty second buffer causes a state reset)
- QTest::newRow("1of2+empty") << QByteArray("\xc2") << QByteArray() << QString();
- QTest::newRow("1of3+empty") << QByteArray("\xe0") << QByteArray() << QString();
- QTest::newRow("2of3+empty") << QByteArray("\xe0\xa0") << QByteArray() << QString();
- QTest::newRow("1of4+empty") << QByteArray("\360") << QByteArray() << QString();
- QTest::newRow("2of4+empty") << QByteArray("\360\220") << QByteArray() << QString();
- QTest::newRow("3of4+empty") << QByteArray("\360\220\210") << QByteArray() << QString();
-
// overlong sequence:
QTest::newRow("overlong-1of2") << QByteArray("\xc1") << QByteArray("\x81") << QString();
QTest::newRow("overlong-1of3") << QByteArray("\xe0") << QByteArray("\x81\x81") << QString();
diff --git a/tests/auto/corelib/text/qstringconverter/tst_qstringconverter.cpp b/tests/auto/corelib/text/qstringconverter/tst_qstringconverter.cpp
index e95bce6915..58ae28bbf4 100644
--- a/tests/auto/corelib/text/qstringconverter/tst_qstringconverter.cpp
+++ b/tests/auto/corelib/text/qstringconverter/tst_qstringconverter.cpp
@@ -1335,14 +1335,6 @@ void tst_QStringConverter::utf8stateful_data()
QTest::newRow("2of4+invalid") << QByteArray("\360\220") << QByteArray("a") << QString();
QTest::newRow("3of4+invalid") << QByteArray("\360\220\210") << QByteArray("a") << QString();
- // invalid: sequence too short (the empty second buffer causes a state reset)
- QTest::newRow("1of2+empty") << QByteArray("\xc2") << QByteArray() << QString();
- QTest::newRow("1of3+empty") << QByteArray("\xe0") << QByteArray() << QString();
- QTest::newRow("2of3+empty") << QByteArray("\xe0\xa0") << QByteArray() << QString();
- QTest::newRow("1of4+empty") << QByteArray("\360") << QByteArray() << QString();
- QTest::newRow("2of4+empty") << QByteArray("\360\220") << QByteArray() << QString();
- QTest::newRow("3of4+empty") << QByteArray("\360\220\210") << QByteArray() << QString();
-
// overlong sequence:
QTest::newRow("overlong-1of2") << QByteArray("\xc1") << QByteArray("\x81") << QString();
QTest::newRow("overlong-1of3") << QByteArray("\xe0") << QByteArray("\x81\x81") << QString();