diff options
author | Carl Schwan <carl@carlschwan.eu> | 2021-06-10 18:41:39 +0200 |
---|---|---|
committer | Tobias Fella <fella@posteo.de> | 2021-12-01 21:56:11 +0100 |
commit | fc531b625efa3f0c0ceebed3c23a3d185d398a4d (patch) | |
tree | ed66f844e315d13216164db311c41f0de77a5993 | |
parent | 9bf12da8aaa1b2005d9d7d8eae4269c8a9bf1c08 (diff) | |
download | libquotient-fc531b625efa3f0c0ceebed3c23a3d185d398a4d.tar.gz libquotient-fc531b625efa3f0c0ceebed3c23a3d185d398a4d.zip |
Fix tests
-rw-r--r-- | autotests/testolmaccount.cpp | 6 | ||||
-rw-r--r-- | lib/crypto/qolmaccount.cpp | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/autotests/testolmaccount.cpp b/autotests/testolmaccount.cpp index 9195bb62..192c97ac 100644 --- a/autotests/testolmaccount.cpp +++ b/autotests/testolmaccount.cpp @@ -300,13 +300,14 @@ void TestOlmAccount::queryTest() QCOMPARE(aliceRes->oneTimeKeyCounts()["signed_curve25519"], 1); }); QSignalSpy spy(aliceRes, &BaseJob::result); - bob->run(aliceRes); + alice->run(aliceRes); QVERIFY(spy.wait(10000)); auto bobOlm = bob->olmAccount(); bobOlm->generateOneTimeKeys(1); - auto bobRes = aliceOlm->createUploadKeyRequest(aliceOlm->oneTimeKeys()); + auto bobRes = bobOlm->createUploadKeyRequest(aliceOlm->oneTimeKeys()); connect(bobRes, &BaseJob::result, this, [bobRes] { + QCOMPARE(bobRes->oneTimeKeyCounts().size(), 1); QCOMPARE(bobRes->oneTimeKeyCounts()["signed_curve25519"], 1); }); @@ -347,7 +348,6 @@ void TestOlmAccount::queryTest() QVERIFY(bobDevices.size() > 0); auto devKeys = bobDevices[alice->deviceId()]; - qDebug() << bobDevices.keys(); QCOMPARE(devKeys.userId, alice->userId()); QCOMPARE(devKeys.deviceId, alice->deviceId()); QCOMPARE(devKeys.keys, aliceOlm->deviceKeys().keys); diff --git a/lib/crypto/qolmaccount.cpp b/lib/crypto/qolmaccount.cpp index 8cf21045..6b7bc9a9 100644 --- a/lib/crypto/qolmaccount.cpp +++ b/lib/crypto/qolmaccount.cpp @@ -253,7 +253,7 @@ UploadKeysJob *QOlmAccount::createUploadKeyRequest(const OneTimeKeys &oneTimeKey auto temp = signOneTimeKeys(oneTimeKeys); QHash<QString, QVariant> oneTimeKeysSigned; for (const auto &[keyId, key] : asKeyValueRange(temp)) { - oneTimeKeysSigned[keyId] = QVariant::fromValue(key); + oneTimeKeysSigned[keyId] = QVariant::fromValue(toJson(key)); } return new UploadKeysJob(keys, oneTimeKeysSigned); |