[git] GPGME - branch, master, updated. gpgme-1.10.0-183-g5eb261d

by Andre Heinecke cvs at cvs.gnupg.org
Wed Apr 4 11:23:27 CEST 2018


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  5eb261d6028ab2c0ddd9af8e3e1f82e479c6109c (commit)
      from  fed024eff1091056647296ac589a0c88c2be41bb (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 5eb261d6028ab2c0ddd9af8e3e1f82e479c6109c
Author: Andre Heinecke <aheinecke at intevation.de>
Date:   Wed Apr 4 11:21:53 2018 +0200

    qt: Add test for resetting config value
    
    * lang/qt/tests/t-config.cpp (CryptoConfigTest::testDefault): New.
    
    --
    There is a bug around here somewhere. This test does not show
    it :-(

diff --git a/lang/qt/tests/t-config.cpp b/lang/qt/tests/t-config.cpp
index e04a6bb..afbb4d1 100644
--- a/lang/qt/tests/t-config.cpp
+++ b/lang/qt/tests/t-config.cpp
@@ -39,6 +39,8 @@
 #include "t-support.h"
 #include "protocol.h"
 #include "cryptoconfig.h"
+#include "engineinfo.h"
+
 #include <unistd.h>
 
 using namespace QGpgME;
@@ -51,7 +53,7 @@ private Q_SLOTS:
     void testKeyserver()
     {
         // Repeatedly set a config value and clear it
-        // this war broken at some point so it gets a
+        // this was broken at some point so it gets a
         // unit test.
         for (int i = 0; i < 10; i++) {
             auto conf = cryptoConfig();
@@ -78,6 +80,36 @@ private Q_SLOTS:
         }
     }
 
+    void testDefault()
+    {
+        if (GpgME::engineInfo(GpgME::GpgEngine).engineVersion() < "2.2.0") {
+            // We are using compliance here and other options might also
+            // be unsupported in older versions.
+            return;
+        }
+        // First set compliance to de-vs
+        auto conf = cryptoConfig();
+        QVERIFY(conf);
+        auto entry = conf->entry(QStringLiteral("gpg"),
+                QStringLiteral("Configuration"),
+                QStringLiteral("compliance"));
+        QVERIFY(entry);
+        entry->setStringValue("de-vs");
+        conf->sync(true);
+        conf->clear();
+        entry = conf->entry(QStringLiteral("gpg"),
+                QStringLiteral("Configuration"),
+                QStringLiteral("compliance"));
+        QCOMPARE(entry->stringValue(), QStringLiteral("de-vs"));
+        entry->resetToDefault();
+        conf->sync(true);
+        conf->clear();
+        entry = conf->entry(QStringLiteral("gpg"),
+                QStringLiteral("Configuration"),
+                QStringLiteral("compliance"));
+        QCOMPARE(entry->stringValue(), QStringLiteral("gnupg"));
+    }
+
     void initTestCase()
     {
         QGpgMETest::initTestCase();

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

Summary of changes:
 lang/qt/tests/t-config.cpp | 34 +++++++++++++++++++++++++++++++++-
 1 file changed, 33 insertions(+), 1 deletion(-)


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




More information about the Gnupg-commits mailing list