1
/* t-support.h - Helper for the regression tests
2
* Copyright (C) 2007 Free Software Foundation, Inc.
4
* This file is part of JNLIB.
6
* JNLIB is free software; you can redistribute it and/or modify it
7
* under the terms of the GNU Lesser General Public License as
8
* published by the Free Software Foundation; either version 3 of
9
* the License, or (at your option) any later version.
11
* JNLIB is distributed in the hope that it will be useful, but
12
* WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
* Lesser General Public License for more details.
16
* You should have received a copy of the GNU Lesser General Public
17
* License along with this program; if not, see <http://www.gnu.org/licenses/>.
20
#ifndef LIBJNLIB_T_SUPPORT_H
21
#define LIBJNLIB_T_SUPPORT_H 1
24
#error The regression tests should not include with gcrypt.h
27
/* Repalcement prototypes. */
28
void *gcry_xmalloc (size_t n);
29
void *gcry_xcalloc (size_t n, size_t m);
30
void *gcry_xrealloc (void *a, size_t n);
31
char *gcry_xstrdup (const char * a);
32
void gcry_free (void *a);
34
/* Map the used xmalloc functions to those implemented by t-support.c */
35
#define xmalloc(a) gcry_xmalloc ( (a) )
36
#define xcalloc(a,b) gcry_xcalloc ( (a), (b) )
37
#define xrealloc(a,n) gcry_xrealloc ( (a), (n) )
38
#define xstrdup(a) gcry_xstrdup ( (a) )
39
#define xfree(a) gcry_free ( (a) )
42
/* Macros to print the result of a test. */
43
#define pass() do { ; } while(0)
44
#define fail(a) do { fprintf (stderr, "%s:%d: test %d failed\n",\
45
__FILE__,__LINE__, (a)); \
50
#endif /*LIBJNLIB_T_SUPPORT_H*/