aboutsummaryrefslogtreecommitdiffstats
path: root/tests/run-tofu.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2016-11-15 08:24:17 +0000
committerWerner Koch <[email protected]>2016-11-15 08:24:17 +0000
commit3234b1bf1d6939772677d64f6c1e1820ec98e3cd (patch)
treee3c6a0b6666bed4ef10f78b73a2e5a985de99d65 /tests/run-tofu.c
parentcore: Enable extraction of session keys. (diff)
downloadgpgme-3234b1bf1d6939772677d64f6c1e1820ec98e3cd.tar.gz
gpgme-3234b1bf1d6939772677d64f6c1e1820ec98e3cd.zip
core: Add public function gpgme_get_ctx_flag.
* src/gpgme.h.in (gpgme_get_ctx_flag): New. * src/gpgme.c (gpgme_set_ctx_flag): Move down the file and add a trace statement. (gpgme_get_ctx_flag): New. * src/gpgme.def, src/libgpgme.vers: Add new interface. Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'tests/run-tofu.c')
-rw-r--r--tests/run-tofu.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/run-tofu.c b/tests/run-tofu.c
index ff557893..9e3b1172 100644
--- a/tests/run-tofu.c
+++ b/tests/run-tofu.c
@@ -99,6 +99,7 @@ main (int argc, char **argv)
const char *fpr;
const char *policystr = NULL;
gpgme_tofu_policy_t policy;
+ const char *s;
if (argc)
{ argc--; argv++; }
@@ -145,10 +146,31 @@ main (int argc, char **argv)
fail_if_err (err);
gpgme_set_protocol (ctx, protocol);
gpgme_set_armor (ctx, 1);
+
+
+ s = gpgme_get_ctx_flag (ctx, "no_such-flag");
+ if (s)
+ {
+ fprintf (stderr, PGM ": gpgme_get_ctx_flag failed "
+ "(bad name not detected)\n");
+ exit (1);
+ }
+ s = gpgme_get_ctx_flag (ctx, "full-status");
+ if (!s || *s)
+ {
+ fprintf (stderr, PGM ": gpgme_get_ctx_flag failed (wrong false)\n");
+ exit (1);
+ }
if (print_status)
{
gpgme_set_status_cb (ctx, status_cb, NULL);
gpgme_set_ctx_flag (ctx, "full-status", "1");
+ s = gpgme_get_ctx_flag (ctx, "full-status");
+ if (!s || strcmp (s, "1"))
+ {
+ fprintf (stderr, PGM ": gpgme_get_ctx_flag fauled (wrong true)\n");
+ exit (1);
+ }
}
err = gpgme_get_key (ctx, fpr, &thekey, 0);