Zhiyi Zhang : kernel32/tests: Add more tests for LocaleNameToLCID and LCIDToLocalName.
Alexandre Julliard
julliard at winehq.org
Thu Nov 2 17:28:49 CDT 2017
Module: wine
Branch: master
Commit: 1354c0f3e4d4c46218a8657bb89cc0c25f102606
URL: http://source.winehq.org/git/wine.git/?a=commit;h=1354c0f3e4d4c46218a8657bb89cc0c25f102606
Author: Zhiyi Zhang <gd.yi at 139.com>
Date: Wed Nov 1 22:26:38 2017 +0800
kernel32/tests: Add more tests for LocaleNameToLCID and LCIDToLocalName.
Signed-off-by: Zhiyi Zhang <gd.yi at 139.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/kernel32/tests/locale.c | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/dlls/kernel32/tests/locale.c b/dlls/kernel32/tests/locale.c
index 86fcc33..11a5788 100644
--- a/dlls/kernel32/tests/locale.c
+++ b/dlls/kernel32/tests/locale.c
@@ -2779,7 +2779,7 @@ static void test_LocaleNameToLCID(void)
ptr++;
}
- /* zh-Hant */
+ /* zh-Hant has LCID 0x7c04, but LocaleNameToLCID actually returns 0x0c04, which is the LCID of zh-HK */
lcid = pLocaleNameToLCID(zhHantW, 0);
todo_wine ok(lcid == MAKELCID(MAKELANGID(LANG_CHINESE, SUBLANG_CHINESE_HONGKONG), SORT_DEFAULT),
"%s: got wrong lcid 0x%04x\n", wine_dbgstr_w(zhHantW), lcid);
@@ -2787,6 +2787,11 @@ static void test_LocaleNameToLCID(void)
ok(ret > 0, "%s: got %d\n", wine_dbgstr_w(zhHantW), ret);
todo_wine ok(!lstrcmpW(zhhkW, buffer), "%s: got wrong locale name %s\n",
wine_dbgstr_w(zhHantW), wine_dbgstr_w(buffer));
+ /* check that 0x7c04 also works and is mapped to zh-HK */
+ ret = pLCIDToLocaleName(MAKELANGID(LANG_CHINESE_TRADITIONAL, SUBLANG_CHINESE_TRADITIONAL), buffer, sizeof(buffer)/sizeof(WCHAR), 0);
+ todo_wine ok(ret > 0, "%s: got %d\n", wine_dbgstr_w(zhHantW), ret);
+ todo_wine ok(!lstrcmpW(zhhkW, buffer), "%s: got wrong locale name %s\n",
+ wine_dbgstr_w(zhHantW), wine_dbgstr_w(buffer));
/* zh-hant */
lcid = pLocaleNameToLCID(zhhantW, 0);
@@ -2798,14 +2803,20 @@ static void test_LocaleNameToLCID(void)
todo_wine ok(!lstrcmpW(zhhkW, buffer), "%s: got wrong locale name %s\n",
wine_dbgstr_w(zhhantW), wine_dbgstr_w(buffer));
- /* zh-Hans */
+ /* zh-Hans has LCID 0x0004, but LocaleNameToLCID actually returns 0x0804, which is the LCID of zh-CN */
lcid = pLocaleNameToLCID(zhHansW, 0);
+ /* check that LocaleNameToLCID actually returns 0x0804 */
todo_wine ok(lcid == MAKELCID(MAKELANGID(LANG_CHINESE_SIMPLIFIED, SUBLANG_CHINESE_SIMPLIFIED), SORT_DEFAULT),
"%s: got wrong lcid 0x%04x\n", wine_dbgstr_w(zhHansW), lcid);
ret = pLCIDToLocaleName(lcid, buffer, sizeof(buffer)/sizeof(WCHAR), 0);
ok(ret > 0, "%s: got %d\n", wine_dbgstr_w(zhHansW), ret);
todo_wine ok(!lstrcmpW(zhcnW, buffer), "%s: got wrong locale name %s\n",
wine_dbgstr_w(zhHansW), wine_dbgstr_w(buffer));
+ /* check that 0x0004 also works and is mapped to zh-CN */
+ ret = pLCIDToLocaleName(MAKELANGID(LANG_CHINESE, SUBLANG_NEUTRAL), buffer, sizeof(buffer)/sizeof(WCHAR), 0);
+ ok(ret > 0, "%s: got %d\n", wine_dbgstr_w(zhHansW), ret);
+ ok(!lstrcmpW(zhcnW, buffer), "%s: got wrong locale name %s\n",
+ wine_dbgstr_w(zhHansW), wine_dbgstr_w(buffer));
/* zh-hans */
lcid = pLocaleNameToLCID(zhhansW, 0);
More information about the wine-cvs
mailing list