aboutsummaryrefslogtreecommitdiffstats
path: root/lang/qt/tests/t-support.h
diff options
context:
space:
mode:
authorIngo Klöcker <[email protected]>2021-12-13 09:48:52 +0000
committerIngo Klöcker <[email protected]>2021-12-13 09:48:52 +0000
commited7e7df2e14feb443e84d87e518ff61b1f7aa6d8 (patch)
treefc292441ad64e0c4313c13a16ce98be8b9b4119f /lang/qt/tests/t-support.h
parentqt: Fix example for using the asynchronous job API (diff)
downloadgpgme-ed7e7df2e14feb443e84d87e518ff61b1f7aa6d8.tar.gz
gpgme-ed7e7df2e14feb443e84d87e518ff61b1f7aa6d8.zip
qt: Support WKD lookup without implicit import
* lang/qt/src/Makefile.am (qgpgme_sources): Add qgpgmewkdlookupjob.cpp, wkdlookupresult.cpp. (qgpgme_headers): Add wkdlookupjob.h, wkdlookupresult.h. (camelcase_headers): Add WKDLookupJob, WKDLookupResult. (private_qgpgme_headers): Add qgpgmewkdlookupjob.h. (qgpgme_moc_sources): Add qgpgmewkdlookupjob.moc, wkdlookupjob.moc. * lang/qt/src/job.cpp: Define c'tor and d'tor of WKDLookupJob. * lang/qt/src/protocol.h (Protocol::wkdLookupJob): New. * lang/qt/src/protocol_p.h (Protocol::wkdLookupJob): New. * lang/qt/src/qgpgmewkdlookupjob.cpp, lang/qt/src/qgpgmewkdlookupjob.h, lang/qt/src/wkdlookupjob.h, lang/qt/src/wkdlookupresult.cpp, lang/qt/src/wkdlookupresult.h: New. * lang/qt/tests/Makefile.am (EXTRA_DIST): Add final.test. (the_tests): New. (TESTS): Remove all t-*. Add $(the_tests) and final.test. (moc_files): Add t-wkdlookup.moc. (t_wkdlookup_SOURCES): New. (noinst_PROGRAMS): Add t-wkdlookup. * lang/qt/tests/final.test: New. * lang/qt/tests/t-support.h (QTest::toString): New template specialization for std::string. * lang/qt/tests/t-wkdlookup.cpp: New. -- The new WKDLookupJob allows running a WKD lookup without implicit import of the retrieved key. This makes it possible to do WKD lookups similar to keyserver lookups (aka external keylistings). The new final.test pseudo test stops a dirmngr that may have been started by the tests. The toString() template specialization enables printing of the actual and expected values in case of failed QCOMPARE. GnuPG-bug-id: 5728
Diffstat (limited to 'lang/qt/tests/t-support.h')
-rw-r--r--lang/qt/tests/t-support.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/lang/qt/tests/t-support.h b/lang/qt/tests/t-support.h
index 77bef56d..22ba473c 100644
--- a/lang/qt/tests/t-support.h
+++ b/lang/qt/tests/t-support.h
@@ -34,9 +34,19 @@
#include "interfaces/passphraseprovider.h"
#include <QObject>
+#include <QTest>
#include <gpg-error.h>
+namespace QTest
+{
+template <>
+inline char *toString(const std::string &s)
+{
+ return QTest::toString(s.c_str());
+}
+}
+
namespace GpgME
{
class TestPassphraseProvider : public PassphraseProvider