advapi32/tests: Skip tests when our language isn't LANG_ENGLISH.

This commit is contained in:
Paul Vriens 2008-02-16 14:11:57 +01:00 committed by Alexandre Julliard
parent c6e61fbf89
commit ba4669860e
1 changed files with 49 additions and 35 deletions

View File

@ -1543,18 +1543,25 @@ static void test_LookupAccountName(void)
domain_size = domain_save; domain_size = domain_save;
sid_size = sid_save; sid_size = sid_save;
ret = LookupAccountNameA(NULL, "Everyone", psid, &sid_size, domain, &domain_size, &sid_use); if (PRIMARYLANGID(LANGIDFROMLCID(GetThreadLocale())) != LANG_ENGLISH)
get_sid_info(psid, &account, &sid_dom); {
ok(ret, "Failed to lookup account name\n"); skip("Non-english locale (test with hardcoded 'Everyone')\n");
ok(sid_size != 0, "sid_size was zero\n"); }
ok(!lstrcmp(account, "Everyone"), "Expected Everyone, got %s\n", account); else
todo_wine {
ok(!lstrcmp(domain, sid_dom), "Expected %s, got %s\n", sid_dom, domain); ret = LookupAccountNameA(NULL, "Everyone", psid, &sid_size, domain, &domain_size, &sid_use);
ok(domain_size == 0, "Expected 0, got %d\n", domain_size); get_sid_info(psid, &account, &sid_dom);
todo_wine ok(ret, "Failed to lookup account name\n");
ok(lstrlen(domain) == domain_size, "Expected %d, got %d\n", lstrlen(domain), domain_size); ok(sid_size != 0, "sid_size was zero\n");
ok(sid_use == SidTypeWellKnownGroup, "Expected SidTypeUser, got %d\n", sid_use); ok(!lstrcmp(account, "Everyone"), "Expected Everyone, got %s\n", account);
domain_size = domain_save; todo_wine
ok(!lstrcmp(domain, sid_dom), "Expected %s, got %s\n", sid_dom, domain);
ok(domain_size == 0, "Expected 0, got %d\n", domain_size);
todo_wine
ok(lstrlen(domain) == domain_size, "Expected %d, got %d\n", lstrlen(domain), domain_size);
ok(sid_use == SidTypeWellKnownGroup, "Expected SidTypeUser, got %d\n", sid_use);
domain_size = domain_save;
}
/* NULL Sid with zero sid size */ /* NULL Sid with zero sid size */
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
@ -2046,32 +2053,39 @@ static void test_SetEntriesInAcl(void)
ok(NewAcl != NULL, "returned acl was NULL\n"); ok(NewAcl != NULL, "returned acl was NULL\n");
LocalFree(NewAcl); LocalFree(NewAcl);
ExplicitAccess.Trustee.TrusteeForm = TRUSTEE_IS_USER; if (PRIMARYLANGID(LANGIDFROMLCID(GetThreadLocale())) != LANG_ENGLISH)
ExplicitAccess.Trustee.ptstrName = (LPWSTR)wszEveryone; {
res = pSetEntriesInAclW(1, &ExplicitAccess, OldAcl, &NewAcl); skip("Non-english locale (test with hardcoded 'Everyone')\n");
ok(res == ERROR_SUCCESS, "SetEntriesInAclW failed: %u\n", res); }
ok(NewAcl != NULL, "returned acl was NULL\n"); else
LocalFree(NewAcl); {
ExplicitAccess.Trustee.TrusteeForm = TRUSTEE_IS_USER;
ExplicitAccess.Trustee.ptstrName = (LPWSTR)wszEveryone;
res = pSetEntriesInAclW(1, &ExplicitAccess, OldAcl, &NewAcl);
ok(res == ERROR_SUCCESS, "SetEntriesInAclW failed: %u\n", res);
ok(NewAcl != NULL, "returned acl was NULL\n");
LocalFree(NewAcl);
ExplicitAccess.Trustee.TrusteeForm = TRUSTEE_BAD_FORM; ExplicitAccess.Trustee.TrusteeForm = TRUSTEE_BAD_FORM;
res = pSetEntriesInAclW(1, &ExplicitAccess, OldAcl, &NewAcl); res = pSetEntriesInAclW(1, &ExplicitAccess, OldAcl, &NewAcl);
ok(res == ERROR_INVALID_PARAMETER, "SetEntriesInAclW failed: %u\n", res); ok(res == ERROR_INVALID_PARAMETER, "SetEntriesInAclW failed: %u\n", res);
ok(NewAcl == NULL, "returned acl wasn't NULL: %p\n", NewAcl); ok(NewAcl == NULL, "returned acl wasn't NULL: %p\n", NewAcl);
LocalFree(NewAcl); LocalFree(NewAcl);
ExplicitAccess.Trustee.TrusteeForm = TRUSTEE_IS_USER; ExplicitAccess.Trustee.TrusteeForm = TRUSTEE_IS_USER;
ExplicitAccess.Trustee.MultipleTrusteeOperation = TRUSTEE_IS_IMPERSONATE; ExplicitAccess.Trustee.MultipleTrusteeOperation = TRUSTEE_IS_IMPERSONATE;
res = pSetEntriesInAclW(1, &ExplicitAccess, OldAcl, &NewAcl); res = pSetEntriesInAclW(1, &ExplicitAccess, OldAcl, &NewAcl);
ok(res == ERROR_INVALID_PARAMETER, "SetEntriesInAclW failed: %u\n", res); ok(res == ERROR_INVALID_PARAMETER, "SetEntriesInAclW failed: %u\n", res);
ok(NewAcl == NULL, "returned acl wasn't NULL: %p\n", NewAcl); ok(NewAcl == NULL, "returned acl wasn't NULL: %p\n", NewAcl);
LocalFree(NewAcl); LocalFree(NewAcl);
ExplicitAccess.Trustee.MultipleTrusteeOperation = NO_MULTIPLE_TRUSTEE; ExplicitAccess.Trustee.MultipleTrusteeOperation = NO_MULTIPLE_TRUSTEE;
ExplicitAccess.grfAccessMode = SET_ACCESS; ExplicitAccess.grfAccessMode = SET_ACCESS;
res = pSetEntriesInAclW(1, &ExplicitAccess, OldAcl, &NewAcl); res = pSetEntriesInAclW(1, &ExplicitAccess, OldAcl, &NewAcl);
ok(res == ERROR_SUCCESS, "SetEntriesInAclW failed: %u\n", res); ok(res == ERROR_SUCCESS, "SetEntriesInAclW failed: %u\n", res);
ok(NewAcl != NULL, "returned acl was NULL\n"); ok(NewAcl != NULL, "returned acl was NULL\n");
LocalFree(NewAcl); LocalFree(NewAcl);
}
ExplicitAccess.grfAccessMode = REVOKE_ACCESS; ExplicitAccess.grfAccessMode = REVOKE_ACCESS;
ExplicitAccess.Trustee.TrusteeForm = TRUSTEE_IS_SID; ExplicitAccess.Trustee.TrusteeForm = TRUSTEE_IS_SID;