aboutsummaryrefslogtreecommitdiff
path: root/quotest
diff options
context:
space:
mode:
authorAlexey Rusakov <Kitsune-Ral@users.sf.net>2022-05-08 19:08:57 +0200
committerGitHub <noreply@github.com>2022-05-08 19:08:57 +0200
commit3458fdf7b416fe64b82ec9b99553c7b2aa299e4c (patch)
treeb3b1bce3ebf0631597aa6d8451e62d198a42c2be /quotest
parent272cb01b05529971ea38e09bf75d8d8f194a9dd8 (diff)
parentc42d268db0b40cdba06381fc64a6966a72c90709 (diff)
downloadlibquotient-3458fdf7b416fe64b82ec9b99553c7b2aa299e4c.tar.gz
libquotient-3458fdf7b416fe64b82ec9b99553c7b2aa299e4c.zip
Merge #548: Streamline usage of event types, part 1
Diffstat (limited to 'quotest')
-rw-r--r--quotest/quotest.cpp18
1 files changed, 1 insertions, 17 deletions
diff --git a/quotest/quotest.cpp b/quotest/quotest.cpp
index 792faabd..b14442b9 100644
--- a/quotest/quotest.cpp
+++ b/quotest/quotest.cpp
@@ -523,23 +523,7 @@ bool TestSuite::checkFileSendingOutcome(const TestToken& thisTest,
return true;
}
-class CustomEvent : public RoomEvent {
-public:
- DEFINE_EVENT_TYPEID("quotest.custom", CustomEvent)
-
- CustomEvent(const QJsonObject& jo)
- : RoomEvent(typeId(), jo)
- {}
- CustomEvent(int testValue)
- : RoomEvent(typeId(),
- basicEventJson(matrixTypeId(),
- QJsonObject { { "testValue"_ls,
- toJson(testValue) } }))
- {}
-
- auto testValue() const { return contentPart<int>("testValue"_ls); }
-};
-REGISTER_EVENT_TYPE(CustomEvent)
+DEFINE_SIMPLE_EVENT(CustomEvent, RoomEvent, "quotest.custom", int, testValue)
TEST_IMPL(sendCustomEvent)
{