]> pd.if.org Git - pdclib/blob - functions/string/strcoll.c
Added #ifdef to allow regression against system lib.
[pdclib] / functions / string / strcoll.c
1 /* $Id$ */
2
3 /* Release $Name$ */
4
5 /* strcoll( const char *, const char * )
6
7    This file is part of the Public Domain C Library (PDCLib).
8    Permission is granted to use, modify, and / or redistribute at will.
9 */
10
11 #include <string.h>
12
13 #ifndef REGTEST
14
15 /* TODO: Dummy function, PDCLib does not support locales yet. */
16 int strcoll( const char * s1, const char * s2 )
17 {
18     return strcmp( s1, s2 );
19 }
20
21 #endif
22
23 #ifdef TEST
24 #include <_PDCLIB_test.h>
25
26 int main()
27 {
28     char cmpabcde[] = "abcde";
29     char empty[] = "";
30     BEGIN_TESTS;
31     TESTCASE( strcmp( abcde, cmpabcde ) == 0 );
32     TESTCASE( strcmp( abcde, abcdx ) < 0 );
33     TESTCASE( strcmp( abcdx, abcde ) > 0 );
34     TESTCASE( strcmp( empty, abcde ) < 0 );
35     TESTCASE( strcmp( abcde, empty ) > 0 );
36     return TEST_RESULTS;
37 }
38 #endif