From d89a9fca46d9bba497dde0793b57217c800b0e8d Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Fri, 30 Oct 2015 12:40:22 +0100 Subject: 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 --- common/t-support.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'common/t-support.h') 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*/ -- cgit