[PATCH] advapi32/tests: Well known group names are not translated in Wine.

Francois Gouget fgouget at codeweavers.com
Fri Dec 10 09:18:31 CST 2021


Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52175
Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
--
Alternatively we could consider that translating the group names is not
important since Windows itself does not always translate them
('Everyone' is translated in French and German but not in Japanese).
So this could be a skip instead.
---
 dlls/advapi32/tests/lsa.c | 27 ++++++++++++++-------------
 1 file changed, 14 insertions(+), 13 deletions(-)

diff --git a/dlls/advapi32/tests/lsa.c b/dlls/advapi32/tests/lsa.c
index f8c822a7de2..8e1edd2326b 100644
--- a/dlls/advapi32/tests/lsa.c
+++ b/dlls/advapi32/tests/lsa.c
@@ -323,16 +323,17 @@ static void test_LsaLookupNames2(void)
     ok(status == STATUS_SUCCESS, "LsaClose() failed, returned 0x%08x\n", status);
 }
 
-static void check_unicode_string_(int line, const LSA_UNICODE_STRING *string, const WCHAR *expect)
+static void check_unicode_string_(int line, const LSA_UNICODE_STRING *string, const WCHAR *expect, BOOL todo)
 {
     ok_(__FILE__, line)(string->Length == wcslen(string->Buffer) * sizeof(WCHAR),
             "expected %u, got %u\n", wcslen(string->Buffer) * sizeof(WCHAR), string->Length);
     ok_(__FILE__, line)(string->MaximumLength == string->Length + sizeof(WCHAR),
             "expected %u, got %u\n", string->Length + sizeof(WCHAR), string->MaximumLength);
-    ok_(__FILE__, line)(!wcsicmp(string->Buffer, expect), "expected %s, got %s\n",
+    todo_if(todo) ok_(__FILE__, line)(!wcsicmp(string->Buffer, expect),
+            "expected %s, got %s\n",
             debugstr_w(expect), debugstr_w(string->Buffer));
 }
-#define check_unicode_string(a, b) check_unicode_string_(__LINE__, a, b)
+#define check_unicode_string(a, b, c) check_unicode_string_(__LINE__, a, b, c)
 
 static void test_LsaLookupSids(void)
 {
@@ -371,11 +372,11 @@ static void test_LsaLookupSids(void)
     ok(status == STATUS_SUCCESS, "got 0x%08x\n", status);
 
     ok(list->Entries == 1, "got %d\n", list->Entries);
-    check_unicode_string(&list->Domains[0].Name, computer_name);
+    check_unicode_string(&list->Domains[0].Name, computer_name, FALSE);
 
     ok(names[0].Use == SidTypeUser, "got type %u\n", names[0].Use);
     ok(!names[0].DomainIndex, "got index %u\n", names[0].DomainIndex);
-    check_unicode_string(&names[0].Name, user_name);
+    check_unicode_string(&names[0].Name, user_name, FALSE);
 
     LsaFreeMemory(names);
     LsaFreeMemory(list);
@@ -388,7 +389,7 @@ static void test_LsaLookupSids(void)
     ok(status == STATUS_SUCCESS, "got 0x%08x\n", status);
 
     ok(list->Entries == 1, "got %d\n", list->Entries);
-    check_unicode_string(&list->Domains[0].Name, L"");
+    check_unicode_string(&list->Domains[0].Name, L"", FALSE);
 
     ok(names[0].Use == SidTypeWellKnownGroup, "got type %u\n", names[0].Use);
     ok(!names[0].DomainIndex, "got index %u\n", names[0].DomainIndex);
@@ -400,11 +401,11 @@ static void test_LsaLookupSids(void)
         langW[0] = 0;
     if (wcscmp(langW, L"0409") == 0 || wcscmp(langW, L"0411") == 0)
         /* English and Japanese */
-        check_unicode_string(&names[0].Name, L"Everyone");
+        check_unicode_string(&names[0].Name, L"Everyone", FALSE);
     else if (wcscmp(langW, L"0407") == 0) /* German */
-        check_unicode_string(&names[0].Name, L"Jeder");
+        check_unicode_string(&names[0].Name, L"Jeder", TRUE);
     else if (wcscmp(langW, L"040C") == 0) /* French */
-        check_unicode_string(&names[0].Name, L"Tout le monde");
+        check_unicode_string(&names[0].Name, L"Tout le monde", TRUE);
     else
         trace("<Everyone-group>.Name=%s\n", debugstr_w(names[0].Name.Buffer));
 
@@ -422,7 +423,7 @@ static void test_LsaLookupSids(void)
 
     ok(names[0].Use == SidTypeUnknown, "got type %u\n", names[0].Use);
     ok(names[0].DomainIndex == -1, "got index %u\n", names[0].DomainIndex);
-    check_unicode_string(&names[0].Name, L"S-1-1234-5678-1234-5678");
+    check_unicode_string(&names[0].Name, L"S-1-1234-5678-1234-5678", FALSE);
 
     LsaFreeMemory(names);
     LsaFreeMemory(list);
@@ -495,14 +496,14 @@ static void test_LsaGetUserName(void)
 
     status = pLsaGetUserName(&lsa_user, NULL);
     ok(!status, "got %#x\n", status);
-    check_unicode_string(lsa_user, user);
+    check_unicode_string(lsa_user, user, FALSE);
     LsaFreeMemory(lsa_user);
 
     status = pLsaGetUserName(&lsa_user, &lsa_domain);
     ok(!status, "got %#x\n", status);
     ok(!lstrcmpW(user, lsa_user->Buffer), "%s != %s\n", wine_dbgstr_w(user), wine_dbgstr_wn(lsa_user->Buffer, lsa_user->Length/sizeof(WCHAR)));
-    check_unicode_string(lsa_user, user);
-    check_unicode_string(lsa_domain, computer);
+    check_unicode_string(lsa_user, user, FALSE);
+    check_unicode_string(lsa_domain, computer, FALSE);
     LsaFreeMemory(lsa_user);
     LsaFreeMemory(lsa_domain);
 }
-- 
2.30.2




More information about the wine-devel mailing list