diff options
author | Chris Adams <chris.adams@qinetic.com.au> | 2021-03-05 15:49:16 +1000 |
---|---|---|
committer | Chris Adams <chris.adams@qinetic.com.au> | 2021-03-18 10:14:48 +1000 |
commit | 9bcae917730ce083ebb3d45392a4b8ccf57ee306 (patch) | |
tree | eb2318adc3e6cf7de840ae2c94e71a59c884fe4b | |
parent | 114615812dcf9398c957b0833e860befe15f840f (diff) |
Ensure we throw away the BOM in the qversitreader test
The BOM will only be emitted from the very first call to
encoder->fromUnicode(), and thus since we compare the output from
one invocation to the output of another, we need to ensure that
the BOM is not included in the result of either.
However, previously we attempted to do this by passing a null
QString into fromUnicode(), however it seems that now it ignores
such input. Hence, we need to give it some dummy input in the
first call to fromUnicode() to force it to "spend" its BOM output.
Change-Id: I74d8bd53604044ba1e82d48668d9570505fef491
Reviewed-by: Pekka Vuorela <pvuorela@iki.fi>
-rw-r--r-- | tests/auto/versit/qversitreader/tst_qversitreader.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/auto/versit/qversitreader/tst_qversitreader.cpp b/tests/auto/versit/qversitreader/tst_qversitreader.cpp index eed6dad11..5657c6c7d 100644 --- a/tests/auto/versit/qversitreader/tst_qversitreader.cpp +++ b/tests/auto/versit/qversitreader/tst_qversitreader.cpp @@ -1854,7 +1854,7 @@ void tst_QVersitReader::testReadLine() QTextEncoder* encoder = codec->makeEncoder(codecName == QStringLiteral("UTF-8") ? QStringConverterBase::Flag::Default : QStringConverterBase::Flag::WriteBom); - encoder->fromUnicode(QString()); // Throw away BOM. + encoder->fromUnicode(QStringLiteral("ignore BOM")); // Throw away BOM. QByteArray bytes(encoder->fromUnicode(data)); |