Module: wine Branch: master Commit: 4e8dcf89e9b3019d464b1816e5d65df66f63e225 URL: http://source.winehq.org/git/wine.git/?a=commit;h=4e8dcf89e9b3019d464b1816e5...
Author: Aric Stewart aric@codeweavers.com Date: Sun Sep 28 14:48:29 2008 -0500
mlang/tests: Skip testing a codepage returning the buggy, legacy unicodeFEFF charset (only appears to exist on windows 2008).
---
dlls/mlang/tests/mlang.c | 164 +++++++++++++++++++++++++--------------------- 1 files changed, 90 insertions(+), 74 deletions(-)
diff --git a/dlls/mlang/tests/mlang.c b/dlls/mlang/tests/mlang.c index ab1e4dd..96aef1c 100644 --- a/dlls/mlang/tests/mlang.c +++ b/dlls/mlang/tests/mlang.c @@ -330,6 +330,7 @@ static void test_EnumCodePages(IMultiLanguage2 *iML2, DWORD flags) BOOL convertible; HRESULT check = S_OK; static const WCHAR autoW[] = {'_','a','u','t','o',0}; + static const WCHAR feffW[] = {'u','n','i','c','o','d','e','F','E','F','F',0};
#ifdef DUMP_CP_INFO trace("MIMECPINFO #%u:\n" @@ -390,83 +391,98 @@ static void test_EnumCodePages(IMultiLanguage2 *iML2, DWORD flags) else trace("IsValidCodePage failed for cp %u\n", cpinfo[i].uiCodePage);
- ret = IMultiLanguage2_GetCharsetInfo(iML2, cpinfo[i].wszWebCharset, &mcsi); - /* _autoxxx charsets are a fake and GetCharsetInfo fails for them */ - if (memcmp(cpinfo[i].wszWebCharset, autoW, 5 * sizeof(WCHAR))) - { - ok (ret == S_OK, "IMultiLanguage2_GetCharsetInfo failed: %08x\n", ret); -#ifdef DUMP_CP_INFO - trace("%s: %u %u %s\n", wine_dbgstr_w(cpinfo[i].wszWebCharset), mcsi.uiCodePage, mcsi.uiInternetEncoding, wine_dbgstr_w(mcsi.wszCharset)); -#endif - ok(!lstrcmpiW(cpinfo[i].wszWebCharset, mcsi.wszCharset), -#ifdef DUMP_CP_INFO - "%s != %s\n", - wine_dbgstr_w(cpinfo[i].wszWebCharset), wine_dbgstr_w(mcsi.wszCharset)); -#else - "wszWebCharset mismatch\n"); -#endif - - if (0) - { - /* native mlang returns completely messed up encodings in some cases */ - ok(mcsi.uiInternetEncoding == cpinfo[i].uiCodePage || mcsi.uiInternetEncoding == cpinfo[i].uiFamilyCodePage, - "%u != %u || %u\n", mcsi.uiInternetEncoding, cpinfo[i].uiCodePage, cpinfo[i].uiFamilyCodePage); - ok(mcsi.uiCodePage == cpinfo[i].uiCodePage || mcsi.uiCodePage == cpinfo[i].uiFamilyCodePage, - "%u != %u || %u\n", mcsi.uiCodePage, cpinfo[i].uiCodePage, cpinfo[i].uiFamilyCodePage); + if (memcmp(cpinfo[i].wszWebCharset,feffW,sizeof(WCHAR)*11)==0) + skip("Legacy windows bug returning invalid charset of unicodeFEFF\n"); + else + { + ret = IMultiLanguage2_GetCharsetInfo(iML2, cpinfo[i].wszWebCharset, &mcsi); + /* _autoxxx charsets are a fake and GetCharsetInfo fails for them */ + if (memcmp(cpinfo[i].wszWebCharset, autoW, 5 * sizeof(WCHAR))) + { + ok (ret == S_OK, "IMultiLanguage2_GetCharsetInfo failed: %08x\n", ret); + #ifdef DUMP_CP_INFO + trace("%s: %u %u %s\n", wine_dbgstr_w(cpinfo[i].wszWebCharset), mcsi.uiCodePage, mcsi.uiInternetEncoding, wine_dbgstr_w(mcsi.wszCharset)); + #endif + ok(!lstrcmpiW(cpinfo[i].wszWebCharset, mcsi.wszCharset), + #ifdef DUMP_CP_INFO + "%s != %s\n", + wine_dbgstr_w(cpinfo[i].wszWebCharset), wine_dbgstr_w(mcsi.wszCharset)); + #else + "wszWebCharset mismatch\n"); + #endif + + if (0) + { + /* native mlang returns completely messed up encodings in some cases */ + ok(mcsi.uiInternetEncoding == cpinfo[i].uiCodePage || mcsi.uiInternetEncoding == cpinfo[i].uiFamilyCodePage, + "%u != %u || %u\n", mcsi.uiInternetEncoding, cpinfo[i].uiCodePage, cpinfo[i].uiFamilyCodePage); + ok(mcsi.uiCodePage == cpinfo[i].uiCodePage || mcsi.uiCodePage == cpinfo[i].uiFamilyCodePage, + "%u != %u || %u\n", mcsi.uiCodePage, cpinfo[i].uiCodePage, cpinfo[i].uiFamilyCodePage); + } } - } - - ret = IMultiLanguage2_GetCharsetInfo(iML2, cpinfo[i].wszHeaderCharset, &mcsi); - /* _autoxxx charsets are a fake and GetCharsetInfo fails for them */ - if (memcmp(cpinfo[i].wszHeaderCharset, autoW, 5 * sizeof(WCHAR))) - { - ok (ret == S_OK, "IMultiLanguage2_GetCharsetInfo failed: %08x\n", ret); -#ifdef DUMP_CP_INFO - trace("%s: %u %u %s\n", wine_dbgstr_w(cpinfo[i].wszHeaderCharset), mcsi.uiCodePage, mcsi.uiInternetEncoding, wine_dbgstr_w(mcsi.wszCharset)); -#endif - ok(!lstrcmpiW(cpinfo[i].wszHeaderCharset, mcsi.wszCharset), -#ifdef DUMP_CP_INFO - "%s != %s\n", - wine_dbgstr_w(cpinfo[i].wszHeaderCharset), wine_dbgstr_w(mcsi.wszCharset)); -#else - "wszHeaderCharset mismatch\n"); -#endif - - if (0) - { - /* native mlang returns completely messed up encodings in some cases */ - ok(mcsi.uiInternetEncoding == cpinfo[i].uiCodePage || mcsi.uiInternetEncoding == cpinfo[i].uiFamilyCodePage, - "%u != %u || %u\n", mcsi.uiInternetEncoding, cpinfo[i].uiCodePage, cpinfo[i].uiFamilyCodePage); - ok(mcsi.uiCodePage == cpinfo[i].uiCodePage || mcsi.uiCodePage == cpinfo[i].uiFamilyCodePage, - "%u != %u || %u\n", mcsi.uiCodePage, cpinfo[i].uiCodePage, cpinfo[i].uiFamilyCodePage); - } - } + }
- ret = IMultiLanguage2_GetCharsetInfo(iML2, cpinfo[i].wszBodyCharset, &mcsi); - /* _autoxxx charsets are a fake and GetCharsetInfo fails for them */ - if (memcmp(cpinfo[i].wszBodyCharset, autoW, 5 * sizeof(WCHAR))) - { - ok (ret == S_OK, "IMultiLanguage2_GetCharsetInfo failed: %08x\n", ret); -#ifdef DUMP_CP_INFO - trace("%s: %u %u %s\n", wine_dbgstr_w(cpinfo[i].wszBodyCharset), mcsi.uiCodePage, mcsi.uiInternetEncoding, wine_dbgstr_w(mcsi.wszCharset)); -#endif - ok(!lstrcmpiW(cpinfo[i].wszBodyCharset, mcsi.wszCharset), -#ifdef DUMP_CP_INFO - "%s != %s\n", - wine_dbgstr_w(cpinfo[i].wszBodyCharset), wine_dbgstr_w(mcsi.wszCharset)); -#else - "wszBodyCharset mismatch\n"); -#endif + if (memcmp(cpinfo[i].wszHeaderCharset,feffW,sizeof(WCHAR)*11)==0) + skip("Legacy windows bug returning invalid charset of unicodeFEFF\n"); + else + { + ret = IMultiLanguage2_GetCharsetInfo(iML2, cpinfo[i].wszHeaderCharset, &mcsi); + /* _autoxxx charsets are a fake and GetCharsetInfo fails for them */ + if (memcmp(cpinfo[i].wszHeaderCharset, autoW, 5 * sizeof(WCHAR))) + { + ok (ret == S_OK, "IMultiLanguage2_GetCharsetInfo failed: %08x\n", ret); + #ifdef DUMP_CP_INFO + trace("%s: %u %u %s\n", wine_dbgstr_w(cpinfo[i].wszHeaderCharset), mcsi.uiCodePage, mcsi.uiInternetEncoding, wine_dbgstr_w(mcsi.wszCharset)); + #endif + ok(!lstrcmpiW(cpinfo[i].wszHeaderCharset, mcsi.wszCharset), + #ifdef DUMP_CP_INFO + "%s != %s\n", + wine_dbgstr_w(cpinfo[i].wszHeaderCharset), wine_dbgstr_w(mcsi.wszCharset)); + #else + "wszHeaderCharset mismatch\n"); + #endif + + if (0) + { + /* native mlang returns completely messed up encodings in some cases */ + ok(mcsi.uiInternetEncoding == cpinfo[i].uiCodePage || mcsi.uiInternetEncoding == cpinfo[i].uiFamilyCodePage, + "%u != %u || %u\n", mcsi.uiInternetEncoding, cpinfo[i].uiCodePage, cpinfo[i].uiFamilyCodePage); + ok(mcsi.uiCodePage == cpinfo[i].uiCodePage || mcsi.uiCodePage == cpinfo[i].uiFamilyCodePage, + "%u != %u || %u\n", mcsi.uiCodePage, cpinfo[i].uiCodePage, cpinfo[i].uiFamilyCodePage); + } + } + }
- if (0) - { - /* native mlang returns completely messed up encodings in some cases */ - ok(mcsi.uiInternetEncoding == cpinfo[i].uiCodePage || mcsi.uiInternetEncoding == cpinfo[i].uiFamilyCodePage, - "%u != %u || %u\n", mcsi.uiInternetEncoding, cpinfo[i].uiCodePage, cpinfo[i].uiFamilyCodePage); - ok(mcsi.uiCodePage == cpinfo[i].uiCodePage || mcsi.uiCodePage == cpinfo[i].uiFamilyCodePage, - "%u != %u || %u\n", mcsi.uiCodePage, cpinfo[i].uiCodePage, cpinfo[i].uiFamilyCodePage); - } - } + if (memcmp(cpinfo[i].wszBodyCharset,feffW,sizeof(WCHAR)*11)==0) + skip("Legacy windows bug returning invalid charset of unicodeFEFF\n"); + else + { + ret = IMultiLanguage2_GetCharsetInfo(iML2, cpinfo[i].wszBodyCharset, &mcsi); + /* _autoxxx charsets are a fake and GetCharsetInfo fails for them */ + if (memcmp(cpinfo[i].wszBodyCharset, autoW, 5 * sizeof(WCHAR))) + { + ok (ret == S_OK, "IMultiLanguage2_GetCharsetInfo failed: %08x\n", ret); + #ifdef DUMP_CP_INFO + trace("%s: %u %u %s\n", wine_dbgstr_w(cpinfo[i].wszBodyCharset), mcsi.uiCodePage, mcsi.uiInternetEncoding, wine_dbgstr_w(mcsi.wszCharset)); + #endif + ok(!lstrcmpiW(cpinfo[i].wszBodyCharset, mcsi.wszCharset), + #ifdef DUMP_CP_INFO + "%s != %s\n", + wine_dbgstr_w(cpinfo[i].wszBodyCharset), wine_dbgstr_w(mcsi.wszCharset)); + #else + "wszBodyCharset mismatch\n"); + #endif + + if (0) + { + /* native mlang returns completely messed up encodings in some cases */ + ok(mcsi.uiInternetEncoding == cpinfo[i].uiCodePage || mcsi.uiInternetEncoding == cpinfo[i].uiFamilyCodePage, + "%u != %u || %u\n", mcsi.uiInternetEncoding, cpinfo[i].uiCodePage, cpinfo[i].uiFamilyCodePage); + ok(mcsi.uiCodePage == cpinfo[i].uiCodePage || mcsi.uiCodePage == cpinfo[i].uiFamilyCodePage, + "%u != %u || %u\n", mcsi.uiCodePage, cpinfo[i].uiCodePage, cpinfo[i].uiFamilyCodePage); + } + } + } }
/* now IEnumCodePage_Next should fail, since pointer is at the end */