From 4e0fe24681daef069abde3448c26f5cb850d8bb7 Mon Sep 17 00:00:00 2001 From: Carl Schwan Date: Sun, 24 Jan 2021 20:13:16 +0100 Subject: Update test --- autotests/testgroupsession.cpp | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/autotests/testgroupsession.cpp b/autotests/testgroupsession.cpp index 02892366..1cfe38a9 100644 --- a/autotests/testgroupsession.cpp +++ b/autotests/testgroupsession.cpp @@ -12,27 +12,26 @@ using namespace Quotient; void TestOlmSession::groupSessionPicklingValid() { - auto ogs = std::get(QOlmOutboundGroupSession::create()); - const auto ogsId = std::get(ogs.sessionId()); + auto ogs = QOlmOutboundGroupSession::create(); + const auto ogsId = std::get(ogs->sessionId()); QVERIFY(QByteArray::fromBase64Encoding(ogsId).decodingStatus == QByteArray::Base64DecodingStatus::Ok); - QCOMPARE(0, ogs.sessionMessageIndex()); + QCOMPARE(0, ogs->sessionMessageIndex()); - auto ogsPickled = std::get(ogs.pickle(Unencrypted {})); - ogs = std::get(QOlmOutboundGroupSession::unpickle(ogsPickled, Unencrypted {})); - QCOMPARE(ogsId, std::get(ogs.sessionId())); + auto ogsPickled = std::get(ogs->pickle(Unencrypted {})); + auto ogs2 = std::get>(QOlmOutboundGroupSession::unpickle(ogsPickled, Unencrypted {})); + QCOMPARE(ogsId, std::get(ogs2->sessionId())); - qDebug() << std::get(ogs.sessionKey()); - auto igs = std::get(QOlmInboundGroupSession::create(std::get(ogs.sessionKey()))); - const auto igsId = std::get(igs.sessionId()); + auto igs = QOlmInboundGroupSession::create(std::get(ogs->sessionKey())); + const auto igsId = igs->sessionId(); // ID is valid base64? QVERIFY(QByteArray::fromBase64Encoding(igsId).decodingStatus == QByteArray::Base64DecodingStatus::Ok); //// no messages have been sent yet - QCOMPARE(0, igs.firstKnownIndex()); + QCOMPARE(0, igs->firstKnownIndex()); - auto igsPickled = std::get(igs.pickle(Unencrypted {})); - igs = std::get(QOlmInboundGroupSession::unpickle(igsPickled, Unencrypted {})); - QCOMPARE(igsId, std::get(igs.sessionId())); + auto igsPickled = igs->pickle(Unencrypted {}); + igs = std::get>(QOlmInboundGroupSession::unpickle(igsPickled, Unencrypted {})); + QCOMPARE(igsId, igs->sessionId()); } QTEST_MAIN(TestOlmSession) -- cgit v1.2.3