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 /* -------------------------------------------------------------------------- */
19 /* Some strings used for <string.h> and <stdlib.h> testing. */
20 static char const abcde[] = "abcde";
21 static char const abcdx[] = "abcdx";
22 static char const teststring[] = "1234567890\nABCDEFGHIJKLMNOPQRSTUVWXYZ\nabcdefghijklmnopqrstuvwxyz\n";
24 static wchar_t const wabcde[] = L"abcde";
25 static wchar_t const wabcdx[] = L"abcdx";
26 static wchar_t const wteststring[] = L"1234567890\nABCDEFGHIJKLMNOPQRSTUVWXYZ\nabcdefghijklmnopqrstuvwxyz\n";
28 /* Temporary file names */
29 static char const testfile[]="testing/testfile";
30 static char const testfile1[]="testing/testfile1";
31 static char const testfile2[]="testing/testfile2";
33 #define NO_TESTDRIVER 0
35 static int TEST_RESULTS = 0;
37 /* TESTCASE() - generic test */
38 #define TESTCASE( x ) if ( x ) {} \
39 else { TEST_RESULTS += 1; printf( "FAILED: " __FILE__ ", line %d - %s\n", __LINE__, #x ); }
41 /* TESTCASE_NOREG() - PDCLib-only test */
43 #define TESTCASE_NOREG( x ) TESTCASE( x )
45 #define TESTCASE_NOREG( x )
48 /* Include printf() / scanf() test macros if required */
50 #if defined( _PDCLIB_FILEIO ) || defined( _PDCLIB_STRINGIO )
51 #include "_PDCLIB_iotest.h"