Commit 884f31b5 authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

mshtml/tests: Get rid of strcmp_wa() in script.c.

parent 5de16dce
...@@ -172,13 +172,6 @@ static BOOL skip_loadobject_tests; ...@@ -172,13 +172,6 @@ static BOOL skip_loadobject_tests;
static IActiveScriptSite *site; static IActiveScriptSite *site;
static SCRIPTSTATE state; static SCRIPTSTATE state;
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 BSTR a2bstr(const char *str) static BSTR a2bstr(const char *str)
{ {
BSTR ret; BSTR ret;
...@@ -509,21 +502,21 @@ static IDispatchEx funcDisp = { &testObjVtbl }; ...@@ -509,21 +502,21 @@ static IDispatchEx funcDisp = { &testObjVtbl };
static HRESULT WINAPI scriptDisp_GetDispID(IDispatchEx *iface, BSTR bstrName, DWORD grfdex, DISPID *pid) static HRESULT WINAPI scriptDisp_GetDispID(IDispatchEx *iface, BSTR bstrName, DWORD grfdex, DISPID *pid)
{ {
if(!strcmp_wa(bstrName, "testProp")) { if(!lstrcmpW(bstrName, L"testProp")) {
CHECK_EXPECT(script_testprop_d); CHECK_EXPECT(script_testprop_d);
ok(grfdex == fdexNameCaseSensitive, "grfdex = %x\n", grfdex); ok(grfdex == fdexNameCaseSensitive, "grfdex = %x\n", grfdex);
*pid = DISPID_SCRIPT_TESTPROP; *pid = DISPID_SCRIPT_TESTPROP;
return S_OK; return S_OK;
} }
if(!strcmp_wa(bstrName, "testProp2")) { if(!lstrcmpW(bstrName, L"testProp2")) {
CHECK_EXPECT(script_testprop2_d); CHECK_EXPECT(script_testprop2_d);
ok(grfdex == fdexNameCaseSensitive, "grfdex = %x\n", grfdex); ok(grfdex == fdexNameCaseSensitive, "grfdex = %x\n", grfdex);
*pid = DISPID_SCRIPT_TESTPROP2; *pid = DISPID_SCRIPT_TESTPROP2;
return S_OK; return S_OK;
} }
if(!strcmp_wa(bstrName, "divid")) { if(!lstrcmpW(bstrName, L"divid")) {
CHECK_EXPECT(script_divid_d); CHECK_EXPECT(script_divid_d);
ok(grfdex == fdexNameCaseSensitive, "grfdex = %x\n", grfdex); ok(grfdex == fdexNameCaseSensitive, "grfdex = %x\n", grfdex);
return E_FAIL; return E_FAIL;
...@@ -583,31 +576,31 @@ static IDispatchEx scriptDisp = { &scriptDispVtbl }; ...@@ -583,31 +576,31 @@ static IDispatchEx scriptDisp = { &scriptDispVtbl };
static HRESULT WINAPI externalDisp_GetDispID(IDispatchEx *iface, BSTR bstrName, DWORD grfdex, DISPID *pid) static HRESULT WINAPI externalDisp_GetDispID(IDispatchEx *iface, BSTR bstrName, DWORD grfdex, DISPID *pid)
{ {
if(!strcmp_wa(bstrName, "ok")) { if(!lstrcmpW(bstrName, L"ok")) {
*pid = DISPID_EXTERNAL_OK; *pid = DISPID_EXTERNAL_OK;
return S_OK; return S_OK;
} }
if(!strcmp_wa(bstrName, "trace")) { if(!lstrcmpW(bstrName, L"trace")) {
*pid = DISPID_EXTERNAL_TRACE; *pid = DISPID_EXTERNAL_TRACE;
return S_OK; return S_OK;
} }
if(!strcmp_wa(bstrName, "reportSuccess")) { if(!lstrcmpW(bstrName, L"reportSuccess")) {
*pid = DISPID_EXTERNAL_REPORTSUCCESS; *pid = DISPID_EXTERNAL_REPORTSUCCESS;
return S_OK; return S_OK;
} }
if(!strcmp_wa(bstrName, "todo_wine_ok")) { if(!lstrcmpW(bstrName, L"todo_wine_ok")) {
*pid = DISPID_EXTERNAL_TODO_WINE_OK; *pid = DISPID_EXTERNAL_TODO_WINE_OK;
return S_OK; return S_OK;
} }
if(!strcmp_wa(bstrName, "broken")) { if(!lstrcmpW(bstrName, L"broken")) {
*pid = DISPID_EXTERNAL_BROKEN; *pid = DISPID_EXTERNAL_BROKEN;
return S_OK; return S_OK;
} }
if(!strcmp_wa(bstrName, "win_skip")) { if(!lstrcmpW(bstrName, L"win_skip")) {
*pid = DISPID_EXTERNAL_WIN_SKIP; *pid = DISPID_EXTERNAL_WIN_SKIP;
return S_OK; return S_OK;
} }
if(!strcmp_wa(bstrName, "writeStream")) { if(!lstrcmpW(bstrName, L"writeStream")) {
*pid = DISPID_EXTERNAL_WRITESTREAM; *pid = DISPID_EXTERNAL_WRITESTREAM;
return S_OK; return S_OK;
} }
...@@ -1981,7 +1974,7 @@ static void test_func(IDispatchEx *obj) ...@@ -1981,7 +1974,7 @@ static void test_func(IDispatchEx *obj)
VARIANT args[2]; VARIANT args[2];
ok(V_VT(&var) == VT_BSTR, "V_VT(var)=%d\n", V_VT(&var)); ok(V_VT(&var) == VT_BSTR, "V_VT(var)=%d\n", V_VT(&var));
ok(!strcmp_wa(V_BSTR(&var), "[object]"), "V_BSTR(var) = %s\n", wine_dbgstr_w(V_BSTR(&var))); ok(!lstrcmpW(V_BSTR(&var), L"[object]"), "V_BSTR(var) = %s\n", wine_dbgstr_w(V_BSTR(&var)));
VariantClear(&var); VariantClear(&var);
dp.rgdispidNamedArgs = named_args; dp.rgdispidNamedArgs = named_args;
...@@ -1995,7 +1988,7 @@ static void test_func(IDispatchEx *obj) ...@@ -1995,7 +1988,7 @@ static void test_func(IDispatchEx *obj)
hres = IDispatchEx_Invoke(dispex, DISPID_VALUE, &IID_NULL, LOCALE_NEUTRAL, DISPATCH_METHOD, &dp, &var, &ei, NULL); hres = IDispatchEx_Invoke(dispex, DISPID_VALUE, &IID_NULL, LOCALE_NEUTRAL, DISPATCH_METHOD, &dp, &var, &ei, NULL);
ok(hres == S_OK, "InvokeEx failed: %08x\n", hres); ok(hres == S_OK, "InvokeEx failed: %08x\n", hres);
ok(V_VT(&var) == VT_BSTR, "V_VT(var)=%d\n", V_VT(&var)); ok(V_VT(&var) == VT_BSTR, "V_VT(var)=%d\n", V_VT(&var));
ok(!strcmp_wa(V_BSTR(&var), "[object]"), "V_BSTR(var) = %s\n", wine_dbgstr_w(V_BSTR(&var))); ok(!lstrcmpW(V_BSTR(&var), L"[object]"), "V_BSTR(var) = %s\n", wine_dbgstr_w(V_BSTR(&var)));
VariantClear(&var); VariantClear(&var);
} }
...@@ -2014,7 +2007,7 @@ static void test_func(IDispatchEx *obj) ...@@ -2014,7 +2007,7 @@ static void test_func(IDispatchEx *obj)
hres = dispex_propget(dispex, DISPID_VALUE, &var, &caller_sp); hres = dispex_propget(dispex, DISPID_VALUE, &var, &caller_sp);
ok(hres == S_OK, "InvokeEx returned: %08x, expected S_OK\n", hres); ok(hres == S_OK, "InvokeEx returned: %08x, expected S_OK\n", hres);
ok(V_VT(&var) == VT_BSTR, "V_VT(var) = %d\n", V_VT(&var)); ok(V_VT(&var) == VT_BSTR, "V_VT(var) = %d\n", V_VT(&var));
ok(!strcmp_wa(V_BSTR(&var), "\nfunction toString() {\n [native code]\n}\n"), ok(!lstrcmpW(V_BSTR(&var), L"\nfunction toString() {\n [native code]\n}\n"),
"V_BSTR(var) = %s\n", wine_dbgstr_w(V_BSTR(&var))); "V_BSTR(var) = %s\n", wine_dbgstr_w(V_BSTR(&var)));
VariantClear(&var); VariantClear(&var);
todo_wine CHECK_CALLED(QS_IActiveScriptSite); todo_wine CHECK_CALLED(QS_IActiveScriptSite);
...@@ -2049,9 +2042,9 @@ static void test_nextdispid(IDispatchEx *dispex) ...@@ -2049,9 +2042,9 @@ static void test_nextdispid(IDispatchEx *dispex)
ok(hres == S_OK, "GetMemberName failed: %08x\n", hres); ok(hres == S_OK, "GetMemberName failed: %08x\n", hres);
if(id == dyn_id) if(id == dyn_id)
ok(!strcmp_wa(name, "dynVal"), "name = %s\n", wine_dbgstr_w(name)); ok(!lstrcmpW(name, L"dynVal"), "name = %s\n", wine_dbgstr_w(name));
else if(id == DISPID_IOMNAVIGATOR_PLATFORM) else if(id == DISPID_IOMNAVIGATOR_PLATFORM)
ok(!strcmp_wa(name, "platform"), "name = %s\n", wine_dbgstr_w(name)); ok(!lstrcmpW(name, L"platform"), "name = %s\n", wine_dbgstr_w(name));
SysFreeString(name); SysFreeString(name);
last_id = id; last_id = id;
...@@ -2465,19 +2458,19 @@ static HRESULT WINAPI ActiveScriptParse_ParseScriptText(IActiveScriptParse *ifac ...@@ -2465,19 +2458,19 @@ static HRESULT WINAPI ActiveScriptParse_ParseScriptText(IActiveScriptParse *ifac
ok(pvarResult != NULL, "pvarResult == NULL\n"); ok(pvarResult != NULL, "pvarResult == NULL\n");
ok(pexcepinfo != NULL, "pexcepinfo == NULL\n"); ok(pexcepinfo != NULL, "pexcepinfo == NULL\n");
if(!strcmp_wa(pstrCode, "execScript call")) { if(!lstrcmpW(pstrCode, L"execScript call")) {
CHECK_EXPECT(ParseScriptText_execScript); CHECK_EXPECT(ParseScriptText_execScript);
ok(!pstrItemName, "pstrItemName = %s\n", wine_dbgstr_w(pstrItemName)); ok(!pstrItemName, "pstrItemName = %s\n", wine_dbgstr_w(pstrItemName));
ok(!strcmp_wa(pstrDelimiter, "\""), "pstrDelimiter = %s\n", wine_dbgstr_w(pstrDelimiter)); ok(!lstrcmpW(pstrDelimiter, L"\""), "pstrDelimiter = %s\n", wine_dbgstr_w(pstrDelimiter));
ok(dwFlags == SCRIPTTEXT_ISVISIBLE, "dwFlags = %x\n", dwFlags); ok(dwFlags == SCRIPTTEXT_ISVISIBLE, "dwFlags = %x\n", dwFlags);
V_VT(pvarResult) = VT_I4; V_VT(pvarResult) = VT_I4;
V_I4(pvarResult) = 10; V_I4(pvarResult) = 10;
return S_OK; return S_OK;
}else if(!strcmp_wa(pstrCode, "simple script")) { }else if(!lstrcmpW(pstrCode, L"simple script")) {
CHECK_EXPECT(ParseScriptText_script); CHECK_EXPECT(ParseScriptText_script);
ok(!strcmp_wa(pstrItemName, "window"), "pstrItemName = %s\n", wine_dbgstr_w(pstrItemName)); ok(!lstrcmpW(pstrItemName, L"window"), "pstrItemName = %s\n", wine_dbgstr_w(pstrItemName));
ok(!strcmp_wa(pstrDelimiter, "</SCRIPT>"), "pstrDelimiter = %s\n", wine_dbgstr_w(pstrDelimiter)); ok(!lstrcmpW(pstrDelimiter, L"</SCRIPT>"), "pstrDelimiter = %s\n", wine_dbgstr_w(pstrDelimiter));
ok(dwFlags == (SCRIPTTEXT_ISVISIBLE|SCRIPTTEXT_HOSTMANAGESSOURCE), "dwFlags = %x\n", dwFlags); ok(dwFlags == (SCRIPTTEXT_ISVISIBLE|SCRIPTTEXT_HOSTMANAGESSOURCE), "dwFlags = %x\n", dwFlags);
test_script_run(); test_script_run();
...@@ -2682,7 +2675,7 @@ static HRESULT WINAPI ActiveScript_GetScriptDispatch(IActiveScript *iface, LPCOL ...@@ -2682,7 +2675,7 @@ static HRESULT WINAPI ActiveScript_GetScriptDispatch(IActiveScript *iface, LPCOL
{ {
CHECK_EXPECT(GetScriptDispatch); CHECK_EXPECT(GetScriptDispatch);
ok(!strcmp_wa(pstrItemName, "window"), "pstrItemName = %s\n", wine_dbgstr_w(pstrItemName)); ok(!lstrcmpW(pstrItemName, L"window"), "pstrItemName = %s\n", wine_dbgstr_w(pstrItemName));
if(!script_disp) if(!script_disp)
return E_NOTIMPL; return E_NOTIMPL;
...@@ -3102,10 +3095,10 @@ static HRESULT WINAPI ProtocolEx_StartEx(IInternetProtocolEx *iface, IUri *uri, ...@@ -3102,10 +3095,10 @@ static HRESULT WINAPI ProtocolEx_StartEx(IInternetProtocolEx *iface, IUri *uri,
if(FAILED(hres)) if(FAILED(hres))
return hres; return hres;
if(!strcmp_wa(path, "/index.html")) { if(!lstrcmpW(path, L"/index.html")) {
This->data = index_html_data; This->data = index_html_data;
This->size = strlen(This->data); This->size = strlen(This->data);
}else if(!strcmp_wa(path, "/echo.php")) { }else if(!lstrcmpW(path, L"/echo.php")) {
ok(This->bind_info.dwBindVerb == BINDVERB_POST, "unexpected bind verb %d\n", This->bind_info.dwBindVerb == BINDVERB_POST); ok(This->bind_info.dwBindVerb == BINDVERB_POST, "unexpected bind verb %d\n", This->bind_info.dwBindVerb == BINDVERB_POST);
todo_wine ok(This->bind_info.stgmedData.tymed == TYMED_ISTREAM, "tymed = %x\n", This->bind_info.stgmedData.tymed); todo_wine ok(This->bind_info.stgmedData.tymed == TYMED_ISTREAM, "tymed = %x\n", This->bind_info.stgmedData.tymed);
switch(This->bind_info.stgmedData.tymed) { switch(This->bind_info.stgmedData.tymed) {
...@@ -3120,7 +3113,7 @@ static HRESULT WINAPI ProtocolEx_StartEx(IInternetProtocolEx *iface, IUri *uri, ...@@ -3120,7 +3113,7 @@ static HRESULT WINAPI ProtocolEx_StartEx(IInternetProtocolEx *iface, IUri *uri,
default: default:
ok(0, "unexpected tymed %d\n", This->bind_info.stgmedData.tymed); ok(0, "unexpected tymed %d\n", This->bind_info.stgmedData.tymed);
} }
}else if(!strcmp_wa(path, "/jsstream.php")) { }else if(!lstrcmpW(path, L"/jsstream.php")) {
BSTR query; BSTR query;
hres = IUri_GetQuery(uri, &query); hres = IUri_GetQuery(uri, &query);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment