mirror of
https://github.com/reactos/reactos.git
synced 2025-04-20 20:36:35 +00:00
[KERNEL32_APITESTS]
- 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
This commit is contained in:
parent
c49946e714
commit
fdcdcb6339
3 changed files with 30 additions and 0 deletions
|
@ -5,6 +5,7 @@ list(APPEND SOURCE
|
||||||
GetCurrentDirectory.c
|
GetCurrentDirectory.c
|
||||||
GetDriveType.c
|
GetDriveType.c
|
||||||
GetModuleFileName.c
|
GetModuleFileName.c
|
||||||
|
lstrcpynW.c
|
||||||
SetCurrentDirectory.c
|
SetCurrentDirectory.c
|
||||||
testlist.c)
|
testlist.c)
|
||||||
|
|
||||||
|
|
27
rostests/apitests/kernel32/lstrcpynW.c
Normal file
27
rostests/apitests/kernel32/lstrcpynW.c
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
/*
|
||||||
|
* 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");
|
||||||
|
}
|
|
@ -8,6 +8,7 @@
|
||||||
extern void func_GetCurrentDirectory(void);
|
extern void func_GetCurrentDirectory(void);
|
||||||
extern void func_GetDriveType(void);
|
extern void func_GetDriveType(void);
|
||||||
extern void func_GetModuleFileName(void);
|
extern void func_GetModuleFileName(void);
|
||||||
|
extern void func_lstrcpynW(void);
|
||||||
extern void func_SetCurrentDirectory(void);
|
extern void func_SetCurrentDirectory(void);
|
||||||
|
|
||||||
const struct test winetest_testlist[] =
|
const struct test winetest_testlist[] =
|
||||||
|
@ -15,6 +16,7 @@ const struct test winetest_testlist[] =
|
||||||
{ "GetCurrentDirectory", func_GetCurrentDirectory },
|
{ "GetCurrentDirectory", func_GetCurrentDirectory },
|
||||||
{ "GetDriveType", func_GetDriveType },
|
{ "GetDriveType", func_GetDriveType },
|
||||||
{ "GetModuleFileName", func_GetModuleFileName },
|
{ "GetModuleFileName", func_GetModuleFileName },
|
||||||
|
{ "lstrcpynW", func_lstrcpynW },
|
||||||
{ "SetCurrentDirectory", func_SetCurrentDirectory },
|
{ "SetCurrentDirectory", func_SetCurrentDirectory },
|
||||||
|
|
||||||
{ 0, 0 }
|
{ 0, 0 }
|
||||||
|
|
Loading…
Reference in a new issue