From f209ec8f581ae597b37f2e3a5e452e4b53b2d4c7 Mon Sep 17 00:00:00 2001 From: Andre Heinecke Date: Tue, 9 Aug 2016 14:10:15 +0200 Subject: Qt: Add encryption test and refactor testsuite * lang/qt/tests/Makefile.am: Add t-encrypt and t-support. * lang/qt/tests/t-support.cpp, lang/qt/tests/t-support.c (QGpgMETest): New. Class to handle common cleanup / init. * lang/qt/tests/t-keylist.cpp, lang/qt/tests/t-keylocate.cpp, lang/qt/tests/t-ownertrust.cpp, lang/qt/tests/t-tofuinfo.cpp: Inherit QGpgMETest. * lang/qt/tests/t-encrypt.cpp: New. Test Symetric and Asymectric encryption. Mixed encryption test is disabled. --- lang/qt/tests/t-support.h | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'lang/qt/tests/t-support.h') diff --git a/lang/qt/tests/t-support.h b/lang/qt/tests/t-support.h index 8755b998..cf0cb26e 100644 --- a/lang/qt/tests/t-support.h +++ b/lang/qt/tests/t-support.h @@ -28,9 +28,14 @@ you do not wish to do so, delete this exception statement from your version. */ +#ifndef T_SUPPORT_H +#define T_SUPPORT_H #include "interfaces/passphraseprovider.h" #include +#include +#include +#include namespace GpgME { @@ -43,5 +48,17 @@ public: return strdup("abc"); } }; - } // namespace GpgME + +void killAgent(const QString &dir = qgetenv("GNUPGHOME")); + +class QGpgMETest : public QObject +{ + Q_OBJECT + +public Q_SLOTS: + void initTestCase(); + void cleanupTestCase(); +}; + +#endif // T_SUPPORT_H -- cgit v1.2.3