qt: Fix keyring copy in tests
authorAndre Heinecke <aheinecke@intevation.de>
Thu, 25 Aug 2016 14:23:58 +0000 (16:23 +0200)
committerAndre Heinecke <aheinecke@intevation.de>
Thu, 25 Aug 2016 14:23:58 +0000 (16:23 +0200)
* lang/qt/test/t-encrypt.cpp,
lang/qt/test/t-tofuinfo.cpp: Assert on copy failure.
* lang/qt/test/t-support.cpp (copyKeyrings): Fix path.

lang/qt/tests/t-encrypt.cpp
lang/qt/tests/t-support.cpp
lang/qt/tests/t-tofuinfo.cpp

index 44cea96..3d4cfa9 100644 (file)
@@ -242,7 +242,7 @@ public Q_SLOT:
         Q_ASSERT(agentConf.open(QIODevice::WriteOnly));
         agentConf.write("allow-loopback-pinentry");
         agentConf.close();
-        copyKeyrings(gpgHome, mDir.path());
+        Q_ASSERT(copyKeyrings(gpgHome, mDir.path()));
     }
 
 private:
index 73e8d5c..27c0132 100644 (file)
@@ -50,7 +50,7 @@ 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)) {
+    if (!QFile::copy(src + QDir::separator() + name, dest + QDir::separator() + name)) {
         return false;
     }
     if (!is21dir) {
index 7eea1ea..d306167 100644 (file)
@@ -239,7 +239,7 @@ private Q_SLOTS:
         Q_ASSERT(agentConf.open(QIODevice::WriteOnly));
         agentConf.write("allow-loopback-pinentry");
         agentConf.close();
-        copyKeyrings(gpgHome, mDir.path());
+        Q_ASSERT(copyKeyrings(gpgHome, mDir.path()));
     }
 private:
     QTemporaryDir mDir;