[PATCH 1/1] kernel32/tests: Add more tests for LocaleNameToLCID and LCIDToLocalName.

Zhiyi Zhang <[email protected]>
Newsgroups gmane.comp.emulators.wine.patches
Message-ID <[email protected]>
0001-kernel32-tests-Add-more-tests-for-LocaleNameToLCID-a.patch (application/octet-stream, 3.1 KB)
From 12f7c9012ec18a543d7ae63f631c773ed4d23949 Mon Sep 17 00:00:00 2001
From: Zhiyi Zhang <[email protected]>
Date: Wed, 1 Nov 2017 22:26:38 +0800
Subject: [PATCH 1/1] kernel32/tests: Add more tests for LocaleNameToLCID and
 LCIDToLocalName.

Signed-off-by: Zhiyi Zhang <[email protected]>
---
 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 86fcc33b70..11a57889bf 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);
-- 
2.11.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.