[git] GPGME - branch, master, updated. gpgme-1.6.0-313-g053e6e0

by Andre Heinecke cvs at cvs.gnupg.org
Thu Aug 25 15:22:25 CEST 2016


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  053e6e0a7b8ea38ad9d4160c84814867bbb9fcf6 (commit)
       via  f08904b810d77d87c66d9c7875c4e7f2bde5dd92 (commit)
      from  df04b232b8897f030534f8c3fbc87064edf8ae7d (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 053e6e0a7b8ea38ad9d4160c84814867bbb9fcf6
Author: Andre Heinecke <aheinecke at intevation.de>
Date:   Thu Aug 25 15:20:02 2016 +0200

    qt: Fix tofuinfo test when gpg is gpg2
    
    * lang/qt/tests/t-support.cpp (QGpgMETest::copyKeyrings): New helper.
    * lang/qt/tests/t-support.h: Declare.
    * lang/qt/tests/t-encrypt.cpp: use it
    * lang/qt/tests/t-tofuinbo.cpp: ditto.
    
    --
    New helper takes care of copying the correct files for either
    keybox or keyring.

diff --git a/lang/qt/tests/t-encrypt.cpp b/lang/qt/tests/t-encrypt.cpp
index 708c205..44cea96 100644
--- a/lang/qt/tests/t-encrypt.cpp
+++ b/lang/qt/tests/t-encrypt.cpp
@@ -242,11 +242,7 @@ public Q_SLOT:
         Q_ASSERT(agentConf.open(QIODevice::WriteOnly));
         agentConf.write("allow-loopback-pinentry");
         agentConf.close();
-        Q_ASSERT(QFile::copy(gpgHome + QStringLiteral("/pubring.gpg"),
-                 mDir.path() + QStringLiteral("/pubring.gpg")));
-        Q_ASSERT(QFile::copy(gpgHome + QStringLiteral("/secring.gpg"),
-                 mDir.path() + QStringLiteral("/secring.gpg")));
-
+        copyKeyrings(gpgHome, mDir.path());
     }
 
 private:
diff --git a/lang/qt/tests/t-support.cpp b/lang/qt/tests/t-support.cpp
index ffb0f9e..73e8d5c 100644
--- a/lang/qt/tests/t-support.cpp
+++ b/lang/qt/tests/t-support.cpp
@@ -45,6 +45,31 @@ void QGpgMETest::cleanupTestCase()
     killAgent();
 }
 
+bool QGpgMETest::copyKeyrings(const QString &src, const QString &dest)
+{
+    bool is21dir = QFileInfo(src + QDir::separator() + QStringLiteral("pubring.kbx")).exists();
+    const QString name = is21dir ? QStringLiteral("pubring.kbx") :
+                                  QStringLiteral("pubring.gpg");
+    if (!QFile::copy(src + name, dest + QDir::separator() + name)) {
+        return false;
+    }
+    if (!is21dir) {
+        return (QFile::copy(src + QDir::separator() + QStringLiteral("secring.gpg"),
+                 dest + QDir::separator() + QStringLiteral("secring.gpg")));
+    }
+    QDir dir (src + QDir::separator() + QStringLiteral("private-keys-v1.d"));
+    QDir target(dest);
+    if (!target.mkdir("private-keys-v1.d")) {
+        return false;
+    }
+    foreach (QString f, dir.entryList(QDir::Files)) {
+        if (!QFile::copy(src + QDir::separator() + f, dest + QDir::separator() + f)) {
+            return false;
+        }
+    }
+    return true;
+}
+
 void killAgent(const QString& dir)
 {
     QProcess proc;
@@ -59,4 +84,5 @@ void killAgent(const QString& dir)
     proc.waitForFinished();
 }
 
+
 #include "t-support.hmoc"
diff --git a/lang/qt/tests/t-support.h b/lang/qt/tests/t-support.h
index cf0cb26..74163b1 100644
--- a/lang/qt/tests/t-support.h
+++ b/lang/qt/tests/t-support.h
@@ -55,6 +55,8 @@ void killAgent(const QString &dir = qgetenv("GNUPGHOME"));
 class QGpgMETest : public QObject
 {
     Q_OBJECT
+protected:
+    bool copyKeyrings(const QString &from, const QString& to);
 
 public Q_SLOTS:
     void initTestCase();
diff --git a/lang/qt/tests/t-tofuinfo.cpp b/lang/qt/tests/t-tofuinfo.cpp
index ab466ee..7eea1ea 100644
--- a/lang/qt/tests/t-tofuinfo.cpp
+++ b/lang/qt/tests/t-tofuinfo.cpp
@@ -239,11 +239,7 @@ private Q_SLOTS:
         Q_ASSERT(agentConf.open(QIODevice::WriteOnly));
         agentConf.write("allow-loopback-pinentry");
         agentConf.close();
-        Q_ASSERT(QFile::copy(gpgHome + QStringLiteral("/pubring.gpg"),
-                 mDir.path() + QStringLiteral("/pubring.gpg")));
-        Q_ASSERT(QFile::copy(gpgHome + QStringLiteral("/secring.gpg"),
-                 mDir.path() + QStringLiteral("/secring.gpg")));
-
+        copyKeyrings(gpgHome, mDir.path());
     }
 private:
     QTemporaryDir mDir;

commit f08904b810d77d87c66d9c7875c4e7f2bde5dd92
Author: Andre Heinecke <aheinecke at intevation.de>
Date:   Thu Aug 25 15:00:46 2016 +0200

    qt: Remove unused variable in test
    
    * t-wkspublish.cpp (testWKSPublishCreate): Remove context.

diff --git a/lang/qt/tests/t-wkspublish.cpp b/lang/qt/tests/t-wkspublish.cpp
index 7039f3c..17d3447 100644
--- a/lang/qt/tests/t-wkspublish.cpp
+++ b/lang/qt/tests/t-wkspublish.cpp
@@ -39,7 +39,6 @@
 #include "importresult.h"
 #include "protocol.h"
 #include "engineinfo.h"
-#include "context.h"
 
 #include "t-support.h"
 
@@ -177,7 +176,6 @@ private:
             /* Not supported */
             return;
         }
-        auto ctx = Context::createForProtocol(OpenPGP);
         /* First generate a test key */
         const QString args = QStringLiteral("<GnupgKeyParms format=\"internal\">\n"
                                         "%no-protection\n"

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

Summary of changes:
 lang/qt/tests/t-encrypt.cpp    |  6 +-----
 lang/qt/tests/t-support.cpp    | 26 ++++++++++++++++++++++++++
 lang/qt/tests/t-support.h      |  2 ++
 lang/qt/tests/t-tofuinfo.cpp   |  6 +-----
 lang/qt/tests/t-wkspublish.cpp |  2 --
 5 files changed, 30 insertions(+), 12 deletions(-)


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




More information about the Gnupg-commits mailing list