diff --git a/lang/qt/tests/t-encrypt.cpp b/lang/qt/tests/t-encrypt.cpp index b0b6994c..c6fcaa21 100644 --- a/lang/qt/tests/t-encrypt.cpp +++ b/lang/qt/tests/t-encrypt.cpp @@ -71,7 +71,8 @@ private Q_SLOTS: /* Now decrypt */ auto ctx = Context::createForProtocol(OpenPGP); - ctx->setPassphraseProvider(new TestPassphraseProvider); + TestPassphraseProvider provider; + ctx->setPassphraseProvider(&provider); ctx->setPinentryMode(Context::PinentryLoopback); auto decJob = new QGpgMEDecryptJob(ctx); QByteArray plainText; @@ -84,7 +85,8 @@ private Q_SLOTS: void testSymmetricEncryptDecrypt() { auto ctx = Context::createForProtocol(OpenPGP); - ctx->setPassphraseProvider(new TestPassphraseProvider); + TestPassphraseProvider provider; + ctx->setPassphraseProvider(&provider); ctx->setPinentryMode(Context::PinentryLoopback); ctx->setArmor(true); ctx->setTextMode(true); @@ -99,7 +101,7 @@ private Q_SLOTS: killAgent(mDir.path()); auto ctx2 = Context::createForProtocol(OpenPGP); - ctx2->setPassphraseProvider(new TestPassphraseProvider); + ctx2->setPassphraseProvider(&provider); ctx2->setPinentryMode(Context::PinentryLoopback); auto decJob = new QGpgMEDecryptJob(ctx2); QByteArray plainText; diff --git a/lang/qt/tests/t-tofuinfo.cpp b/lang/qt/tests/t-tofuinfo.cpp index 83310921..3072f0fc 100644 --- a/lang/qt/tests/t-tofuinfo.cpp +++ b/lang/qt/tests/t-tofuinfo.cpp @@ -73,7 +73,8 @@ class TofuInfoTest: public QGpgMETest void signAndVerify(const QString &what, const GpgME::Key &key, int expected) { Context *ctx = Context::createForProtocol(OpenPGP); - ctx->setPassphraseProvider(new TestPassphraseProvider); + TestPassphraseProvider provider; + ctx->setPassphraseProvider(&provider); ctx->setPinentryMode(Context::PinentryLoopback); auto *job = new QGpgMESignJob(ctx);