]> pd.if.org Git - pdclib/blob - functions/assert.c
Added signaling "test" driver.
[pdclib] / functions / assert.c
1 /* _PDCLIB_assert( char * )
2
3    This file is part of the Public Domain C Library (PDCLib).
4    Permission is granted to use, modify, and / or redistribute at will.
5 */
6
7 #include <stdio.h>
8 #include <stdlib.h>
9
10 #include <_PDCLIB_aux.h>
11
12 #if _PDCLIB_C_VERSION == 99
13 void _PDCLIB_assert( char const * const message1, char const * const function, char const * const message2 )
14 {
15     fputs( message1, stderr );
16     fputs( function, stderr );
17     fputs( message2, stderr );
18     abort();
19 }
20 #else
21 void _PDCLIB_assert( char const * const message )
22 {
23     fputs( message, stderr );
24     abort();
25 }
26 #endif
27
28
29 #ifdef TEST
30 #include <_PDCLIB_test.h>
31
32 int main()
33 {
34     int NO_TESTDRIVER = 0;
35     BEGIN_TESTS;
36     TESTCASE( NO_TESTDRIVER );
37     return TEST_RESULTS;
38 }
39
40 #endif