qt5base-lts/tests/auto
Marc Mutz 6f145707eb QString::from{Utf8,Latin1,Local8Bit}(QByteArray): preserve nullness of argument
Currently, calling these functions with a null QByteArray will return
a non-null QString because QByteArray::data() never returns nullptr.

This behavior leads to inconsistencies between QString::append overloads,
in particular the QByteArray vs. all others (null + null test always
returns a null QString, except for the QByteArray overload before this
change).

It also is inconsistent with the const char* overloads of these methods,
which explicitly preserve nullness (as verified by test cases).

Fixed by an explicit check for nullness and return of null QString.

Alternative would have been to check for nullness and pass nullptr
instead of ba.data() to the _helper() functions, which do the correct
thing in that case. But since we'd have the check anyway and with the
chosen strategy we can avoid a call to a non-inline method, I opted
against that.

[ChangeLog][QtCore][QString] fromLatin1(), fromAscii(), fromUtf8() and
fromLocal8Bit() now return a null QString when called with a null
QByteArray.

Change-Id: I5f2c0bad27fb73c7d535085af0271823bf6ed1da
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-04-02 19:28:18 +00:00
..
android Update copyright headers 2015-02-11 06:49:51 +00:00
bic/data bic: Add 5.{1,2,3,4}.0 bic data for linux-gcc-amd64 2015-02-14 06:54:20 +00:00
cmake CMake: Fix regression with quoted OPTIONS parameter 2015-03-11 07:31:33 +00:00
compilerwarnings/data Fixed license headers 2015-02-17 18:46:09 +00:00
concurrent Fix build of tests on QNX. 2015-03-14 07:05:34 +00:00
corelib QString::from{Utf8,Latin1,Local8Bit}(QByteArray): preserve nullness of argument 2015-04-02 19:28:18 +00:00
dbus Merge remote-tracking branch 'origin/5.5' into dev 2015-04-01 09:10:26 +02:00
gui Merge remote-tracking branch 'origin/5.5' into dev 2015-04-01 09:10:26 +02:00
guiapplauncher Fix path to examples part of tst_GuiAppLauncher 2015-02-13 07:28:15 +00:00
installed_cmake Add a unit test for testing Qt in its install location. 2013-07-02 23:08:54 +02:00
network Merge remote-tracking branch 'origin/5.5' into dev 2015-04-01 09:10:26 +02:00
opengl Update copyright headers 2015-02-11 06:49:51 +00:00
other OS X Accessibility: Make checkboxes etc. checkable with VoiceOver 2015-03-25 09:48:43 +00:00
printsupport Update copyright headers 2015-02-11 06:49:51 +00:00
shared Update copyright headers 2015-02-11 06:49:51 +00:00
sql MySQL: Fix test so it expects the right integer type 2015-03-20 13:51:34 +00:00
testlib Make the printing of complex byte arrays prettier 2015-02-15 06:35:43 +00:00
tools add autotest for qmake parser 2015-02-25 13:55:12 +00:00
widgets Merge remote-tracking branch 'origin/5.5' into dev 2015-04-01 09:10:26 +02:00
xml Update copyright headers 2015-02-11 06:49:51 +00:00
auto.pro Fix running of dbus-send on some systems 2015-03-31 05:55:55 +00:00
network-settings.h Update copyright headers 2015-02-11 06:49:51 +00:00
qtest-config.h Update copyright headers 2015-02-11 06:49:51 +00:00
test.pl Update copyright headers 2015-02-11 06:49:51 +00:00