qt5base-lts/tests/auto/corelib/text
Marc Mutz 05f913d57d qstrncpy: NUL-terminate even when src is nullptr
The goal of this function is to ensure that dst is _always_
NUL-terminated. The only exception is if there's no space to write
even one NUL byte, of course, but not when src is nullptr but dst
would have space.

Update the docs to the new behavior and make them more precise.

Fix a test that assumed qstrncpy() would not write to dst for
(dst, nullptr, 10).

[ChangeLog][QtCore][qstrncpy()] Now NUL-terminates the target
buffer even when the source pointer is nullptr, provided the
target buffer has space for at least one byte.

Pick-to: 6.5 6.4 6.2 5.15
Change-Id: I7806d8c71e260f8f02b79af7b6ce94f23599dd69
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-02-22 19:24:16 +01:00
..
qanystringview Make XmlStringRef convertible to QAnyStringView/QStringView 2022-11-29 20:03:06 +00:00
qbytearray qstrncpy: NUL-terminate even when src is nullptr 2023-02-22 19:24:16 +01:00
qbytearray_large tst_QByteArrayLarge::initTestCase: Skip tests under ASAN 2022-11-30 04:50:37 +01:00
qbytearrayapisymmetry tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00
qbytearraylist tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00
qbytearraymatcher tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00
qbytearrayview tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00
qbytedatabuffer tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00
qchar tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00
qcollator tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00
qlatin1stringmatcher Add Boyer-Moore Latin-1 string searcher with optional case sensitivity 2022-12-08 17:56:47 +01:00
qlatin1stringview QtBase tests: remove QT_DISABLE_DEPRECATED_UP_TO defines 2022-08-24 22:08:49 +02:00
qlocale tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00
qregularexpression tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00
qstring QString: build tst_QString::arg() without ASCII casting [13/13] 2023-02-20 14:44:31 +02:00
qstring_no_cast_from_bytearray tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00
qstringapisymmetry tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00
qstringbuilder tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00
qstringconverter tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00
qstringiterator tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00
qstringlist tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00
qstringmatcher tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00
qstringtokenizer tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00
qstringview tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00
qtextboundaryfinder tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00
qunicodetools Port from container::count() and length() to size() - V5 2022-11-03 14:59:24 +01:00
shared Provide optTitle for a NumberDoubleTestData testcase that needs it 2022-10-11 11:21:38 +02:00
CMakeLists.txt tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00