aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLinus Jahn <lnj@kaidan.im>2023-01-28 17:08:05 +0100
committerLinus Jahn <lnj@kaidan.im>2023-01-28 17:19:35 +0100
commit8ac881a544e8fc7f85d78132610fce1b696d2025 (patch)
tree60742c9e76e7f404c96ba902b6e86fe90ce6e3c8 /tests
parent5602c655ac32000e113dffc4aef2b3ed8d733c58 (diff)
downloadqxmpp-8ac881a544e8fc7f85d78132610fce1b696d2025.tar.gz
Task/Promise: Don't allow abstract types
Supporting abstract types only has little advantages and we might want to store the result by value later.
Diffstat (limited to 'tests')
-rw-r--r--tests/qxmppclient/tst_qxmppclient.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/qxmppclient/tst_qxmppclient.cpp b/tests/qxmppclient/tst_qxmppclient.cpp
index 0b5d33ea..a18fa0d2 100644
--- a/tests/qxmppclient/tst_qxmppclient.cpp
+++ b/tests/qxmppclient/tst_qxmppclient.cpp
@@ -174,8 +174,8 @@ void tst_QXmppClient::testTaskDirect()
bool thenCalled = false;
p.task().then(this, [&thenCalled](QXmppIq &&iq) {
thenCalled = true;
- QVERIFY(dynamic_cast<QXmppRegisterIq *>(&iq));
- QCOMPARE(dynamic_cast<QXmppRegisterIq &>(iq).username(), QStringLiteral("username"));
+ // casting not supported
+ QVERIFY(!dynamic_cast<QXmppRegisterIq *>(&iq));
});
p.finish(std::move(iq));
@@ -203,8 +203,8 @@ void tst_QXmppClient::testTaskStore()
thenCalled = true;
QCOMPARE(iq.from(), QStringLiteral("juliet"));
- QVERIFY(dynamic_cast<QXmppRegisterIq *>(&iq));
- QCOMPARE(dynamic_cast<QXmppRegisterIq &>(iq).username(), QStringLiteral("username"));
+ // casting not supported
+ QVERIFY(!dynamic_cast<QXmppRegisterIq *>(&iq));
});
QVERIFY(thenCalled);
@@ -219,8 +219,8 @@ void tst_QXmppClient::testTaskStore()
thenCalled = false;
p.task().then(this, [&thenCalled](QXmppIq &&iq) {
thenCalled = true;
- QVERIFY(dynamic_cast<QXmppRegisterIq *>(&iq));
- QCOMPARE(dynamic_cast<QXmppRegisterIq &>(iq).username(), QStringLiteral("username"));
+ // casting not supported
+ QVERIFY(!dynamic_cast<QXmppRegisterIq *>(&iq));
});
QVERIFY(thenCalled);