aboutsummaryrefslogtreecommitdiff
path: root/autotests/testfilecrypto.cpp
diff options
context:
space:
mode:
authorAlexey Rusakov <Kitsune-Ral@users.sf.net>2022-05-19 16:14:14 +0200
committerGitHub <noreply@github.com>2022-05-19 16:14:14 +0200
commit0f2c40957b438d0a2f5ce7cb2ba033bab077cbeb (patch)
treef6d147201d13885819d2c34462cf13f499fac944 /autotests/testfilecrypto.cpp
parent77b190d822c1e980b98b84999f0cfb609ed05a49 (diff)
parent5df53b8d5c8b21228ecf9938330dd4d85d3de6af (diff)
downloadlibquotient-0f2c40957b438d0a2f5ce7cb2ba033bab077cbeb.tar.gz
libquotient-0f2c40957b438d0a2f5ce7cb2ba033bab077cbeb.zip
Merge pull request #540 from TobiasFella/sendmessages
Implement sending encrypted messages
Diffstat (limited to 'autotests/testfilecrypto.cpp')
-rw-r--r--autotests/testfilecrypto.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/autotests/testfilecrypto.cpp b/autotests/testfilecrypto.cpp
new file mode 100644
index 00000000..e6bec1fe
--- /dev/null
+++ b/autotests/testfilecrypto.cpp
@@ -0,0 +1,17 @@
+// SPDX-FileCopyrightText: 2022 Tobias Fella <fella@posteo.de>
+//
+// SPDX-License-Identifier: LGPL-2.1-or-later
+
+#include "testfilecrypto.h"
+#include "events/encryptedfile.h"
+#include <qtest.h>
+
+using namespace Quotient;
+void TestFileCrypto::encryptDecryptData()
+{
+ QByteArray data = "ABCDEF";
+ auto [file, cipherText] = EncryptedFile::encryptFile(data);
+ auto decrypted = file.decryptFile(cipherText);
+ QCOMPARE(data, decrypted);
+}
+QTEST_APPLESS_MAIN(TestFileCrypto)