[git] GPGME - branch, master, updated. gpgme-1.9.0-7-g2c063a8

by Andre Heinecke cvs at cvs.gnupg.org
Thu Mar 30 14:45:10 CEST 2017


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GnuPG Made Easy".

The branch, master has been updated
       via  2c063a8d60418ee59ae80da221420c6f3fa19abb (commit)
      from  9786e3a96e6772166f3523e74a748b9db20fae7c (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 2c063a8d60418ee59ae80da221420c6f3fa19abb
Author: Andre Heinecke <aheinecke at intevation.de>
Date:   Thu Mar 30 14:36:49 2017 +0200

    qt: Handle if gpg does not support tofu in test
    
    * lang/qt/src/t-tofuinfo.cpp (TestTofuInfo::testSupported): Treat
    it as unsupported if secret keylisting already fails.
    
    --
    The likely cause of this is that the agent can't be started
    because the trust model is unsupported. Other tests check
    that keylisting actually works.

diff --git a/lang/qt/tests/t-tofuinfo.cpp b/lang/qt/tests/t-tofuinfo.cpp
index e16b1fd..8d040bc 100644
--- a/lang/qt/tests/t-tofuinfo.cpp
+++ b/lang/qt/tests/t-tofuinfo.cpp
@@ -118,7 +118,24 @@ Q_SIGNALS:
 private:
     bool testSupported()
     {
-        return !(GpgME::engineInfo(GpgME::GpgEngine).engineVersion() < "2.1.16");
+        static bool initialized, supported;
+        if (initialized) {
+            return supported;
+        }
+        initialized = true;
+        if (GpgME::engineInfo(GpgME::GpgEngine).engineVersion() < "2.1.16") {
+            return false;
+        }
+        // If the keylist fails here this means that gnupg does not
+        // support tofu at all. It can be disabled at compile time. So no
+        // tests.
+        auto *job = openpgp()->keyListJob(false, false, false);
+        job->addMode(GpgME::WithTofu);
+        std::vector<GpgME::Key> keys;
+        job->exec(QStringList() << QStringLiteral("zulu at example.net"), true, keys);
+        delete job;
+        supported = !keys.empty();
+        return supported;
     }
 
     void testTofuCopy(TofuInfo other, const TofuInfo &orig)
@@ -402,6 +419,10 @@ private Q_SLOTS:
 
     void testTofuConflict()
     {
+        if (!testSupported()) {
+            return;
+        }
+
         if (GpgME::engineInfo(GpgME::GpgEngine).engineVersion() < "2.1.19") {
             return;
         }

-----------------------------------------------------------------------

Summary of changes:
 lang/qt/tests/t-tofuinfo.cpp | 23 ++++++++++++++++++++++-
 1 file changed, 22 insertions(+), 1 deletion(-)


hooks/post-receive
-- 
GnuPG Made Easy
http://git.gnupg.org




More information about the Gnupg-commits mailing list