From fb50ab700600cbcdf21e5d06321f357eae4303bb Mon Sep 17 00:00:00 2001 From: Ivan Solovev Date: Thu, 15 Feb 2024 12:36:39 +0100 Subject: Add QByteArrayView vs const char * relational operators ... by using the new comparison helper macros. Also, convert the existing QByteArrayView relational operators to use these macros. An attempt to define the helper functions comparesEqual() and compareThreeWay() as hidden friends leads to compilation errors, because the QByteArrayView(QLatin1StringView) constructor gets somehow disabled. Apparently, it cannot satisfy the QtPrivate::IsContainerCompatibleWithQByteArrayView trait anymore. I could not find a reason for that, so I just defined the helper functions as static inline private members of QByteArrayView. This fixes the issue. This allows to enable related tests in tst_qstringapisymmetry. Task-number: QTBUG-108805 Change-Id: I35a69e99db8c61531ec726dab5b242b857f69e85 Reviewed-by: Thiago Macieira --- tests/auto/corelib/text/qstringapisymmetry/tst_qstringapisymmetry.cpp | 4 ---- 1 file changed, 4 deletions(-) (limited to 'tests/auto/corelib/text/qstringapisymmetry/tst_qstringapisymmetry.cpp') diff --git a/tests/auto/corelib/text/qstringapisymmetry/tst_qstringapisymmetry.cpp b/tests/auto/corelib/text/qstringapisymmetry/tst_qstringapisymmetry.cpp index 635b9cfa52..e1a2232b7b 100644 --- a/tests/auto/corelib/text/qstringapisymmetry/tst_qstringapisymmetry.cpp +++ b/tests/auto/corelib/text/qstringapisymmetry/tst_qstringapisymmetry.cpp @@ -320,10 +320,8 @@ private Q_SLOTS: void compare_QByteArrayView_QByteArray() { compare_impl(); } void compare_QByteArrayView_QByteArrayView_data() { compare_data(); } void compare_QByteArrayView_QByteArrayView() { compare_impl(); } -#ifdef AMBIGUOUS_CALL void compare_QByteArrayView_const_char_star_data() { compare_data(); } void compare_QByteArrayView_const_char_star() { compare_impl(); } -#endif void compare_const_char_star_QChar_data() { compare_data(false); } void compare_const_char_star_QChar() { compare_impl(); } @@ -337,10 +335,8 @@ private Q_SLOTS: void compare_const_char_star_QLatin1String() { compare_impl(); } void compare_const_char_star_QByteArray_data() { compare_data(); } void compare_const_char_star_QByteArray() { compare_impl(); } -#ifdef AMBIGUOUS_CALL void compare_const_char_star_QByteArrayView_data() { compare_data(); } void compare_const_char_star_QByteArrayView() { compare_impl(); } -#endif //void compare_const_char_star_const_char_star_data() { compare_data(); } //void compare_const_char_star_const_char_star() { compare_impl(); } -- cgit v1.2.3