mlang/tests: Rfc1766ToLcid must not touch the LCID output on failure.

This commit is contained in:
Detlef Riekenberg 2009-05-26 23:34:44 +02:00 committed by Alexandre Julliard
parent f4def21f57
commit 98435dc7ed
2 changed files with 5 additions and 18 deletions

View File

@ -1222,8 +1222,6 @@ HRESULT WINAPI Rfc1766ToLcidW(LCID *pLocale, LPCWSTR pszRfc1766)
if (!pLocale || !pszRfc1766)
return E_INVALIDARG;
*pLocale = 0;
hr = EnumRfc1766_create(0, &enumrfc1766);
if (FAILED(hr))
return hr;

View File

@ -55,6 +55,11 @@ typedef struct lcid_tag_table {
} lcid_table_entry;
static const lcid_table_entry lcid_table[] = {
{"e", -1, E_FAIL},
{"", -1, E_FAIL},
{"-", -1, E_FAIL},
{"e-", -1, E_FAIL},
{"en", 9, S_OK}, /* only en is special (using PRIMARYLANGID) */
{"en-gb", 0x809, S_OK},
{"en-us", 0x409, S_OK}
@ -850,11 +855,7 @@ static void test_GetLcidFromRfc1766(IMultiLanguage2 *iML2)
HRESULT ret;
DWORD i;
static WCHAR e[] = { 'e',0 };
static WCHAR en[] = { 'e','n',0 };
static WCHAR empty[] = { 0 };
static WCHAR dash[] = { '-',0 };
static WCHAR e_dash[] = { 'e','-',0 };
static WCHAR en_them[] = { 'e','n','-','t','h','e','m',0 };
static WCHAR english[] = { 'e','n','g','l','i','s','h',0 };
@ -878,18 +879,6 @@ static void test_GetLcidFromRfc1766(IMultiLanguage2 *iML2)
ret = IMultiLanguage2_GetLcidFromRfc1766(iML2, &lcid, NULL);
ok(ret == E_INVALIDARG, "GetLcidFromRfc1766 returned: %08x\n", ret);
ret = IMultiLanguage2_GetLcidFromRfc1766(iML2, &lcid, e);
ok(ret == E_FAIL, "GetLcidFromRfc1766 returned: %08x\n", ret);
ret = IMultiLanguage2_GetLcidFromRfc1766(iML2, &lcid, empty);
ok(ret == E_FAIL, "GetLcidFromRfc1766 returned: %08x\n", ret);
ret = IMultiLanguage2_GetLcidFromRfc1766(iML2, &lcid, dash);
ok(ret == E_FAIL, "GetLcidFromRfc1766 returned: %08x\n", ret);
ret = IMultiLanguage2_GetLcidFromRfc1766(iML2, &lcid, e_dash);
ok(ret == E_FAIL, "GetLcidFromRfc1766 returned: %08x\n", ret);
ret = IMultiLanguage2_GetLcidFromRfc1766(iML2, &lcid, en_them);
ok((ret == E_FAIL || ret == S_FALSE), "GetLcidFromRfc1766 returned: %08x\n", ret);
if (ret == S_FALSE)