diff options
author | Marc Hüskens <marc.hueskens@aucos.de> | 2024-02-07 13:31:04 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2024-03-13 18:41:42 +0000 |
commit | fe6e1e86f64d7054da76449a4e3e03a1bb84a47d (patch) | |
tree | 488fe6f750a21a8739e9ce0f87a4fc2f6676d75e | |
parent | dab5124e6036ddd16aee079e961944861e49898a (diff) |
Fix slot return values of container<pod>6.6
Added missing call to decodeVariant before informing replicas
Pick-to: 6.5 6.2
Change-Id: Ibb83f02fc901390c4ec92de836d9663315ab112c
Reviewed-by: Brett Stottlemyer <bstottle@ford.com>
(cherry picked from commit 73ee1f826195d80384c1fd1eefd7bbc176542b2d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit a7bd0a523a793a54600b1f3a492346cc7972454e)
-rw-r--r-- | src/remoteobjects/qremoteobjectnode.cpp | 1 | ||||
-rw-r--r-- | tests/auto/integration/pod.rep | 2 | ||||
-rw-r--r-- | tests/auto/integration/tst_integration.cpp | 28 |
3 files changed, 30 insertions, 1 deletions
diff --git a/src/remoteobjects/qremoteobjectnode.cpp b/src/remoteobjects/qremoteobjectnode.cpp index e898a7b..57d374c 100644 --- a/src/remoteobjects/qremoteobjectnode.cpp +++ b/src/remoteobjects/qremoteobjectnode.cpp @@ -1554,6 +1554,7 @@ void QRemoteObjectNodePrivate::onClientRead(QObject *obj) QSharedPointer<QRemoteObjectReplicaImplementation> rep = qSharedPointerCast<QRemoteObjectReplicaImplementation>(replicas.value(rxName).toStrongRef()); if (rep) { qROPrivDebug() << "Received InvokeReplyPacket ack'ing serial id:" << ackedSerialId; + rxValue = decodeVariant(std::move(rxValue), {}); rep->notifyAboutReply(ackedSerialId, rxValue); } else { //replica has been deleted, remove from list replicas.remove(rxName); diff --git a/tests/auto/integration/pod.rep b/tests/auto/integration/pod.rep index 8a006d8..8b26699 100644 --- a/tests/auto/integration/pod.rep +++ b/tests/auto/integration/pod.rep @@ -3,4 +3,6 @@ POD MyPOD(int i, float f, QString s) class MyClass { PROP(MyPOD myPOD) + SLOT(QMap<QString, MyPOD> myPodMap()) + SLOT(QList<MyPOD> myPodList()) } diff --git a/tests/auto/integration/tst_integration.cpp b/tests/auto/integration/tst_integration.cpp index d815e1a..482690d 100644 --- a/tests/auto/integration/tst_integration.cpp +++ b/tests/auto/integration/tst_integration.cpp @@ -112,6 +112,20 @@ private: EngineReplica::EngineType type; }; +class MyClass : public MyClassSimpleSource +{ +public: + QMap<QString, MyPOD> myPodMap() override + { + return {{"Zero", MyPOD(0,0,"0")},{"One", MyPOD(1,1,"1")},{"Two", MyPOD(2,2,"2")}}; + } + QList<MyPOD> myPodList() override + { + return {MyPOD(0,0,"0"),MyPOD(1,1,"1"),MyPOD(2,2,"2")}; + } +}; + + class tst_Integration: public QObject { Q_OBJECT @@ -1368,7 +1382,7 @@ private slots: MyPOD shouldPass(1, 2.0, QStringLiteral("pass")); MyPOD shouldFail(1, 2.0, QStringLiteral("fail")); - MyClassSimpleSource m; + MyClass m; m.setMyPOD(shouldPass); host->enableRemoting(&m); const QScopedPointer<MyClassReplica> myclass_r(client->acquire<MyClassReplica>()); @@ -1376,6 +1390,18 @@ private slots: QVERIFY(myclass_r->myPOD() == m.myPOD()); QVERIFY(myclass_r->myPOD() != shouldFail); + + auto podMapReply = myclass_r->myPodMap(); + QVERIFY(podMapReply.waitForFinished(1000)); + auto podMap = podMapReply.returnValue(); + QCOMPARE(podMap.size(), 3); + QCOMPARE(podMap, m.myPodMap()); + + auto podListReply = myclass_r->myPodList(); + QVERIFY(podListReply.waitForFinished(1000)); + auto podList = podListReply.returnValue(); + QCOMPARE(podList.size(), 3); + QCOMPARE(podList, m.myPodList()); } void SchemeTest() |