From 8213e611a86617f371858ffd4398b3f6d54c280f Mon Sep 17 00:00:00 2001 From: James Graham Date: Sat, 30 Nov 2024 14:54:10 +0000 Subject: [PATCH] Fix quotest --- quotest/quotest.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/quotest/quotest.cpp b/quotest/quotest.cpp index 3867e6f8f..3fa750bc7 100644 --- a/quotest/quotest.cpp +++ b/quotest/quotest.cpp @@ -887,11 +887,16 @@ TEST_IMPL(thread) }) .unwrap() .then(this, [this, thisTest](const RoomEvent& replyEvt) { - const auto rmReplyEvt = eventCast(&replyEvt); - const auto thread = targetRoom->threads()[rmReplyEvt->threadRootEventId()]; - FINISH_TEST(thread.threadRootId == rmReplyEvt->threadRootEventId() && - thread.latestEventId == rmReplyEvt->id() && - thread.size == 2 + replyEvt.switchOnType( + [&](const RoomMessageEvent& rmReplyEvt) { + const auto thread = targetRoom->threads()[rmReplyEvt.threadRootEventId()]; + clog << thread.threadRootId.toStdString() << rmReplyEvt.threadRootEventId().toStdString() << thread.latestEventId.toStdString() << rmReplyEvt.id().toStdString() << thread.size; + FINISH_TEST(thread.threadRootId == rmReplyEvt.threadRootEventId() && + thread.latestEventId == rmReplyEvt.id() && + thread.size == 2 + ); + }, + [this, thisTest](const RoomEvent&) { FAIL_TEST(); } ); }); return false;