3 /* strcmp( const char *, const char * )
5 This file is part of the Public Domain C Library (PDCLib).
6 Permission is granted to use, modify, and / or redistribute at will.
13 int strcmp( const char * s1, const char * s2 )
15 while ( ( *s1 ) && ( *s1 == *s2 ) )
20 return ( *(unsigned char *)s1 - *(unsigned char *)s2 );
26 #include <_PDCLIB_test.h>
30 char cmpabcde[] = "abcde";
31 char cmpabcd_[] = "abcd\xfc";
33 TESTCASE( strcmp( abcde, cmpabcde ) == 0 );
34 TESTCASE( strcmp( abcde, abcdx ) < 0 );
35 TESTCASE( strcmp( abcdx, abcde ) > 0 );
36 TESTCASE( strcmp( empty, abcde ) < 0 );
37 TESTCASE( strcmp( abcde, empty ) > 0 );
38 TESTCASE( strcmp( abcde, cmpabcd_ ) < 0 );