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