aboutsummaryrefslogtreecommitdiffstats
path: root/common/t-support.h
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2015-10-30 11:40:22 +0000
committerWerner Koch <[email protected]>2015-10-30 11:40:22 +0000
commitd89a9fca46d9bba497dde0793b57217c800b0e8d (patch)
treec2bd329b967a9ca1a223f0d049dbbac0ffb30034 /common/t-support.h
parentcommon: Add separate header for zb32.c. (diff)
downloadgnupg-d89a9fca46d9bba497dde0793b57217c800b0e8d.tar.gz
gnupg-d89a9fca46d9bba497dde0793b57217c800b0e8d.zip
common: Improve t-zb32 to be used for manual encoding.
* common/t-support.h (no_exit_on_fail, errcount): New. (fail): Bump errcount. * common/t-zb32.c (main): Add options to allow manual use. Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'common/t-support.h')
-rw-r--r--common/t-support.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/common/t-support.h b/common/t-support.h
index 555158e26..c0d0c8c1f 100644
--- a/common/t-support.h
+++ b/common/t-support.h
@@ -69,8 +69,15 @@ void gcry_free (void *a);
#define pass() do { ; } while(0)
#define fail(a) do { fprintf (stderr, "%s:%d: test %d failed\n",\
__FILE__,__LINE__, (a)); \
- exit (1); \
+ errcount++; \
+ if (!no_exit_on_fail) \
+ exit (1); \
} while(0)
+/* If this flag is set the fail macro does not call exit. */
+static int no_exit_on_fail;
+/* Error counter. */
+static int errcount;
+
#endif /*GNUPG_COMMON_T_SUPPORT_H*/