diff options
Diffstat (limited to 'lang/qt/tests/t-various.cpp')
-rw-r--r-- | lang/qt/tests/t-various.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lang/qt/tests/t-various.cpp b/lang/qt/tests/t-various.cpp index dc5a2d1c..1e6bba41 100644 --- a/lang/qt/tests/t-various.cpp +++ b/lang/qt/tests/t-various.cpp @@ -222,6 +222,15 @@ private Q_SLOTS: QVERIFY (key.subkey(0).expirationTime() == keyExpiration); QVERIFY (key.subkey(1).expirationTime() != subkeyExpiration); + + // test error handling: calling setExpire() with the primary key as + // subkey should fail with "subkey <primary key fpr> not found" + ctx = Context::createForProtocol(key.protocol()); + std::vector<Subkey> primaryKey; + primaryKey.push_back(key.subkey(0)); + const auto err = ctx->setExpire(key, 3000, primaryKey); + QCOMPARE(err.code(), GPG_ERR_NOT_FOUND); + delete ctx; } void testVersion() |