summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/kernel/qobject
diff options
context:
space:
mode:
authorVolker Hilsheimer <volker.hilsheimer@qt.io>2023-05-01 10:48:47 +0200
committerVolker Hilsheimer <volker.hilsheimer@qt.io>2023-05-01 22:50:58 +0200
commit1ed8c80ee3239264c9054250a0a4718a2241080b (patch)
tree21a73f1ff768da69904a5a0ac849c4dc04084953 /tests/auto/corelib/kernel/qobject
parent5c3888fe10f4a9009b0b8dd071a3649f6c888236 (diff)
Revert "Support move-only functors in invokeMethod and async APIs"
This reverts commit 9958edba41ac49097a54e0872c3c4934d2dd81f9, which incorrectly tested a move-only functor without actually moving the functor. Change-Id: I3707f9f8e5055102f7edfb3e1cb9750978356dd7 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests/auto/corelib/kernel/qobject')
-rw-r--r--tests/auto/corelib/kernel/qobject/tst_qobject.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/tests/auto/corelib/kernel/qobject/tst_qobject.cpp b/tests/auto/corelib/kernel/qobject/tst_qobject.cpp
index 76ceb84271..82d46a3127 100644
--- a/tests/auto/corelib/kernel/qobject/tst_qobject.cpp
+++ b/tests/auto/corelib/kernel/qobject/tst_qobject.cpp
@@ -8428,7 +8428,6 @@ void tst_QObject::asyncCallbackHelper()
static_assert(compiles<AsyncCaller::Prototype0>(&AsyncCaller::callback0));
static_assert(compiles<AsyncCaller::Prototype0>(&AsyncCaller::staticCallback0));
static_assert(compiles<AsyncCaller::Prototype0>(lambda0));
- static_assert(compiles<AsyncCaller::Prototype0>(moveOnlyLambda));
static_assert(compiles<AsyncCaller::Prototype0>(freeFunction0));
static_assert(compiles<AsyncCaller::Prototype0>(functor0));
@@ -8443,7 +8442,6 @@ void tst_QObject::asyncCallbackHelper()
static_assert(compiles<AsyncCaller::Prototype1>(&AsyncCaller::callback1));
static_assert(compiles<AsyncCaller::Prototype1>(&AsyncCaller::staticCallback1));
static_assert(compiles<AsyncCaller::Prototype1>(lambda1));
- static_assert(compiles<AsyncCaller::Prototype1>(moveOnlyLambda));
static_assert(compiles<AsyncCaller::Prototype1>(constLambda));
static_assert(compiles<AsyncCaller::Prototype1>(freeFunction1));
static_assert(compiles<AsyncCaller::Prototype1>(functor1));
@@ -8457,6 +8455,11 @@ void tst_QObject::asyncCallbackHelper()
static_assert(!compiles<AsyncCaller::Prototype0>(freeFunction1));
static_assert(!compiles<AsyncCaller::Prototype0>(functor1));
+ // move-only functor - should work, but doesn't because QFunctorSlotObject requires
+ // the functor to be of a copyable type!
+ static_assert(!compiles<AsyncCaller::Prototype0>(moveOnlyLambda));
+ static_assert(!compiles<AsyncCaller::Prototype1>(moveOnlyLambda));
+
// wrong parameter type
static_assert(!compiles<AsyncCaller::Prototype1>(&AsyncCaller::callbackInt));
@@ -8474,7 +8477,7 @@ void tst_QObject::asyncCallbackHelper()
QVERIFY(caller.callMe0(&caller, &AsyncCaller::staticCallback0));
QVERIFY(caller.callMe0(&caller, lambda0));
QVERIFY(caller.callMe0(&caller, freeFunction0));
- QVERIFY(caller.callMe0(&caller, moveOnlyLambda));
+// QVERIFY(caller.callMe0(&caller, moveOnlyLambda));
QVERIFY(caller.callMe1(&caller, &AsyncCaller::callback1));
QVERIFY(caller.callMe1(&caller, &AsyncCaller::staticCallback1));
@@ -8486,7 +8489,7 @@ void tst_QObject::asyncCallbackHelper()
QVERIFY(caller.callMe0(&AsyncCaller::staticCallback0));
QVERIFY(caller.callMe0(lambda0));
QVERIFY(caller.callMe0(freeFunction0));
- QVERIFY(caller.callMe0(moveOnlyLambda));
+// QVERIFY(caller.callMe0(moveOnlyLambda));
QVERIFY(caller.callMe1(&AsyncCaller::staticCallback1));
QVERIFY(caller.callMe1(lambda1));