qt6-bb10/tests/auto/corelib/text/qstringapisymmetry
Ivan Solovev aab82ff367 tst_qstringapisymmetry: add qCompareThreeWay() checks
Check that all string-like types implement compareThreeWay() as a
(hidden) friend function.

This test revealed some problems: because QByteArrayView is implicitly
constructible from QLatin1StringView, the qCompareThreeWay() call
sometimes picked the compareThreeWay() overloads with QByteArrayView
instead of picking the "reversed" overloads that use QLatin1StringView.
This was leading to wrong results, because QByteArrayView is
interpreted as utf-8 data, not latin-1.

Explicitly add the missing compareThreeWay() and comparesEqual()
overloads.

Note that relational operators were never affected by this problem,
because in C++17 mode we explicitly generate the reversed versions,
and in C++20 mode the compiler does that for us.

Task-number: QTBUG-117661
Change-Id: Ia96af59c60ebf2fae6cf2a49231d6b6f401aceaa
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2024-03-18 17:42:18 +01:00
..
.gitignore
CMakeLists.txt CMake: Make corelib tests standalone projects 2023-07-05 15:09:32 +02:00
tst_qstringapisymmetry.cpp tst_qstringapisymmetry: add qCompareThreeWay() checks 2024-03-18 17:42:18 +01:00