kernel32/tests: Windows 10 accepts locale names like "zz-ZZ" and "foo".

Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Huw Davies 2017-01-17 10:51:44 +00:00 committed by Alexandre Julliard
parent 9e32160a77
commit 8948174aeb
1 changed files with 8 additions and 4 deletions

View File

@ -43,6 +43,7 @@ static const WCHAR symbols_stripped[] = {'j','u','s','t','a','t','e','s','t','s'
static const WCHAR localeW[] = {'e','n','-','U','S',0}; static const WCHAR localeW[] = {'e','n','-','U','S',0};
static const WCHAR fooW[] = {'f','o','o',0}; static const WCHAR fooW[] = {'f','o','o',0};
static const WCHAR emptyW[] = {0}; static const WCHAR emptyW[] = {0};
static const WCHAR invalidW[] = {'i','n','v','a','l','i','d',0};
static inline unsigned int strlenW( const WCHAR *str ) static inline unsigned int strlenW( const WCHAR *str )
{ {
@ -2644,7 +2645,7 @@ static void test_LCMapStringEx(void)
trace("testing LCMapStringEx\n"); trace("testing LCMapStringEx\n");
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
ret = pLCMapStringEx(fooW, LCMAP_LOWERCASE, ret = pLCMapStringEx(invalidW, LCMAP_LOWERCASE,
upper_case, -1, buf, sizeof(buf)/sizeof(WCHAR), NULL, NULL, 0); upper_case, -1, buf, sizeof(buf)/sizeof(WCHAR), NULL, NULL, 0);
todo_wine { todo_wine {
ok(!ret, "LCMapStringEx should fail with bad locale name\n"); ok(!ret, "LCMapStringEx should fail with bad locale name\n");
@ -2738,7 +2739,7 @@ static void test_LocaleNameToLCID(void)
/* bad name */ /* bad name */
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
lcid = pLocaleNameToLCID(fooW, 0); lcid = pLocaleNameToLCID(invalidW, 0);
ok(!lcid && GetLastError() == ERROR_INVALID_PARAMETER, ok(!lcid && GetLastError() == ERROR_INVALID_PARAMETER,
"Expected lcid == 0, got %08x, error %d\n", lcid, GetLastError()); "Expected lcid == 0, got %08x, error %d\n", lcid, GetLastError());
@ -4463,7 +4464,8 @@ static void test_IsValidLocaleName(void)
{ {
static const WCHAR enusW[] = {'e','n','-','U','S',0}; static const WCHAR enusW[] = {'e','n','-','U','S',0};
static const WCHAR zzW[] = {'z','z',0}; static const WCHAR zzW[] = {'z','z',0};
static const WCHAR zzzzW[] = {'z','z','-','Z','Z',0}; static const WCHAR zz_zzW[] = {'z','z','-','Z','Z',0};
static const WCHAR zzzzW[] = {'z','z','z','z',0};
BOOL ret; BOOL ret;
if (!pIsValidLocaleName) if (!pIsValidLocaleName)
@ -4475,7 +4477,9 @@ static void test_IsValidLocaleName(void)
ret = pIsValidLocaleName(enusW); ret = pIsValidLocaleName(enusW);
ok(ret, "IsValidLocaleName failed\n"); ok(ret, "IsValidLocaleName failed\n");
ret = pIsValidLocaleName(zzW); ret = pIsValidLocaleName(zzW);
ok(!ret, "IsValidLocaleName should have failed\n"); ok(!ret || broken(ret), "IsValidLocaleName should have failed\n");
ret = pIsValidLocaleName(zz_zzW);
ok(!ret || broken(ret), "IsValidLocaleName should have failed\n");
ret = pIsValidLocaleName(zzzzW); ret = pIsValidLocaleName(zzzzW);
ok(!ret, "IsValidLocaleName should have failed\n"); ok(!ret, "IsValidLocaleName should have failed\n");
ret = pIsValidLocaleName(LOCALE_NAME_INVARIANT); ret = pIsValidLocaleName(LOCALE_NAME_INVARIANT);