kernel32: Add an overflow test for MultiByteToWideChar.

oldstable
Dmitry Timoshkov 2007-05-18 20:21:35 +09:00 committed by Alexandre Julliard
parent 90bafb3cc1
commit e690916f68
1 changed files with 6 additions and 0 deletions

View File

@ -137,6 +137,12 @@ static void test_negative_source_length(void)
len = MultiByteToWideChar(CP_ACP, 0, "foobar", -2002, bufW, 10);
ok(len == 7 && !mylstrcmpW(bufW, foobarW) && GetLastError() == 0xdeadbeef,
"MultiByteToWideChar(-2002): len=%d error=%u\n", len, GetLastError());
SetLastError(0xdeadbeef);
memset(bufW, 'x', sizeof(bufW));
len = MultiByteToWideChar(CP_ACP, 0, "foobar", -1, bufW, 6);
ok(len == 0 && GetLastError() == ERROR_INSUFFICIENT_BUFFER,
"MultiByteToWideChar(-1): len=%d error=%u\n", len, GetLastError());
}
static void test_overlapped_buffers(void)