1 /* 2 * libzvbi - Unit test helper functions 3 * 4 * Copyright (C) 2007 Michael H. Schimek 5 * 6 * This program is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation; either version 2 of the License, or 9 * (at your option) any later version. 10 * 11 * This program is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * GNU General Public License for more details. 15 * 16 * You should have received a copy of the GNU General Public License 17 * along with this program; if not, write to the Free Software 18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 19 * MA 02110-1301, USA. 20 */ 21 22 /* $Id: test-common.h,v 1.6 2009/03/04 21:48:11 mschimek Exp $ */ 23 24 #include <string.h> 25 #include <inttypes.h> 26 27 #include "src/macros.h" 28 29 #define RAND(var) memset_rand (&(var), sizeof (var)) 30 31 extern void * 32 memset_rand (void * dst, 33 size_t n) 34 _vbi_nonnull ((1)); 35 extern int 36 memcmp_zero (const void * src, 37 size_t n) 38 _vbi_nonnull ((1)); 39 extern void * 40 xmalloc (size_t n_bytes) 41 _vbi_alloc; 42 extern void * 43 xralloc (size_t n_bytes) 44 _vbi_alloc; 45 extern void * 46 xmemdup (const void * src, 47 size_t n_bytes) 48 _vbi_alloc _vbi_nonnull ((1)); 49 50 extern void 51 test_malloc (void (* function)(void), 52 unsigned int n_cycles = 1); 53 54 /* 55 Local variables: 56 c-set-style: K&R 57 c-basic-offset: 8 58 End: 59 */ 60