From 6cec450f1d749936bd51a1471ac0ed74f633ef66 Mon Sep 17 00:00:00 2001
From: Tobias Fella <fella@posteo.de>
Date: Fri, 10 Dec 2021 00:26:03 +0100
Subject: Fix compilation of tests against older qt

---
 autotests/testgroupsession.cpp | 6 +++---
 autotests/testolmaccount.cpp   | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/autotests/testgroupsession.cpp b/autotests/testgroupsession.cpp
index afd5ef81..5024ccea 100644
--- a/autotests/testgroupsession.cpp
+++ b/autotests/testgroupsession.cpp
@@ -13,7 +13,7 @@ void TestOlmSession::groupSessionPicklingValid()
 {
     auto ogs = QOlmOutboundGroupSession::create();
     const auto ogsId = ogs->sessionId();
-    QVERIFY(QByteArray::fromBase64Encoding(ogsId).decodingStatus == QByteArray::Base64DecodingStatus::Ok);
+    QVERIFY(QByteArray::fromBase64(ogsId).size() > 0);
     QCOMPARE(0, ogs->sessionMessageIndex());
 
     auto ogsPickled = std::get<QByteArray>(ogs->pickle(Unencrypted {}));
@@ -23,7 +23,7 @@ void TestOlmSession::groupSessionPicklingValid()
     auto igs = QOlmInboundGroupSession::create(std::get<QByteArray>(ogs->sessionKey()));
     const auto igsId = igs->sessionId();
     // ID is valid base64?
-    QVERIFY(QByteArray::fromBase64Encoding(igsId).decodingStatus == QByteArray::Base64DecodingStatus::Ok);
+    QVERIFY(QByteArray::fromBase64(igsId).size() > 0);
 
     //// no messages have been sent yet
     QCOMPARE(0, igs->firstKnownIndex());
@@ -42,7 +42,7 @@ void TestOlmSession::groupSessionCryptoValid()
     const auto plainText = QStringLiteral("Hello world!");
     const auto ciphertext = std::get<QByteArray>(ogs->encrypt(plainText));
     // ciphertext valid base64?
-    QVERIFY(QByteArray::fromBase64Encoding(ciphertext).decodingStatus == QByteArray::Base64DecodingStatus::Ok);
+    QVERIFY(QByteArray::fromBase64(ciphertext).size() > 0);
 
     const auto decryptionResult = std::get<std::pair<QString, uint32_t>>(igs->decrypt(ciphertext));
 
diff --git a/autotests/testolmaccount.cpp b/autotests/testolmaccount.cpp
index 22c457aa..f0fcfe58 100644
--- a/autotests/testolmaccount.cpp
+++ b/autotests/testolmaccount.cpp
@@ -46,8 +46,8 @@ void TestOlmAccount::identityKeysValid()
     QCOMPARE(ed25519.size(), 43);
 
     // encoded as valid base64?
-    QVERIFY(QByteArray::fromBase64Encoding(curve25519).decodingStatus == QByteArray::Base64DecodingStatus::Ok);
-    QVERIFY(QByteArray::fromBase64Encoding(ed25519).decodingStatus == QByteArray::Base64DecodingStatus::Ok);
+    QVERIFY(QByteArray::fromBase64(curve25519).size() > 0);
+    QVERIFY(QByteArray::fromBase64(ed25519).size() > 0);
 }
 
 void TestOlmAccount::signatureValid()
@@ -56,7 +56,7 @@ void TestOlmAccount::signatureValid()
     olmAccount.createNewAccount();
     const auto message = "Hello world!";
     const auto signature = olmAccount.sign(message);
-    QVERIFY(QByteArray::fromBase64Encoding(signature).decodingStatus == QByteArray::Base64DecodingStatus::Ok);
+    QVERIFY(QByteArray::fromBase64(signature).size() > 0);
 
     QOlmUtility utility;
     const auto identityKeys = olmAccount.identityKeys();
-- 
cgit v1.2.3