summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/text/qanystringview/tst_qanystringview.cpp
diff options
context:
space:
mode:
authorIvan Solovev <ivan.solovev@qt.io>2024-02-27 14:28:32 +0100
committerIvan Solovev <ivan.solovev@qt.io>2024-03-01 16:01:45 +0100
commit380c01bac545172624944e269214ba168e59fb3c (patch)
treef1a36c46dc50173f282d3d5a1cb00fe7ae817d80 /tests/auto/corelib/text/qanystringview/tst_qanystringview.cpp
parent60aeeb0e92762d57c208e4212374d30be6490611 (diff)
Bring back QASV::detects_US_ASCII_at_compile_time
Even though undocumented, it's public API, doesn't hurt to carry along, and improves compiler coverage in the test, so let's not remove it. Found in 6.7 API review Amends 95e6fac0a5a1eee3aa23e4da0a93c6c25e32fb98. Pick-to: 6.7 Change-Id: Ia935036a69e0e678f22ac86b48a2c1c5e8c46733 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Diffstat (limited to 'tests/auto/corelib/text/qanystringview/tst_qanystringview.cpp')
-rw-r--r--tests/auto/corelib/text/qanystringview/tst_qanystringview.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/tests/auto/corelib/text/qanystringview/tst_qanystringview.cpp b/tests/auto/corelib/text/qanystringview/tst_qanystringview.cpp
index b4f5d53373..6c29ac1cc2 100644
--- a/tests/auto/corelib/text/qanystringview/tst_qanystringview.cpp
+++ b/tests/auto/corelib/text/qanystringview/tst_qanystringview.cpp
@@ -570,8 +570,7 @@ void tst_QAnyStringView::debug() const
void tst_QAnyStringView::asciiLiteralIsLatin1() const
{
-#ifdef QT_SUPPORTS_IS_CONSTANT_EVALUATED
- if constexpr (true) {
+ if constexpr (QAnyStringView::detects_US_ASCII_at_compile_time) {
constexpr bool asciiCstringIsLatin1 = QAnyStringView("Hello, World").isLatin1();
QVERIFY(asciiCstringIsLatin1);
constexpr bool asciiUtf8stringIsLatin1 = QAnyStringView(u8"Hello, World").isLatin1();
@@ -587,10 +586,9 @@ void tst_QAnyStringView::asciiLiteralIsLatin1() const
constexpr bool utf8StringArrayIsNotLatin1 =
!QAnyStringView::fromArray(u8"Tørrfisk").isLatin1();
QVERIFY(utf8StringArrayIsNotLatin1);
+ } else {
+ QSKIP("Compile-detection of US-ASCII strings not possible with this compiler");
}
-#else
- QSKIP("Compile-detection of US-ASCII strings not possible with this compiler");
-#endif
}
template <typename StringBuilder>