1 /* PDCLib testing suite <_PDCLIB_test.h>
3 This file is part of the Public Domain C Library (PDCLib).
4 Permission is granted to use, modify, and / or redistribute at will.
7 /* -------------------------------------------------------------------------- */
8 /* Helper macros for test drivers */
9 /* -------------------------------------------------------------------------- */
16 /* Some strings used for <string.h> and <stdlib.h> testing. */
17 static char const abcde[] = "abcde";
18 static char const abcdx[] = "abcdx";
19 static char const teststring[] = "1234567890\nABCDEFGHIJKLMNOPQRSTUVWXYZ\nabcdefghijklmnopqrstuvwxyz\n";
21 /* Temporary file names */
22 static char const testfile[]="testing/testfile";
23 static char const testfile1[]="testing/testfile1";
24 static char const testfile2[]="testing/testfile2";
26 #define NO_TESTDRIVER 0
28 static int TEST_RESULTS = 0;
30 /* TESTCASE() - generic test */
31 #define TESTCASE( x ) if ( x ) {} \
32 else { TEST_RESULTS += 1; printf( "FAILED: " __FILE__ ", line %d - %s\n", __LINE__, #x ); }
34 /* TESTCASE_NOREG() - PDCLib-only test */
36 #define TESTCASE_NOREG( x ) TESTCASE( x )
38 #define TESTCASE_NOREG( x )
41 /* Include printf() / scanf() test macros if required */
43 #if defined( _PDCLIB_FILEIO ) || defined( _PDCLIB_STRINGIO )
44 #include "_PDCLIB_iotest.h"