aboutsummaryrefslogtreecommitdiff
path: root/autotests
diff options
context:
space:
mode:
authorAlexey Rusakov <Kitsune-Ral@users.sf.net>2022-09-21 21:09:49 +0200
committerAlexey Rusakov <Kitsune-Ral@users.sf.net>2022-09-26 10:46:34 +0200
commit2ff045d8b381bfbd64100d083f81b61c5fe87b23 (patch)
tree00f200e7c7547df77fd034a2bad04815c6a04495 /autotests
parentbc1ded73bedf593acda80b00eb7da32f688c4843 (diff)
downloadlibquotient-2ff045d8b381bfbd64100d083f81b61c5fe87b23.tar.gz
libquotient-2ff045d8b381bfbd64100d083f81b61c5fe87b23.zip
Wrap error reporting into facility macros
Facility macros to report Olm errors: QOLM_INTERNAL_ERROR[_X], QOLM_FAIL_OR_LOG[_X]
Diffstat (limited to 'autotests')
-rw-r--r--autotests/testgroupsession.cpp8
-rw-r--r--autotests/testolmaccount.cpp2
2 files changed, 5 insertions, 5 deletions
diff --git a/autotests/testgroupsession.cpp b/autotests/testgroupsession.cpp
index 18ace73b..1054a160 100644
--- a/autotests/testgroupsession.cpp
+++ b/autotests/testgroupsession.cpp
@@ -16,13 +16,13 @@ void TestGroupSession::groupSessionPicklingValid()
QVERIFY(QByteArray::fromBase64(ogsId).size() > 0);
QCOMPARE(0, ogs->sessionMessageIndex());
- auto ogsPickled = ogs->pickle(Unencrypted {}).value();
+ auto&& ogsPickled = ogs->pickle(Unencrypted {});
auto ogs2 =
QOlmOutboundGroupSession::unpickle(std::move(ogsPickled), Unencrypted{})
.value();
QCOMPARE(ogsId, ogs2->sessionId());
- auto igs = QOlmInboundGroupSession::create(ogs->sessionKey().value());
+ auto igs = QOlmInboundGroupSession::create(ogs->sessionKey()).value();
const auto igsId = igs->sessionId();
// ID is valid base64?
QVERIFY(QByteArray::fromBase64(igsId).size() > 0);
@@ -39,11 +39,11 @@ void TestGroupSession::groupSessionPicklingValid()
void TestGroupSession::groupSessionCryptoValid()
{
auto ogs = QOlmOutboundGroupSession::create();
- auto igs = QOlmInboundGroupSession::create(ogs->sessionKey().value());
+ auto igs = QOlmInboundGroupSession::create(ogs->sessionKey()).value();
QCOMPARE(ogs->sessionId(), igs->sessionId());
const auto plainText = "Hello world!";
- const auto ciphertext = ogs->encrypt(plainText).value();
+ const auto ciphertext = ogs->encrypt(plainText);
// ciphertext valid base64?
QVERIFY(QByteArray::fromBase64(ciphertext).size() > 0);
diff --git a/autotests/testolmaccount.cpp b/autotests/testolmaccount.cpp
index 0e1eab84..56532698 100644
--- a/autotests/testolmaccount.cpp
+++ b/autotests/testolmaccount.cpp
@@ -23,7 +23,7 @@ void TestOlmAccount::pickleUnpickledTest()
QOlmAccount olmAccount(QStringLiteral("@foo:bar.com"), QStringLiteral("QuotientTestDevice"));
olmAccount.createNewAccount();
auto identityKeys = olmAccount.identityKeys();
- auto pickled = olmAccount.pickle(Unencrypted{}).value();
+ auto pickled = olmAccount.pickle(Unencrypted{});
QOlmAccount olmAccount2(QStringLiteral("@foo:bar.com"), QStringLiteral("QuotientTestDevice"));
auto unpickleResult = olmAccount2.unpickle(std::move(pickled),
Unencrypted{});