From c875f07e559a7c53fc173b4c3f9f5715f3fbb8f8 Mon Sep 17 00:00:00 2001 From: Andre Heinecke Date: Thu, 25 Aug 2016 16:23:58 +0200 Subject: [PATCH] qt: Fix keyring copy in tests * 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 | 2 +- lang/qt/tests/t-support.cpp | 2 +- lang/qt/tests/t-tofuinfo.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lang/qt/tests/t-encrypt.cpp b/lang/qt/tests/t-encrypt.cpp index 44cea969..3d4cfa92 100644 --- a/lang/qt/tests/t-encrypt.cpp +++ b/lang/qt/tests/t-encrypt.cpp @@ -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: diff --git a/lang/qt/tests/t-support.cpp b/lang/qt/tests/t-support.cpp index 73e8d5c2..27c01321 100644 --- a/lang/qt/tests/t-support.cpp +++ b/lang/qt/tests/t-support.cpp @@ -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) { diff --git a/lang/qt/tests/t-tofuinfo.cpp b/lang/qt/tests/t-tofuinfo.cpp index 7eea1eae..d3061676 100644 --- a/lang/qt/tests/t-tofuinfo.cpp +++ b/lang/qt/tests/t-tofuinfo.cpp @@ -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;