"Marcus Meissner" <marcus(a)jet.franken.de> wrote:
> diff --git a/dlls/kernel32/tests/locale.c b/dlls/kernel32/tests/locale.c
> index f792da2..a49953b 100644
> --- a/dlls/kernel32/tests/locale.c
> +++ b/dlls/kernel32/tests/locale.c
> @@ -1268,7 +1268,7 @@ static void test_LCMapStringW(void)
> /* otherwise src == dst should fail */
> SetLastError(0xdeadbeef);
> ret = LCMapStringW(LOCALE_USER_DEFAULT, LCMAP_SORTKEY | LCMAP_UPPERCASE,
> - buf, 10, buf, sizeof(buf));
> + buf, 10, buf, sizeof(buf)/sizeof(WCHAR));
> ok(GetLastError() == ERROR_INVALID_FLAGS /* NT */ ||
> GetLastError() == ERROR_INVALID_PARAMETER /* Win9x */,
> "unexpected error code %d\n", GetLastError());
> @@ -1276,40 +1276,40 @@ static void test_LCMapStringW(void)
>
> /* test whether '\0' is always appended */
> ret = LCMapStringW(LOCALE_USER_DEFAULT, LCMAP_SORTKEY,
> - upper_case, -1, buf, sizeof(buf));
> + upper_case, -1, buf, sizeof(buf)/sizeof(WCHAR));
> ok(ret, "LCMapStringW must succeed\n");
> ret2 = LCMapStringW(LOCALE_USER_DEFAULT, LCMAP_SORTKEY,
> - upper_case, lstrlenW(upper_case), buf2, sizeof(buf2));
> + upper_case, lstrlenW(upper_case), buf2, sizeof(buf2)/sizeof(WCHAR));
> ok(ret, "LCMapStringW must succeed\n");
> ok(ret == ret2, "lengths of sort keys must be equal\n");
> ok(!lstrcmpA(p_buf, p_buf2), "sort keys must be equal\n");
>
> /* test LCMAP_SORTKEY | NORM_IGNORECASE */
> ret = LCMapStringW(LOCALE_USER_DEFAULT, LCMAP_SORTKEY | NORM_IGNORECASE,
> - upper_case, -1, buf, sizeof(buf));
> + upper_case, -1, buf, sizeof(buf)/sizeof(WCHAR));
> ok(ret, "LCMapStringW must succeed\n");
> ret2 = LCMapStringW(LOCALE_USER_DEFAULT, LCMAP_SORTKEY,
> - lower_case, -1, buf2, sizeof(buf2));
> + lower_case, -1, buf2, sizeof(buf2)/sizeof(WCHAR));
> ok(ret2, "LCMapStringW must succeed\n");
> ok(ret == ret2, "lengths of sort keys must be equal\n");
> ok(!lstrcmpA(p_buf, p_buf2), "sort keys must be equal\n");
>
> /* test LCMAP_SORTKEY | NORM_IGNORENONSPACE */
> ret = LCMapStringW(LOCALE_USER_DEFAULT, LCMAP_SORTKEY | NORM_IGNORENONSPACE,
> - lower_case, -1, buf, sizeof(buf));
> + lower_case, -1, buf, sizeof(buf)/sizeof(WCHAR));
> ok(ret, "LCMapStringW must succeed\n");
> ret2 = LCMapStringW(LOCALE_USER_DEFAULT, LCMAP_SORTKEY,
> - lower_case, -1, buf2, sizeof(buf2));
> + lower_case, -1, buf2, sizeof(buf2)/sizeof(WCHAR));
> ok(ret2, "LCMapStringW must succeed\n");
> ok(ret == ret2, "lengths of sort keys must be equal\n");
> ok(!lstrcmpA(p_buf, p_buf2), "sort keys must be equal\n");
>
> /* test LCMAP_SORTKEY | NORM_IGNORESYMBOLS */
> ret = LCMapStringW(LOCALE_USER_DEFAULT, LCMAP_SORTKEY | NORM_IGNORESYMBOLS,
> - lower_case, -1, buf, sizeof(buf));
> + lower_case, -1, buf, sizeof(buf)/sizeof(WCHAR));
> ok(ret, "LCMapStringW must succeed\n");
> ret2 = LCMapStringW(LOCALE_USER_DEFAULT, LCMAP_SORTKEY,
> - symbols_stripped, -1, buf2, sizeof(buf2));
> + symbols_stripped, -1, buf2, sizeof(buf2)/sizeof(WCHAR));
> ok(ret2, "LCMapStringW must succeed\n");
> ok(ret == ret2, "lengths of sort keys must be equal\n");
> ok(!lstrcmpA(p_buf, p_buf2), "sort keys must be equal\n");
LCMAP_SORTKEY takes the target buffer size in bytes in both A and W versions.
> @@ -1332,7 +1332,7 @@ static void test_LCMapStringW(void)
>
> /* test srclen = 0 */
> SetLastError(0xdeadbeef);
> - ret = LCMapStringW(LOCALE_USER_DEFAULT, 0, upper_case, 0, buf, sizeof(buf));
> + ret = LCMapStringW(LOCALE_USER_DEFAULT, 0, upper_case, 0, buf, sizeof(buf)/sizeof(WCHAR));
> ok(!ret, "LCMapStringW should fail with srclen = 0\n");
> ok(GetLastError() == ERROR_INVALID_PARAMETER,
> "unexpected error code %d\n", GetLastError());
The size of the target buffer doesn't matter at all in this case, since
the API is supposed to fail due to source length being 0.
--
Dmitry.