aboutsummaryrefslogtreecommitdiffstats
path: root/lang/qt/tests/t-changeexpiryjob.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lang/qt/tests/t-changeexpiryjob.cpp')
-rw-r--r--lang/qt/tests/t-changeexpiryjob.cpp35
1 files changed, 5 insertions, 30 deletions
diff --git a/lang/qt/tests/t-changeexpiryjob.cpp b/lang/qt/tests/t-changeexpiryjob.cpp
index e20d1be2..090002f3 100644
--- a/lang/qt/tests/t-changeexpiryjob.cpp
+++ b/lang/qt/tests/t-changeexpiryjob.cpp
@@ -76,12 +76,7 @@ private Q_SLOTS:
// Create the job
auto job = std::unique_ptr<ChangeExpiryJob>{openpgp()->changeExpiryJob()};
QVERIFY(job);
-
- // Hack in the passphrase provider
- auto jobCtx = Job::context(job.get());
- TestPassphraseProvider provider;
- jobCtx->setPassphraseProvider(&provider);
- jobCtx->setPinentryMode(Context::PinentryLoopback);
+ hookUpPassphraseProvider(job.get());
// Use defaults of job
@@ -144,12 +139,7 @@ private Q_SLOTS:
// Create the job
auto job = std::unique_ptr<ChangeExpiryJob>{openpgp()->changeExpiryJob()};
QVERIFY(job);
-
- // Hack in the passphrase provider
- auto jobCtx = Job::context(job.get());
- TestPassphraseProvider provider;
- jobCtx->setPassphraseProvider(&provider);
- jobCtx->setPinentryMode(Context::PinentryLoopback);
+ hookUpPassphraseProvider(job.get());
// Use defaults of job
@@ -212,12 +202,7 @@ private Q_SLOTS:
// Create the job
auto job = std::unique_ptr<ChangeExpiryJob>{openpgp()->changeExpiryJob()};
QVERIFY(job);
-
- // Hack in the passphrase provider
- auto jobCtx = Job::context(job.get());
- TestPassphraseProvider provider;
- jobCtx->setPassphraseProvider(&provider);
- jobCtx->setPinentryMode(Context::PinentryLoopback);
+ hookUpPassphraseProvider(job.get());
// Set up the job
job->setOptions(ChangeExpiryJob::UpdatePrimaryKey);
@@ -280,12 +265,7 @@ private Q_SLOTS:
// Create the job
auto job = std::unique_ptr<ChangeExpiryJob>{openpgp()->changeExpiryJob()};
QVERIFY(job);
-
- // Hack in the passphrase provider
- auto jobCtx = Job::context(job.get());
- TestPassphraseProvider provider;
- jobCtx->setPassphraseProvider(&provider);
- jobCtx->setPinentryMode(Context::PinentryLoopback);
+ hookUpPassphraseProvider(job.get());
// Set up the job
job->setOptions(ChangeExpiryJob::UpdatePrimaryKey);
@@ -353,12 +333,7 @@ private Q_SLOTS:
// Create the job
auto job = std::unique_ptr<ChangeExpiryJob>{openpgp()->changeExpiryJob()};
QVERIFY(job);
-
- // Hack in the passphrase provider
- auto jobCtx = Job::context(job.get());
- TestPassphraseProvider provider;
- jobCtx->setPassphraseProvider(&provider);
- jobCtx->setPinentryMode(Context::PinentryLoopback);
+ hookUpPassphraseProvider(job.get());
// Set up the job
job->setOptions(ChangeExpiryJob::UpdatePrimaryKey | ChangeExpiryJob::UpdateAllSubkeys);