]> pd.if.org Git - pdclib/blob - testing/_PDCLIB_test.h
ad02b0fb71839924851a9f00f5ec30e5a63f7091
[pdclib] / testing / _PDCLIB_test.h
1 /* $Id$ */
2
3 /* PDCLib testing suite <_PDCLIB_test.h>
4
5    This file is part of the Public Domain C Library (PDCLib).
6    Permission is granted to use, modify, and / or redistribute at will.
7 */
8
9 /* -------------------------------------------------------------------------- */
10 /* Helper macros for test drivers                                             */
11 /* -------------------------------------------------------------------------- */
12
13 #include <stdio.h>
14
15 char const abcde[] = "abcde";
16 char const abcdx[] = "abcdx";
17 char const * teststring = "1234567890\nABCDEFGHIJKLMNOPQRSTUVWXYZ\nabcdefghijklmnopqrstuvwxyz\n";
18
19 int NO_TESTDRIVER = 0;
20
21 static int rc = 0;
22
23 #define TESTCASE( x ) if ( x ) {} \
24                       else { rc += 1; printf( "FAILED: " __FILE__ ", line %d - %s\n", __LINE__, #x ); }
25
26 #ifndef REGTEST
27 #define TESTCASE_NOREG( x ) TESTCASE( x )
28 #else
29 #define TESTCASE_NOREG( x )
30 #endif
31
32 #define TEST_RESULTS  rc
33