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

Alexandre Julliard julliard at winehq.org
Wed May 27 09:26:55 CDT 2009


Module: wine
Branch: master
Commit: 98435dc7ed6b90ea6802864e79b74875eb8d3664
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=98435dc7ed6b90ea6802864e79b74875eb8d3664

Author: Detlef Riekenberg <wine.dev at web.de>
Date:   Tue May 26 23:34:44 2009 +0200

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

---

 dlls/mlang/mlang.c       |    2 --
 dlls/mlang/tests/mlang.c |   21 +++++----------------
 2 files changed, 5 insertions(+), 18 deletions(-)

diff --git a/dlls/mlang/mlang.c b/dlls/mlang/mlang.c
index bd6a7f5..14122c8 100644
--- a/dlls/mlang/mlang.c
+++ b/dlls/mlang/mlang.c
@@ -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;
diff --git a/dlls/mlang/tests/mlang.c b/dlls/mlang/tests/mlang.c
index d39e0e3..b0b4743 100644
--- a/dlls/mlang/tests/mlang.c
+++ b/dlls/mlang/tests/mlang.c
@@ -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)




More information about the wine-cvs mailing list