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.
This commit is contained in:
Andre Heinecke 2016-08-25 16:23:58 +02:00
parent 4e37d0bb12
commit c875f07e55
3 changed files with 3 additions and 3 deletions

View File

@ -242,7 +242,7 @@ public Q_SLOT:
Q_ASSERT(agentConf.open(QIODevice::WriteOnly)); Q_ASSERT(agentConf.open(QIODevice::WriteOnly));
agentConf.write("allow-loopback-pinentry"); agentConf.write("allow-loopback-pinentry");
agentConf.close(); agentConf.close();
copyKeyrings(gpgHome, mDir.path()); Q_ASSERT(copyKeyrings(gpgHome, mDir.path()));
} }
private: private:

View File

@ -50,7 +50,7 @@ bool QGpgMETest::copyKeyrings(const QString &src, const QString &dest)
bool is21dir = QFileInfo(src + QDir::separator() + QStringLiteral("pubring.kbx")).exists(); bool is21dir = QFileInfo(src + QDir::separator() + QStringLiteral("pubring.kbx")).exists();
const QString name = is21dir ? QStringLiteral("pubring.kbx") : const QString name = is21dir ? QStringLiteral("pubring.kbx") :
QStringLiteral("pubring.gpg"); 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; return false;
} }
if (!is21dir) { if (!is21dir) {

View File

@ -239,7 +239,7 @@ private Q_SLOTS:
Q_ASSERT(agentConf.open(QIODevice::WriteOnly)); Q_ASSERT(agentConf.open(QIODevice::WriteOnly));
agentConf.write("allow-loopback-pinentry"); agentConf.write("allow-loopback-pinentry");
agentConf.close(); agentConf.close();
copyKeyrings(gpgHome, mDir.path()); Q_ASSERT(copyKeyrings(gpgHome, mDir.path()));
} }
private: private:
QTemporaryDir mDir; QTemporaryDir mDir;