Module: wine Branch: master Commit: b000b6593750c2cb82605c2f960afa36dd68f44c URL: https://gitlab.winehq.org/wine/wine/-/commit/b000b6593750c2cb82605c2f960afa3...
Author: Zhiyi Zhang zzhang@codeweavers.com Date: Wed Sep 27 15:54:31 2023 +0800
user32/tests: Fix test failures in Hindi UTF-8 and mixed locales.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=55656
---
dlls/user32/tests/dialog.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-)
diff --git a/dlls/user32/tests/dialog.c b/dlls/user32/tests/dialog.c index 18a9685b230..7ea0d13c0f3 100644 --- a/dlls/user32/tests/dialog.c +++ b/dlls/user32/tests/dialog.c @@ -38,6 +38,7 @@ #include "winbase.h" #include "wingdi.h" #include "winuser.h" +#include "winnls.h"
#define MAXHWNDS 1024 static HWND hwnd [MAXHWNDS]; @@ -569,13 +570,24 @@ static LRESULT CALLBACK test_control_procA(HWND hwnd, UINT msg, WPARAM wparam, L
static int wm_char_count;
+static BOOL is_cjk(void) +{ + int lang_id = PRIMARYLANGID(GetUserDefaultLangID()); + + if (lang_id == LANG_CHINESE || lang_id == LANG_JAPANESE || lang_id == LANG_KOREAN) + return TRUE; + return FALSE; +} + static LRESULT CALLBACK test_IsDialogMessageA_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) { switch (msg) { case WM_CHAR: - if (GetSystemMetrics(SM_DBCSENABLED)) + if (is_cjk()) ok(wparam == 0x5b57, "Got unexpected wparam %#Ix.\n", wparam); + else if (PRIMARYLANGID(GetUserDefaultLangID()) == LANG_HINDI && GetACP() == CP_UTF8) + ok(wparam == 0xfffd, "Got unexpected wparam %#Ix.\n", wparam); else ok(wparam == 0x3f, "Got unexpected wparam %#Ix.\n", wparam); wm_char_count++; @@ -863,8 +875,10 @@ static void test_IsDialogMessage(void) { if (msg.message == WM_CHAR) { - if (GetSystemMetrics(SM_DBCSENABLED)) + if (is_cjk()) ok(msg.wParam != 0x3f && msg.wParam != 0x5b57, "Got unexpected wparam %#Ix.\n", msg.wParam); + else if (PRIMARYLANGID(GetUserDefaultLangID()) == LANG_HINDI && GetACP() == CP_UTF8) + ok(msg.wParam == 0x97ade5, "Got unexpected wparam %#Ix.\n", msg.wParam); else ok(msg.wParam == 0x3f, "Got unexpected wparam %#Ix.\n", msg.wParam); ret = IsDialogMessageA(g_hwndMain, &msg);