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 /autotests/callcandidateseventtest.cpp | |
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 'autotests/callcandidateseventtest.cpp')
-rw-r--r-- | autotests/callcandidateseventtest.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/autotests/callcandidateseventtest.cpp b/autotests/callcandidateseventtest.cpp index 0d5a543b..257e0ef2 100644 --- a/autotests/callcandidateseventtest.cpp +++ b/autotests/callcandidateseventtest.cpp @@ -2,7 +2,7 @@ // // SPDX-License-Identifier: LGPL-2.1-or-later -#include "events/callcandidatesevent.h" +#include "events/callevents.h" #include <QtTest/QtTest> @@ -40,13 +40,16 @@ void TestCallCandidatesEvent::fromJson() auto object = document.object(); - Quotient::CallCandidatesEvent callCandidatesEvent(object); + using namespace Quotient; + const auto& callCandidatesEvent = loadEvent<CallCandidatesEvent>(object); + QVERIFY(callCandidatesEvent); + QVERIFY(callCandidatesEvent->is<CallCandidatesEvent>()); - QCOMPARE(callCandidatesEvent.version(), 0); - QCOMPARE(callCandidatesEvent.callId(), QStringLiteral("12345")); - QCOMPARE(callCandidatesEvent.candidates().count(), 1); + QCOMPARE(callCandidatesEvent->version(), 0); + QCOMPARE(callCandidatesEvent->callId(), QStringLiteral("12345")); + QCOMPARE(callCandidatesEvent->candidates().count(), 1); - const QJsonObject &candidate = callCandidatesEvent.candidates().at(0).toObject(); + const auto& candidate = callCandidatesEvent->candidates().at(0).toObject(); QCOMPARE(candidate.value("sdpMid").toString(), QStringLiteral("audio")); QCOMPARE(candidate.value("sdpMLineIndex").toInt(), 0); QCOMPARE(candidate.value("candidate").toString(), |