KERNEL/tests: test WideCharToMultiByte
Saulius Krasuckas
saulius2 at ar.fi.lt
Wed Aug 17 17:26:03 CDT 2005
* On Wed, 17 Aug 2005, Alexandre Julliard wrote:
> * Saulius Krasuckas <saulius2 at ar.fi.lt> writes:
> >
> > Add a test for WideCharToMultiByte.
>
> This should go in codepage.c.
Makes a lot of sense.
As we are used to say here, not all blind men see in the daylight.
Log message:
Saulius Krasuckas <saulius.krasuckas at ieee.org>
Test passing NULL source to WideCharToMultiByte.
Index: dlls/kernel/tests/codepage.c
===================================================================
RCS file: /home/wine/wine/dlls/kernel/tests/codepage.c,v
retrieving revision 1.5
diff -p -u -r1.5 codepage.c
--- dlls/kernel/tests/codepage.c 15 Jul 2005 16:33:10 -0000 1.5
+++ dlls/kernel/tests/codepage.c 17 Aug 2005 22:10:38 -0000
@@ -25,6 +25,19 @@
#include "winbase.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! */
static int mylstrcmpW(const WCHAR* str1, const WCHAR* str2)
{
@@ -71,6 +84,7 @@ static void test_overlapped_buffers(void
START_TEST(codepage)
{
+ test_null_source();
test_negative_source_length();
test_overlapped_buffers();
}
More information about the wine-patches
mailing list