1 /* wcsstr( 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 wchar_t * wcsstr( const wchar_t * s1, const wchar_t * s2 )
\r
13 const wchar_t * p1 = s1;
\r
18 while ( *p2 && ( *p1 == *p2 ) )
\r
25 return (wchar_t *) s1;
\r
36 #include <_PDCLIB_test.h>
\r
40 wchar_t s[] = L"abcabcabcdabcde";
\r
41 TESTCASE( wcsstr( s, L"x" ) == NULL );
\r
42 TESTCASE( wcsstr( s, L"xyz" ) == NULL );
\r
43 TESTCASE( wcsstr( s, L"a" ) == &s[0] );
\r
44 TESTCASE( wcsstr( s, L"abc" ) == &s[0] );
\r
45 TESTCASE( wcsstr( s, L"abcd" ) == &s[6] );
\r
46 TESTCASE( wcsstr( s, L"abcde" ) == &s[10] );
\r
47 return TEST_RESULTS;
\r