Skip to content

Commit

Permalink
Adapt to fixed whenMerged
Browse files Browse the repository at this point in the history
  • Loading branch information
nvrWhere committed Dec 10, 2024
1 parent 1a0af67 commit 3084338
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions quotest/quotest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
#include <QtNetwork/QNetworkReply>

#include <iostream>
#include <qnamespace.h>

using namespace Quotient;
using std::clog, std::endl;
Expand Down Expand Up @@ -901,18 +900,16 @@ TEST_IMPL(thread)
targetRoom->post<Quotient::RoomMessageEvent>(u"Thread reply 1"_s, Quotient::RoomMessageEvent::MsgType::Text, nullptr, relation)
.whenMerged()
.then([this, thisTest](const RoomEvent& replyEvt) {
connect(targetRoom, &Room::pendingEventMerged, this, [this, thisTest, &replyEvt]() {
replyEvt.switchOnType(
[&](const RoomMessageEvent& rmReplyEvt) {
const auto thread = targetRoom->threads()[rmReplyEvt.threadRootEventId()];
FINISH_TEST(thread.threadRootId == rmReplyEvt.threadRootEventId() &&
thread.latestEventId == rmReplyEvt.id() &&
thread.size == 2
);
},
[this, thisTest](const RoomEvent&) { FAIL_TEST(); }
);
}, Qt::SingleShotConnection);
replyEvt.switchOnType(
[&](const RoomMessageEvent& rmReplyEvt) {
const auto thread = targetRoom->threads()[rmReplyEvt.threadRootEventId()];
FINISH_TEST(thread.threadRootId == rmReplyEvt.threadRootEventId() &&
thread.latestEventId == rmReplyEvt.id() &&
thread.size == 2
);
},
[this, thisTest](const RoomEvent&) { FAIL_TEST(); }
);
});
}
});
Expand Down

0 comments on commit 3084338

Please sign in to comment.