Test passing NULL source to WideCharToMultiByte.

This commit is contained in:
Saulius Krasuckas 2005-08-18 10:50:46 +00:00 committed by Alexandre Julliard
parent 58d7d7454b
commit abfe0f2f72
1 changed files with 14 additions and 0 deletions

View File

@ -25,6 +25,19 @@
#include "winbase.h" #include "winbase.h"
#include "winnls.h" #include "winnls.h"
static void test_null_source(void)
{
int len;
DWORD GLE;
SetLastError(0);
len = WideCharToMultiByte(CP_ACP, 0, NULL, 0, NULL, 0, NULL, NULL);
GLE = GetLastError();
ok(!len && GLE == ERROR_INVALID_PARAMETER,
"WideCharToMultiByte returned %d with GLE=%ld (expected 0 with ERROR_INVALID_PARAMETER)\n",
len, GLE);
}
/* lstrcmpW is not supported on Win9x! */ /* lstrcmpW is not supported on Win9x! */
static int mylstrcmpW(const WCHAR* str1, const WCHAR* str2) static int mylstrcmpW(const WCHAR* str1, const WCHAR* str2)
{ {
@ -71,6 +84,7 @@ static void test_overlapped_buffers(void)
START_TEST(codepage) START_TEST(codepage)
{ {
test_null_source();
test_negative_source_length(); test_negative_source_length();
test_overlapped_buffers(); test_overlapped_buffers();
} }