diff --git a/tests/kgpginterface.cpp b/tests/kgpginterface.cpp index f02fd874..6e5ac844 100644 --- a/tests/kgpginterface.cpp +++ b/tests/kgpginterface.cpp @@ -1,40 +1,41 @@ #include "kgpginterface.h" #include "../kgpginterface.h" #include "common.h" #include +#include void KGpgInterfaceTest::init() { QVERIFY(resetGpgConf()); } void KGpgInterfaceTest::testReadPublicKeys() { addGpgKey(QLatin1String("keys/kgpgtest_BA7695F3C550DF14_pub.asc")); KgpgCore::KgpgKeyList keys = KgpgInterface::readPublicKeys(); QString fingerprint = QLatin1String("FBAF 08DD 7D9D 0921 C15D DA9F BA76 95F3 C550 DF14"); QCOMPARE(keys.size(), 1); KgpgCore::KgpgKey key = keys.first(); QVERIFY(fingerprint.compare(key.fingerprint())); } void KGpgInterfaceTest::testReadSecretKeys() { addGpgKey(QLatin1String("keys/kgpgtest_BA7695F3C550DF14.asc"), readFile(QLatin1String("keys/kgpgtest_BA7695F3C550DF14.pass"))); KgpgCore::KgpgKeyList keys = KgpgInterface::readSecretKeys(); QString keyID = QLatin1String("BA7695F3C550DF14"); QCOMPARE(keys.size(), 1); QVERIFY(keys.first().fullId().compare(keyID) == 0); } void KGpgInterfaceTest::testReadEmptyKeyring() { KgpgCore::KgpgKeyList keys = KgpgInterface::readSecretKeys(); KgpgCore::KgpgKeyList pub_keys = KgpgInterface::readPublicKeys(); QCOMPARE(keys.size(), 0); QCOMPARE(pub_keys.size(), 0); } QTEST_MAIN(KGpgInterfaceTest) diff --git a/tests/kgpginterface.h b/tests/kgpginterface.h index 57b6d34b..d55554a9 100644 --- a/tests/kgpginterface.h +++ b/tests/kgpginterface.h @@ -1,16 +1,16 @@ #ifndef KGPG_INTERFACE_TEST_H #define KGPG_INTERFACE_TEST_H -#include + +#include class KGpgInterfaceTest: public QObject { Q_OBJECT private slots: void init(); void testReadPublicKeys(); void testReadSecretKeys(); void testReadEmptyKeyring(); }; - #endif