diff options
author | Alexey Rusakov <Kitsune-Ral@users.sf.net> | 2022-09-05 07:49:16 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-05 07:49:16 +0200 |
commit | 1e263a32fcbc44985e474a626393494a81f15e37 (patch) | |
tree | 8811e0a995dcd593cb9f233e02ece9402e76eb1b /quotest | |
parent | 8cb629f406f5b8b1ff7ce787dd3967d5684e07c3 (diff) | |
parent | bd2736bc9f8b6023ecbc21d0d831856703b853db (diff) | |
download | libquotient-1e263a32fcbc44985e474a626393494a81f15e37.tar.gz libquotient-1e263a32fcbc44985e474a626393494a81f15e37.zip |
Merge pull request #565 from quotient-im/kitsune/streamline-event-types-2
Streamline event types, part 2
Diffstat (limited to 'quotest')
-rw-r--r-- | quotest/quotest.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/quotest/quotest.cpp b/quotest/quotest.cpp index b6c855bb..624888be 100644 --- a/quotest/quotest.cpp +++ b/quotest/quotest.cpp @@ -128,7 +128,7 @@ private: [[nodiscard]] bool checkRedactionOutcome(const QByteArray& thisTest, const QString& evtIdToRedact); - template <class EventT> + template <EventClass<RoomEvent> EventT> [[nodiscard]] bool validatePendingEvent(const QString& txnId); [[nodiscard]] bool checkDirectChat() const; void finishTest(const TestToken& token, bool condition, const char* file, @@ -156,14 +156,14 @@ void TestSuite::doTest(const QByteArray& testName) Q_ARG(TestToken, testName)); } -template <class EventT> +template <EventClass<RoomEvent> EventT> bool TestSuite::validatePendingEvent(const QString& txnId) { auto it = targetRoom->findPendingEvent(txnId); return it != targetRoom->pendingEvents().end() && it->deliveryStatus() == EventStatus::Submitted && (*it)->transactionId() == txnId && is<EventT>(**it) - && (*it)->matrixType() == EventT::matrixTypeId(); + && (*it)->matrixType() == EventT::TypeId; } void TestSuite::finishTest(const TestToken& token, bool condition, @@ -524,7 +524,8 @@ bool TestSuite::checkFileSendingOutcome(const TestToken& thisTest, return true; } -DEFINE_SIMPLE_EVENT(CustomEvent, RoomEvent, "quotest.custom", int, testValue) +DEFINE_SIMPLE_EVENT(CustomEvent, RoomEvent, "quotest.custom", int, testValue, + "test_value") TEST_IMPL(sendCustomEvent) { |