mirror of
https://github.com/reactos/reactos.git
synced 2024-08-28 06:08:23 +00:00
![Jérôme Gardou](/assets/img/avatar_default.png)
- Add some tests for lstrncpyW - This function is fine, I wrote that when chasing some bug thinking this function was at fault. svn path=/trunk/; revision=57179
28 lines
906 B
C
28 lines
906 B
C
/*
|
|
* PROJECT: ReactOS api tests
|
|
* LICENSE: GPLv2+ - See COPYING in the top level directory
|
|
* PURPOSE: Test for lstrcpynW
|
|
*/
|
|
|
|
#define WIN32_NO_STATUS
|
|
#include <stdio.h>
|
|
#include <wine/test.h>
|
|
#include <windows.h>
|
|
|
|
START_TEST(lstrcpynW)
|
|
{
|
|
WCHAR buffer[256];
|
|
|
|
/* Test basic functionality */
|
|
ok(lstrcpynW(buffer, L"Copy this string", 256) == buffer, "lstrncpyW failed!\n");
|
|
ok(!lstrcmpW(buffer, L"Copy this string"), "Copy went wrong.\n");
|
|
|
|
/* Test for buffer too small */
|
|
ok(lstrcpynW(buffer, L"Copy this string", 10) == buffer, "lstrncpyW failed!\n");
|
|
ok(buffer[9] == 0, "lstrncpyW should have NULL-terminated the string");
|
|
ok(!lstrcmpW(buffer, L"Copy this"), "Copy went wrong.\n");
|
|
|
|
/* Test some invalid buffer */
|
|
ok(lstrcpynW((LPWSTR)0xbaadf00d, L"Copy this string", 256) == NULL, "lstrncpyW should have returned NULL.\n");
|
|
}
|