Paul Vriens : mshtml/tests: Fix some test failures on Win98 and WinME.
Alexandre Julliard
julliard at winehq.org
Thu Sep 10 09:07:51 CDT 2009
Module: wine
Branch: master
Commit: 094b6688817e42c74c0a95f65c1c0f8698059944
URL: http://source.winehq.org/git/wine.git/?a=commit;h=094b6688817e42c74c0a95f65c1c0f8698059944
Author: Paul Vriens <Paul.Vriens.Wine at gmail.com>
Date: Wed Sep 9 22:31:50 2009 +0200
mshtml/tests: Fix some test failures on Win98 and WinME.
---
dlls/mshtml/tests/htmldoc.c | 28 +++++++++++++++-------------
1 files changed, 15 insertions(+), 13 deletions(-)
diff --git a/dlls/mshtml/tests/htmldoc.c b/dlls/mshtml/tests/htmldoc.c
index 97d451c..15aeca4 100644
--- a/dlls/mshtml/tests/htmldoc.c
+++ b/dlls/mshtml/tests/htmldoc.c
@@ -202,6 +202,13 @@ static const char *debugstr_guid(REFIID riid)
return buf;
}
+static int strcmp_wa(LPCWSTR strw, const char *stra)
+{
+ CHAR buf[512];
+ WideCharToMultiByte(CP_ACP, 0, strw, -1, buf, sizeof(buf), NULL, NULL);
+ return lstrcmpA(stra, buf);
+}
+
static BOOL is_english(void)
{
return PRIMARYLANGID(GetSystemDefaultLangID()) == LANG_ENGLISH
@@ -2553,18 +2560,13 @@ static void _test_readyState(unsigned line, IUnknown *unk)
VARIANT out;
HRESULT hres;
- static const WCHAR wszUninitialized[] = {'u','n','i','n','i','t','i','a','l','i','z','e','d',0};
- static const WCHAR wszLoading[] = {'l','o','a','d','i','n','g',0};
- static const WCHAR wszInteractive[] = {'i','n','t','e','r','a','c','t','i','v','e',0};
- static const WCHAR wszComplete[] = {'c','o','m','p','l','e','t','e',0};
-
- static const LPCWSTR expected_state[] = {
- wszUninitialized,
- wszLoading,
+ static const LPCSTR expected_state[] = {
+ "uninitialized",
+ "loading",
NULL,
- wszInteractive,
- wszComplete,
- wszUninitialized
+ "interactive",
+ "complete",
+ "uninitialized"
};
if(!unk)
@@ -2581,11 +2583,11 @@ static void _test_readyState(unsigned line, IUnknown *unk)
hres = IHTMLDocument2_get_readyState(htmldoc, &state);
ok(hres == S_OK, "get_ReadyState failed: %08x\n", hres);
- if(!lstrcmpW(state, wszInteractive) && load_state == LD_LOADING)
+ if(!strcmp_wa(state, "interactive") && load_state == LD_LOADING)
load_state = LD_INTERACTIVE;
ok_(__FILE__, line)
- (!lstrcmpW(state, expected_state[load_state]), "unexpected state %s, expected %d\n",
+ (!strcmp_wa(state, expected_state[load_state]), "unexpected state %s, expected %d\n",
wine_dbgstr_w(state), load_state);
SysFreeString(state);
More information about the wine-cvs
mailing list