qt6-bb10/tests/auto/corelib/text/qanystringview
Marc Mutz 47df569343 tst_QAnyStringView: test which chars magically convert
QAnyStringView is designed to replace overload sets containing QString
and QChar, among others, so it needs to accept types that merely
implicitly convert to QString and QChar. It achieves this by
maintaining a hidden container to hold the converted QString or QChar
for the duration of the full-expression, much like the compiler would
do if the function took QString/QChar.

This patch adds a check for the single-char ctors to determine whether
they convert or not, by comparing QASV::data() to the address of the
QASV's argument. While it would be interesting to have the same test
for QString, that is outside the scope of this patch.

Task-number: QTBUG-126054
Pick-to: 6.5 6.2
Change-Id: I30ac2d1199da5a03fe6fee4c9d5ea2a209a003d6
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit f31c37a1312fc4e21a58906e2b883099629fb9e1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 18b56bbae2cb1e775b5155f8fc019081780a9867)
2025-02-11 00:49:25 +00:00
..
.gitignore Add an initial tst_QAnyStringView 2021-11-18 17:13:19 +00:00
CMakeLists.txt Q{Any,Utf8}StringView: fix construction from arrays of unknown size 2024-12-16 20:45:24 +00:00
tst_qanystringview.cpp tst_QAnyStringView: test which chars magically convert 2025-02-11 00:49:25 +00:00