aboutsummaryrefslogtreecommitdiffstats
path: root/lang/cpp/tests/run-keylist.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lang/cpp/tests/run-keylist.cpp')
-rw-r--r--lang/cpp/tests/run-keylist.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/lang/cpp/tests/run-keylist.cpp b/lang/cpp/tests/run-keylist.cpp
index 9446257f..852e321d 100644
--- a/lang/cpp/tests/run-keylist.cpp
+++ b/lang/cpp/tests/run-keylist.cpp
@@ -141,6 +141,12 @@ main (int argc, char **argv)
return -1;
}
ctx->setKeyListMode (mode);
+ if (ctx->keyListMode() != mode) {
+ // unfortunately, Context::setKeyListMode() does not return the error
+ // returned by gpgme
+ std::cerr << "Failed to set keylist mode. You may have used an invalid combination of options.\n";
+ return -1;
+ }
Error err = ctx->startKeyListing (*argv, only_secret);
if (err) {
std::cout << "Error: " << err.asString() << "\n";