summaryrefslogtreecommitdiff
path: root/tests/run-tofu.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/run-tofu.c')
-rw-r--r--tests/run-tofu.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/tests/run-tofu.c b/tests/run-tofu.c
index ff55789..1f11c2d 100644
--- a/tests/run-tofu.c
+++ b/tests/run-tofu.c
@@ -14,7 +14,7 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, see <http://www.gnu.org/licenses/>.
+ * License along with this program; if not, see <https://www.gnu.org/licenses/>.
*/
/* We need to include config.h so that we know whether we are building
@@ -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);