[pim/libkleo/release/26.08] autotests: Don't leak jobs in formattingtest

Ingo Klöcker <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit e1cb7b6cb3916fb93f51debe6c7ae2090113b881 by Ingo Klöcker, on behalf of Ingo Klöcker.
Committed on 29/07/2026 at 11:56.
Pushed by kloecker into branch 'release/26.08'.

Don't leak jobs in formattingtest

(cherry picked from commit 52920fa4c15e91af31c19164965ad706a0c27f9f)

M  +2    -2    autotests/formattingtest.cpp

https://invent.kde.org/pim/libkleo/-/commit/e1cb7b6cb3916fb93f51debe6c7ae2090113b881

diff --git a/autotests/formattingtest.cpp b/autotests/formattingtest.cpp
index 1a285f29..9b2288a9 100644
--- a/autotests/formattingtest.cpp
+++ b/autotests/formattingtest.cpp
@@ -345,11 +345,11 @@ private Q_SLOTS:
 
         const auto signedData = "signed data"_ba;
         QByteArray signature;
-        auto signJob{QGpgME::openpgp()->signJob(true, true)};
+        const std::unique_ptr<QGpgME::SignJob> signJob{QGpgME::openpgp()->signJob(true, true)};
         auto signResult = signJob->exec({key}, signedData, GpgME::Detached, signature);
         QVERIFY(!signResult.error());
 
-        auto verifyJob{QGpgME::openpgp()->verifyDetachedJob(true)};
+        const std::unique_ptr<QGpgME::VerifyDetachedJob> verifyJob{QGpgME::openpgp()->verifyDetachedJob(true)};
         const VerificationResult verificationResult = verifyJob->exec(signature, signedData);
         QVERIFY(!verificationResult.error());
         QCOMPARE(verificationResult.numSignatures(), 1);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.