From 587b26019beb51aadb4cd245e622774a90442966 Mon Sep 17 00:00:00 2001 From: Saturneric Date: Thu, 10 Jun 2021 04:14:21 +0800 Subject: Adjust the project structure. Write a readme. Signed-off-by: Saturneric --- test/testgpgcontext.cpp | 62 ------------------------------------------------- 1 file changed, 62 deletions(-) delete mode 100644 test/testgpgcontext.cpp (limited to 'test/testgpgcontext.cpp') diff --git a/test/testgpgcontext.cpp b/test/testgpgcontext.cpp deleted file mode 100644 index 4435bff1..00000000 --- a/test/testgpgcontext.cpp +++ /dev/null @@ -1,62 +0,0 @@ -#include -#include -#include <../gpgcontext.h> - -/** -* unit test for gpgcontext, -* have a look at http://doc.qt.nokia.com/latest/qtestlib-tutorial1.html -*/ -class TestGpgContext : public QObject -{ - Q_OBJECT - -public: - TestGpgContext(); - -private: - GpgME::GpgContext* mCtx; - -private slots: - void passwordSize(); - -}; - -TestGpgContext::TestGpgContext() { - mCtx = new GpgME::GpgContext(); -} - -void TestGpgContext::passwordSize() { - - QVERIFY(mCtx->listKeys().size() == 0); - - qDebug() << "import:"; - QFile* file = new QFile("../testdata/seckey-1.asc"); - file->open(QIODevice::ReadOnly); - mCtx->importKey(file->readAll()); - - qDebug() << "list:"; - foreach(GpgKey key, mCtx->listKeys()) { - qDebug() << key.id; - } - - QVERIFY(mCtx->listKeys().size() == 1); - - QString password = "abcabc"; - QString params = "\n" - "Key-Type: DSA\n" - "Key-Length: 1024\n" - "Subkey-Type: ELG-E\n" - "Subkey-Length: 1024\n" - "Name-Real: testa\n" - "Expire-Date: 0\n"; - "Passphrase: " + password + "\n" - ""; - - /*qDebug() << "gen:"; - mCtx->generateKey(¶ms); - QVERIFY(mCtx->listKeys().size() == 1); - qDebug() << "done.";*/ -} - -QTEST_MAIN(TestGpgContext) -#include "testgpgcontext.moc" -- cgit v1.2.3