From afa0dd56e1cce64fe08bff3c64b12aecce54fd2d Mon Sep 17 00:00:00 2001 From: Justus Winter Date: Tue, 31 May 2016 16:21:06 +0200 Subject: python: Port more tests. * lang/python/gpgme.i: Hide length fields of notations. * lang/python/tests/Makefile.am (pytests): Add new tests. * lang/python/tests/t-decrypt-verify.py: New file. * lang/python/tests/t-sig-notation.py: Likewise. * lang/python/tests/t-verify.py: Likewise. Signed-off-by: Justus Winter --- lang/python/gpgme.i | 36 +++++++++++++++++++++++++++++++----- 1 file changed, 31 insertions(+), 5 deletions(-) (limited to 'lang/python/gpgme.i') diff --git a/lang/python/gpgme.i b/lang/python/gpgme.i index 5b3c193b..87fe90d2 100644 --- a/lang/python/gpgme.i +++ b/lang/python/gpgme.i @@ -255,11 +255,37 @@ PyObject* object_to_gpgme_t(PyObject* input, const char* objtype, int argnum) { $2 = $input; } -// Include the header file both for cc (first) and for swig (second) -// Include for swig locally since we need to fix 'class' usage there. -%{ -#include -%} +/* Include the unmodified for cc, and the cleaned-up local + version for SWIG. We do, however, want to hide certain fields on + some structs, which we provide prior to including the version for + SWIG. */ + %{ #include %} + +/* This is for notations, where we want to hide the length fields, and + the unused bit field block. */ +struct _gpgme_sig_notation +{ + struct _gpgme_sig_notation *next; + + /* If NAME is a null pointer, then VALUE contains a policy URL + rather than a notation. */ + char *name; + + /* The value of the notation data. */ + char *value; + + /* The accumulated flags. */ + gpgme_sig_notation_flags_t flags; + + /* Notation data is human-readable. */ + unsigned int human_readable : 1; + + /* Notation data is critical. */ + unsigned int critical : 1; +}; + +/* Now include our local modified version. Any structs defined above + are ignored. */ %include "gpgme.h" %include "errors.i" -- cgit v1.2.3