~ubuntu-branches/ubuntu/oneiric/gnupg2/oneiric-updates

« back to all changes in this revision

Viewing changes to jnlib/t-support.h

  • Committer: Bazaar Package Importer
  • Author(s): Thomas Viehmann
  • Date: 2008-10-04 10:25:53 UTC
  • mfrom: (5.1.15 intrepid)
  • Revision ID: james.westby@ubuntu.com-20081004102553-fv62pp8dsitxli47
Tags: 2.0.9-3.1
* Non-maintainer upload.
* agent/gpg-agent.c: Deinit the threading library before exec'ing
  the command to run in --daemon mode. And because that still doesn't
  restore the sigprocmask, do that manually. Closes: #499569

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* t-support.h - Helper for the regression tests
 
2
 * Copyright (C) 2007  Free Software Foundation, Inc.
 
3
 *
 
4
 * This file is part of JNLIB.
 
5
 *
 
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.
 
10
 *
 
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.
 
15
 *
 
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/>.
 
18
 */
 
19
 
 
20
#ifndef LIBJNLIB_T_SUPPORT_H
 
21
#define LIBJNLIB_T_SUPPORT_H 1
 
22
 
 
23
#ifdef GCRYPT_VERSION
 
24
#error The regression tests should not include with gcrypt.h
 
25
#endif
 
26
 
 
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);
 
33
 
 
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) )
 
40
 
 
41
 
 
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));          \
 
46
                     exit (1);                                   \
 
47
                   } while(0)
 
48
 
 
49
 
 
50
#endif /*LIBJNLIB_T_SUPPORT_H*/