1 /* t-support.c - helper functions 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/>.
26 #include "t-support.h"
28 /* Replacements for the malloc functions as used here. */
33 fprintf (stderr
,"error: out of core in regression tests: %s\n",
40 gcry_malloc (size_t n
)
46 gcry_xmalloc (size_t n
)
55 gcry_strdup (const char *string
)
57 return malloc (strlen (string
)+1);
62 gcry_realloc (void *a
, size_t n
)
64 return realloc (a
, n
);
68 gcry_xrealloc (void *a
, size_t n
)
70 void *p
= realloc (a
, n
);
79 gcry_calloc (size_t n
, size_t m
)
85 gcry_xcalloc (size_t n
, size_t m
)
87 void *p
= calloc (n
, m
);
95 gcry_xstrdup (const char *string
)
97 void *p
= malloc (strlen (string
)+1);