Francois Gouget : advapi32/tests: Don't check the display name if not in an English locale.
Alexandre Julliard
julliard at winehq.org
Mon Nov 30 16:13:46 CST 2020
Module: wine
Branch: master
Commit: 58ff2a0a887feca82f5e8128968c10ab03d64b72
URL: https://source.winehq.org/git/wine.git/?a=commit;h=58ff2a0a887feca82f5e8128968c10ab03d64b72
Author: Francois Gouget <fgouget at codeweavers.com>
Date: Mon Nov 30 16:02:28 2020 +0100
advapi32/tests: Don't check the display name if not in an English locale.
Service display names are often translated.
Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/advapi32/tests/service.c | 23 ++++++++++++++++++++++-
1 file changed, 22 insertions(+), 1 deletion(-)
diff --git a/dlls/advapi32/tests/service.c b/dlls/advapi32/tests/service.c
index d216e096207..cbe7fffbc7a 100644
--- a/dlls/advapi32/tests/service.c
+++ b/dlls/advapi32/tests/service.c
@@ -2678,6 +2678,26 @@ static void test_refcount(void)
CloseServiceHandle(scm_handle);
}
+static BOOL is_lang_english(void)
+{
+ static HMODULE hkernel32 = NULL;
+ static LANGID (WINAPI *pGetThreadUILanguage)(void) = NULL;
+ static LANGID (WINAPI *pGetUserDefaultUILanguage)(void) = NULL;
+
+ if (!hkernel32)
+ {
+ hkernel32 = GetModuleHandleA("kernel32.dll");
+ pGetThreadUILanguage = (void*)GetProcAddress(hkernel32, "GetThreadUILanguage");
+ pGetUserDefaultUILanguage = (void*)GetProcAddress(hkernel32, "GetUserDefaultUILanguage");
+ }
+ if (pGetThreadUILanguage)
+ return PRIMARYLANGID(pGetThreadUILanguage()) == LANG_ENGLISH;
+ if (pGetUserDefaultUILanguage)
+ return PRIMARYLANGID(pGetUserDefaultUILanguage()) == LANG_ENGLISH;
+
+ return PRIMARYLANGID(GetUserDefaultLangID()) == LANG_ENGLISH;
+}
+
static void test_EventLog(void)
{
SC_HANDLE scm_handle, svc_handle;
@@ -2715,7 +2735,8 @@ todo_wine
ok(!strcmp(config->lpServiceStartName, "LocalSystem") /* XP */ ||
!strcmp(config->lpServiceStartName, "NT AUTHORITY\\LocalService"),
"got %s\n", config->lpServiceStartName);
- ok(!strcmp(config->lpDisplayName, "Event Log") /* XP */ ||
+ ok(!is_lang_english() || /* DisplayName is often translated */
+ !strcmp(config->lpDisplayName, "Event Log") /* XP */ ||
!strcmp(config->lpDisplayName, "Windows Event Log") /* Vista+ */, "got %s\n", config->lpDisplayName);
HeapFree(GetProcessHeap(), 0, config);
More information about the wine-cvs
mailing list