1 /* wcsncat( wchar_t *, const wchar_t *, size_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 * wcsncat( wchar_t * _PDCLIB_restrict s1,
\r
12 const wchar_t * _PDCLIB_restrict s2,
\r
20 while ( n && ( *s1++ = *s2++ ) )
\r
34 #include <_PDCLIB_test.h>
\r
38 wchar_t s[] = L"xx\0xxxxxx";
\r
39 TESTCASE( wcsncat( s, wabcde, 10 ) == s );
\r
40 TESTCASE( s[2] == L'a' );
\r
41 TESTCASE( s[6] == L'e' );
\r
42 TESTCASE( s[7] == L'\0' );
\r
43 TESTCASE( s[8] == L'x' );
\r
45 TESTCASE( wcsncat( s, wabcdx, 10 ) == s );
\r
46 TESTCASE( s[4] == L'x' );
\r
47 TESTCASE( s[5] == L'\0' );
\r
48 TESTCASE( wcsncat( s, L"\0", 10 ) == s );
\r
49 TESTCASE( s[5] == L'\0' );
\r
50 TESTCASE( s[6] == L'e' );
\r
51 TESTCASE( wcsncat( s, wabcde, 0 ) == s );
\r
52 TESTCASE( s[5] == L'\0' );
\r
53 TESTCASE( s[6] == L'e' );
\r
54 TESTCASE( wcsncat( s, wabcde, 3 ) == s );
\r
55 TESTCASE( s[5] == L'a' );
\r
56 TESTCASE( s[7] == L'c' );
\r
57 TESTCASE( s[8] == L'\0' );
\r
58 return TEST_RESULTS;
\r