kernel32/tests: Add LCMapString tests with a voiced consonant Hiragana character.
Use U+3060 (HIRAGANA LETTER DA) in the test. Signed-off-by: Akihiro Sagawa <sagawa.aki@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
2dc3d2454a
commit
96b4a5a356
|
@ -2420,20 +2420,29 @@ typedef INT (*lcmapstring_wrapper)(DWORD, LPCWSTR, INT, LPWSTR, INT);
|
|||
static void test_lcmapstring_unicode(lcmapstring_wrapper func_ptr, const char *func_name)
|
||||
{
|
||||
const static WCHAR japanese_text[] = {
|
||||
0x3044, 0x309d, 0x3084, 0x3001, 0x30a4, 0x30fc, 0x30cf,
|
||||
0x30c8, 0x30fc, 0x30f4, 0x30a9, 0x306e, 0x2026, 0
|
||||
0x3044, 0x309d, 0x3084, 0x3001, 0x30a4, 0x30fc, 0x30cf, 0x30c8,
|
||||
0x30fc, 0x30f4, 0x30a9, 0x306e, 0x91ce, 0x539f, 0x306f, 0x5e83,
|
||||
0x3044, 0x3093, 0x3060, 0x3088, 0x3002, 0
|
||||
};
|
||||
const static WCHAR hiragana_text[] = {
|
||||
0x3044, 0x309d, 0x3084, 0x3001, 0x3044, 0x30fc, 0x306f,
|
||||
0x3068, 0x30fc, 0x3094, 0x3049, 0x306e, 0x2026, 0
|
||||
0x3044, 0x309d, 0x3084, 0x3001, 0x3044, 0x30fc, 0x306f, 0x3068,
|
||||
0x30fc, 0x3094, 0x3049, 0x306e, 0x91ce, 0x539f, 0x306f, 0x5e83,
|
||||
0x3044, 0x3093, 0x3060, 0x3088, 0x3002, 0
|
||||
};
|
||||
const static WCHAR katakana_text[] = {
|
||||
0x30a4, 0x30fd, 0x30e4, 0x3001, 0x30a4, 0x30fc, 0x30cf,
|
||||
0x30c8, 0x30fc, 0x30f4, 0x30a9, 0x30ce, 0x2026, 0
|
||||
0x30a4, 0x30fd, 0x30e4, 0x3001, 0x30a4, 0x30fc, 0x30cf, 0x30c8,
|
||||
0x30fc, 0x30f4, 0x30a9, 0x30ce, 0x91ce, 0x539f, 0x30cf, 0x5e83,
|
||||
0x30a4, 0x30f3, 0x30c0, 0x30e8, 0x3002, 0
|
||||
};
|
||||
const static WCHAR halfwidth_text[] = {
|
||||
0x3044, 0x309d, 0x3084, 0xff64, 0xff72, 0xff70, 0xff8a,
|
||||
0xff84, 0xff70, 0xff73, 0xff9e, 0xff6b, 0x306e, 0x2026, 0
|
||||
0x3044, 0x309d, 0x3084, 0xff64, 0xff72, 0xff70, 0xff8a, 0xff84,
|
||||
0xff70, 0xff73, 0xff9e, 0xff6b, 0x306e, 0x91ce, 0x539f, 0x306f,
|
||||
0x5e83, 0x3044, 0x3093, 0x3060, 0x3088, 0xff61, 0
|
||||
};
|
||||
const static WCHAR halfwidth_text2[] = {
|
||||
0xff72, 0x30fd, 0xff94, 0xff64, 0xff72, 0xff70, 0xff8a, 0xff84,
|
||||
0xff70, 0xff73, 0xff9e, 0xff6b, 0xff89, 0x91ce, 0x539f, 0xff8a,
|
||||
0x5e83, 0xff72, 0xff9d, 0xff80, 0xff9e, 0xff96, 0xff61, 0
|
||||
};
|
||||
int ret, ret2, i;
|
||||
WCHAR buf[256], buf2[256];
|
||||
|
@ -2520,6 +2529,17 @@ static void test_lcmapstring_unicode(lcmapstring_wrapper func_ptr, const char *f
|
|||
ret2 = func_ptr(LCMAP_HALFWIDTH, japanese_text, -1, NULL, 0);
|
||||
ok(ret == ret2, "%s ret %d, expected value %d\n", func_name, ret, ret2);
|
||||
|
||||
/* test LCMAP_HALFWIDTH | LCMAP_KATAKANA
|
||||
(hiragana character is converted into half-width katakana) */
|
||||
ret = func_ptr(LCMAP_HALFWIDTH | LCMAP_KATAKANA, japanese_text, -1, buf, ARRAY_SIZE(buf));
|
||||
ok(ret == lstrlenW(halfwidth_text2) + 1, "%s ret %d, error %d, expected value %d\n", func_name,
|
||||
ret, GetLastError(), lstrlenW(halfwidth_text2) + 1);
|
||||
ok(!lstrcmpW(buf, halfwidth_text2), "%s string compare mismatch\n", func_name);
|
||||
|
||||
ret2 = func_ptr(LCMAP_HALFWIDTH | LCMAP_KATAKANA, japanese_text, -1, NULL, 0);
|
||||
todo_wine
|
||||
ok(ret == ret2, "%s ret %d, expected value %d\n", func_name, ret, ret2);
|
||||
|
||||
/* test buffer overflow */
|
||||
SetLastError(0xdeadbeef);
|
||||
ret = func_ptr(LCMAP_UPPERCASE,
|
||||
|
|
Loading…
Reference in New Issue