ReactOS  0.4.15-dev-492-ga1108f6
lstrcpynW.c
Go to the documentation of this file.
1 /*
2  * PROJECT: ReactOS api tests
3  * LICENSE: GPLv2+ - See COPYING in the top level directory
4  * PURPOSE: Test for lstrcpynW
5  */
6 
7 #include "precomp.h"
8 
10 {
11  WCHAR buffer[256];
12 
13  /* Test basic functionality */
14  ok(lstrcpynW(buffer, L"Copy this string", 256) == buffer, "lstrncpyW failed!\n");
15  ok(!lstrcmpW(buffer, L"Copy this string"), "Copy went wrong.\n");
16 
17  /* Test for buffer too small */
18  ok(lstrcpynW(buffer, L"Copy this string", 10) == buffer, "lstrncpyW failed!\n");
19  ok(buffer[9] == 0, "lstrncpyW should have NULL-terminated the string");
20  ok(!lstrcmpW(buffer, L"Copy this"), "Copy went wrong.\n");
21 
22  /* Test some invalid buffer */
23  ok(lstrcpynW((LPWSTR)(LONG_PTR)0xbaadf00d, L"Copy this string", 256) == NULL, "lstrncpyW should have returned NULL.\n");
24 }
START_TEST(lstrcpynW)
Definition: lstrcpynW.c:9
int WINAPI lstrcmpW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:170
GLuint buffer
Definition: glext.h:5915
#define lstrcpynW
Definition: compat.h:406
smooth NULL
Definition: ftsmooth.c:416
__wchar_t WCHAR
Definition: xmlstorage.h:180
static const WCHAR L[]
Definition: oid.c:1250
#define ok(value,...)
Definition: atltest.h:57
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
WCHAR * LPWSTR
Definition: xmlstorage.h:184