diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-11-17 13:24:46 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-11-17 21:28:11 +0100 |
commit | 34304e3100883187ca658b8c983af21549496b43 (patch) | |
tree | 5c2e8216740e4ad4e9efc6010539c3a6cfbbbf8e /tests | |
parent | 1e9dc3ec2f254c711149f8c0376f0403df9b4650 (diff) |
Get rid of Q_COMPILER_CONSTEXPR checks
Is required now.
Change-Id: I62e95929d1649ea1390392230b619bd56d2a0349
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'tests')
7 files changed, 0 insertions, 36 deletions
diff --git a/tests/auto/corelib/global/qflags/tst_qflags.cpp b/tests/auto/corelib/global/qflags/tst_qflags.cpp index 521e134767..86a233f984 100644 --- a/tests/auto/corelib/global/qflags/tst_qflags.cpp +++ b/tests/auto/corelib/global/qflags/tst_qflags.cpp @@ -105,7 +105,6 @@ constexpr Qt::MouseButtons testRelaxedConstExpr() void tst_QFlags::constExpr() { -#ifdef Q_COMPILER_CONSTEXPR Qt::MouseButtons btn = Qt::LeftButton | Qt::RightButton; switch (btn) { case Qt::LeftButton: QVERIFY(false); break; @@ -125,10 +124,7 @@ void tst_QFlags::constExpr() QVERIFY(!verifyConstExpr<Qt::RightButton>(~Qt::MouseButtons(Qt::LeftButton))); -#if defined(__cpp_constexpr) && __cpp_constexpr-0 >= 201304 QVERIFY(verifyConstExpr<uint(testRelaxedConstExpr())>(Qt::MiddleButton)); -#endif -#endif } void tst_QFlags::signedness() diff --git a/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp b/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp index a074ca5a51..f3d95285dc 100644 --- a/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp +++ b/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp @@ -2182,7 +2182,6 @@ struct RegisterMetaTypeStruct<qRegisterMetaType< Name >()> \ enum { Value = qRegisterMetaType< Name >() }; \ }; -#if defined(Q_COMPILER_CONSTEXPR) QT_FOR_EACH_STATIC_TYPE(METATYPE_ID_STRUCT) QT_FOR_EACH_STATIC_TYPE(REGISTER_METATYPE_STRUCT) @@ -2197,11 +2196,9 @@ struct RegisterMetaTypeStructDefaultTemplateValue { enum { Value }; }; -#endif void tst_QMetaType::constexprMetaTypeIds() { -#if defined(Q_COMPILER_CONSTEXPR) int id = 0; int metaType; @@ -2217,9 +2214,6 @@ void tst_QMetaType::constexprMetaTypeIds() default:; } Q_UNUSED(metaType); -#else - QSKIP("The test needs a compiler supporting constexpr"); -#endif } void tst_QMetaType::constRefs() @@ -2228,9 +2222,7 @@ void tst_QMetaType::constRefs() QCOMPARE(::qMetaTypeId<const QString &>(), ::qMetaTypeId<QString>()); QCOMPARE(::qMetaTypeId<const CustomMovable &>(), ::qMetaTypeId<CustomMovable>()); QCOMPARE(::qMetaTypeId<const QList<CustomMovable> &>(), ::qMetaTypeId<QList<CustomMovable> >()); -#if defined(Q_COMPILER_CONSTEXPR) static_assert(::qMetaTypeId<const int &>() == ::qMetaTypeId<int>()); -#endif } struct CustomConvertibleType diff --git a/tests/auto/corelib/text/qstringview/tst_qstringview.cpp b/tests/auto/corelib/text/qstringview/tst_qstringview.cpp index 42b4767c50..a78004f04d 100644 --- a/tests/auto/corelib/text/qstringview/tst_qstringview.cpp +++ b/tests/auto/corelib/text/qstringview/tst_qstringview.cpp @@ -281,7 +281,6 @@ private: void tst_QStringView::constExpr() const { // compile-time checks -#ifdef Q_COMPILER_CONSTEXPR { constexpr QStringView sv; static_assert(sv.size() == 0); @@ -363,7 +362,6 @@ void tst_QStringView::constExpr() const static_assert(sv3.isEmpty()); static_assert(sv3.size() == 0); } -#endif } void tst_QStringView::basics() const diff --git a/tests/auto/corelib/thread/qatomicint/tst_qatomicint.cpp b/tests/auto/corelib/thread/qatomicint/tst_qatomicint.cpp index db9839d1ed..14d393aede 100644 --- a/tests/auto/corelib/thread/qatomicint/tst_qatomicint.cpp +++ b/tests/auto/corelib/thread/qatomicint/tst_qatomicint.cpp @@ -154,18 +154,11 @@ template <bool> inline void booleanHelper() template <typename Atomic> static void constexprFunctionsHelperTemplate() { -#ifdef Q_COMPILER_CONSTEXPR // this is a compile-time test only booleanHelper<Atomic::isReferenceCountingWaitFree()>(); booleanHelper<Atomic::isTestAndSetWaitFree()>(); booleanHelper<Atomic::isFetchAndStoreWaitFree()>(); booleanHelper<Atomic::isFetchAndAddWaitFree()>(); -#elif 0 // No longer constexpr - booleanHelper<Atomic::isReferenceCountingNative()>(); - booleanHelper<Atomic::isTestAndSetNative()>(); - booleanHelper<Atomic::isFetchAndStoreNative()>(); - booleanHelper<Atomic::isFetchAndAddNative()>(); -#endif } void tst_QAtomicInt::warningFreeHelper() diff --git a/tests/auto/corelib/thread/qatomicinteger/tst_qatomicinteger.cpp b/tests/auto/corelib/thread/qatomicinteger/tst_qatomicinteger.cpp index 9f03c4c2b7..8da52c95fb 100644 --- a/tests/auto/corelib/thread/qatomicinteger/tst_qatomicinteger.cpp +++ b/tests/auto/corelib/thread/qatomicinteger/tst_qatomicinteger.cpp @@ -196,18 +196,11 @@ void tst_QAtomicIntegerXX::static_checks() (void) QAtomicInteger<T>::isFetchAndAddNative(); (void) QAtomicInteger<T>::isFetchAndAddWaitFree(); -#ifdef Q_COMPILER_CONSTEXPR // this is a compile-time test only booleanHelper<QAtomicInteger<T>::isReferenceCountingWaitFree()>(); booleanHelper<QAtomicInteger<T>::isTestAndSetWaitFree()>(); booleanHelper<QAtomicInteger<T>::isFetchAndStoreWaitFree()>(); booleanHelper<QAtomicInteger<T>::isFetchAndAddWaitFree()>(); -#elif 0 // no longer constexpr - booleanHelper<QAtomicInteger<T>::isReferenceCountingNative()>(); - booleanHelper<QAtomicInteger<T>::isTestAndSetNative()>(); - booleanHelper<QAtomicInteger<T>::isFetchAndStoreNative()>(); - booleanHelper<QAtomicInteger<T>::isFetchAndAddNative()>(); -#endif } void tst_QAtomicIntegerXX::addData() diff --git a/tests/auto/gui/painting/qcolor/tst_qcolor.cpp b/tests/auto/gui/painting/qcolor/tst_qcolor.cpp index b9ae7a258b..40d42806a8 100644 --- a/tests/auto/gui/painting/qcolor/tst_qcolor.cpp +++ b/tests/auto/gui/painting/qcolor/tst_qcolor.cpp @@ -64,10 +64,8 @@ private slots: void globalColors_data(); void globalColors(); -#if defined(Q_COMPILER_CONSTEXPR) & defined(Q_COMPILER_UNIFORM_INIT) void colorConstants_data(); void colorConstants(); -#endif void setRed(); void setGreen(); @@ -373,7 +371,6 @@ void tst_QColor::globalColors() QCOMPARE(color.rgba(), argb); } -#if defined(Q_COMPILER_CONSTEXPR) & defined(Q_COMPILER_UNIFORM_INIT) void tst_QColor::colorConstants_data() { QTest::addColumn<QColor>("color"); @@ -556,7 +553,6 @@ void tst_QColor::colorConstants() QFETCH(QRgb, argb); QCOMPARE(color.rgba(), argb); } -#endif // defined(Q_COMPILER_CONSTEXPR) & defined(Q_COMPILER_UNIFORM_INIT) /* CSS color names = SVG 1.0 color names + transparent (rgba(0,0,0,0)) diff --git a/tests/auto/network/ssl/qsslellipticcurve/tst_qsslellipticcurve.cpp b/tests/auto/network/ssl/qsslellipticcurve/tst_qsslellipticcurve.cpp index 7e268ddb62..15c478f05a 100644 --- a/tests/auto/network/ssl/qsslellipticcurve/tst_qsslellipticcurve.cpp +++ b/tests/auto/network/ssl/qsslellipticcurve/tst_qsslellipticcurve.cpp @@ -50,15 +50,11 @@ private Q_SLOTS: void tst_QSslEllipticCurve::constExpr() { -#ifdef Q_COMPILER_CONSTEXPR // check that default ctor and op ==/!= are constexpr: char array1[QSslEllipticCurve() == QSslEllipticCurve() ? 1 : -1]; char array2[QSslEllipticCurve() != QSslEllipticCurve() ? -1 : 1]; Q_UNUSED(array1); Q_UNUSED(array2); -#else - QSKIP("This test requires C++11 generalized constant expression support enabled in the compiler."); -#endif } void tst_QSslEllipticCurve::construction() |