qt5base-lts/tests/auto/corelib/tools/qstring
Marc Mutz a5febadac5 QString(Ref): make toLatin1()/toLocal8Bit() null handling consistent
Systematic testing in tst_QStringApiSymmetry revealed a bug in
QStringRef::toLatin1(): a null input did not result in a null output,
but an empty one. This is fixed, for consistency with
QString::toLatin1(), and QString(Ref)::toUtf8(), which behaved
correctly already.

The same bug was found in QString(Ref)::toLocal8Bit(), which is
particularly hideous, as it's documented to fall back to toLatin1(),
which preserves null inputs. Fixed, too.

[ChangeLog][QtCore][QString] toLocal8Bit() now preserves nullness of
the input QString (outputs null QByteArray).

[ChangeLog][QtCore][QStringRef] toLocal8Bit() and toLatin1() now
preserve nullness of the input QStringRef (output null QByteArrays).

Change-Id: I7026211922c287e03d07e89edbad2987aa646e51
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-02-15 20:12:36 +00:00
..
.gitignore Moving relevant tests to corelib/tools 2011-09-01 13:07:23 +02:00
double_data.h Updated license headers 2016-01-21 18:55:18 +00:00
qstring.pro Modularize configure.json/.pri 2016-09-15 08:23:53 +00:00
tst_qstring_mac.mm Updated license headers 2016-01-21 18:55:18 +00:00
tst_qstring.cpp QString(Ref): make toLatin1()/toLocal8Bit() null handling consistent 2017-02-15 20:12:36 +00:00