1 /* wcscmp( const wchar_t *, const wchar_t * )
\r
3 This file is part of the Public Domain C Library (PDCLib).
\r
4 Permission is granted to use, modify, and / or redistribute at will.
\r
11 int wcscmp( const wchar_t * s1, const wchar_t * s2 )
\r
13 while ( ( *s1 ) && ( *s1 == *s2 ) )
\r
18 return ( *(wchar_t *)s1 - *(wchar_t *)s2 );
\r
24 #include <_PDCLIB_test.h>
\r
28 wchar_t cmpabcde[] = L"abcde";
\r
29 wchar_t cmpabcd_[] = L"abcd\xfc";
\r
30 wchar_t empty[] = L"";
\r
31 TESTCASE( wcscmp( wabcde, cmpabcde ) == 0 );
\r
32 TESTCASE( wcscmp( wabcde, wabcdx ) < 0 );
\r
33 TESTCASE( wcscmp( wabcdx, wabcde ) > 0 );
\r
34 TESTCASE( wcscmp( empty, wabcde ) < 0 );
\r
35 TESTCASE( wcscmp( wabcde, empty ) > 0 );
\r
36 TESTCASE( wcscmp( wabcde, cmpabcd_ ) < 0 );
\r
37 return TEST_RESULTS;
\r