msxml3/tests: Build without -DWINE_NO_LONG_TYPES.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2022-02-23 09:46:35 +03:00 committed by Alexandre Julliard
parent a419ff8b6f
commit aebd8cd514
8 changed files with 3843 additions and 3564 deletions

View file

@ -1,4 +1,3 @@
EXTRADEFS = -DWINE_NO_LONG_TYPES
TESTDLL = msxml3.dll
IMPORTS = oleaut32 ole32 user32 shlwapi

File diff suppressed because it is too large Load diff

View file

@ -38,16 +38,13 @@
#include "wine/heap.h"
#include "wine/test.h"
#define EXPECT_HR(hr,hr_exp) \
ok(hr == hr_exp, "got 0x%08x, expected 0x%08x\n", hr, hr_exp)
#define EXPECT_REF(node,ref) _expect_ref((IUnknown*)node, ref, __LINE__)
static void _expect_ref(IUnknown* obj, ULONG ref, int line)
{
ULONG rc;
IUnknown_AddRef(obj);
rc = IUnknown_Release(obj);
ok_(__FILE__, line)(rc == ref, "expected refcount %d, got %d\n", ref, rc);
ok_(__FILE__, line)(rc == ref, "expected refcount %ld, got %ld.\n", ref, rc);
}
#define check_interface(a, b, c) check_interface_(__LINE__, a, b, c)
@ -60,7 +57,7 @@ static void check_interface_(unsigned int line, void *iface_ptr, REFIID iid, BOO
expected_hr = supported ? S_OK : E_NOINTERFACE;
hr = IUnknown_QueryInterface(iface, iid, (void **)&unk);
ok_(__FILE__, line)(hr == expected_hr, "Got hr %#x, expected %#x.\n", hr, expected_hr);
ok_(__FILE__, line)(hr == expected_hr, "Got hr %#lx, expected %#lx.\n", hr, expected_hr);
if (SUCCEEDED(hr))
IUnknown_Release(unk);
}
@ -1286,8 +1283,8 @@ static HRESULT WINAPI dispevent_Invoke(IDispatch *iface, DISPID member, REFIID r
LONG state;
HRESULT hr;
ok(member == 0, "expected 0 member, got %d\n", member);
ok(lcid == LOCALE_SYSTEM_DEFAULT, "expected LOCALE_SYSTEM_DEFAULT, got lcid %x\n", lcid);
ok(!member, "expected 0 member, got %ld.\n", member);
ok(lcid == LOCALE_SYSTEM_DEFAULT, "expected LOCALE_SYSTEM_DEFAULT, got lcid %lx.\n", lcid);
ok(flags == DISPATCH_METHOD, "expected DISPATCH_METHOD, got %d\n", flags);
ok(params->cArgs == 0, "got %d\n", params->cArgs);
@ -1303,13 +1300,13 @@ static HRESULT WINAPI dispevent_Invoke(IDispatch *iface, DISPID member, REFIID r
state = READYSTATE_UNINITIALIZED;
hr = IXMLHttpRequest_get_readyState(httpreq, &state);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
if (state == READYSTATE_COMPLETE)
{
BSTR text = NULL;
hr = IXMLHttpRequest_get_responseText(httpreq, &text);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
SysFreeString(text);
}
@ -1364,10 +1361,10 @@ static void set_safety_opt(IUnknown *unk, DWORD mask, DWORD opts)
HRESULT hr;
hr = IUnknown_QueryInterface(unk, &IID_IObjectSafety, (void**)&obj_safety);
ok(hr == S_OK, "Could not get IObjectSafety iface: %08x\n", hr);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IObjectSafety_SetInterfaceSafetyOptions(obj_safety, &IID_IDispatch, mask, mask&opts);
ok(hr == S_OK, "SetInterfaceSafetyOptions failed: %08x\n", hr);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IObjectSafety_Release(obj_safety);
}
@ -1378,7 +1375,7 @@ static void set_xhr_site(IXMLHttpRequest *xhr)
HRESULT hr;
hr = IXMLHttpRequest_QueryInterface(xhr, &IID_IObjectWithSite, (void**)&obj_site);
ok(hr == S_OK, "Could not get IObjectWithSite iface: %08x\n", hr);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
g_enablecallchecks = TRUE;
@ -1398,7 +1395,7 @@ static void set_xhr_site(IXMLHttpRequest *xhr)
SET_EXPECT(site_qi_IOleClientSite);
hr = IObjectWithSite_SetSite(obj_site, &testsite);
EXPECT_HR(hr, S_OK);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
CHECK_CALLED(site_qi_IServiceProvider);
todo_wine
@ -1436,7 +1433,7 @@ static void _test_open(unsigned line, IXMLHttpRequest *xhr, const char *method,
V_BOOL(&vfalse) = VARIANT_FALSE;
hr = IXMLHttpRequest_open(xhr, _bstr_(method), _bstr_(url), vfalse, empty, empty);
ok_(__FILE__,line)(hr == exhres, "open(%s %s) failed: %08x, expected %08x\n", method, url, hr, exhres);
ok_(__FILE__,line)(hr == exhres, "open(%s %s) failed: %#lx, expected %#lx.\n", method, url, hr, exhres);
}
#define test_server_open(a,b,c,d) _test_server_open(__LINE__,a,b,c,d)
@ -1450,7 +1447,7 @@ static void _test_server_open(unsigned line, IServerXMLHTTPRequest *xhr, const c
V_BOOL(&vfalse) = VARIANT_FALSE;
hr = IServerXMLHTTPRequest_open(xhr, _bstr_(method), _bstr_(url), vfalse, empty, empty);
ok_(__FILE__,line)(hr == exhres, "open(%s %s) failed: %08x, expected %08x\n", method, url, hr, exhres);
ok_(__FILE__,line)(hr == exhres, "open(%s %s) failed: %#lx, expected %#lx.\n", method, url, hr, exhres);
}
static void test_XMLHTTP(void)
@ -1481,38 +1478,38 @@ static void test_XMLHTTP(void)
V_ERROR(&dummy) = DISP_E_MEMBERNOTFOUND;
hr = IXMLHttpRequest_put_onreadystatechange(xhr, NULL);
EXPECT_HR(hr, S_OK);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXMLHttpRequest_abort(xhr);
EXPECT_HR(hr, S_OK);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
V_VT(&varbody) = VT_I2;
V_I2(&varbody) = 1;
hr = IXMLHttpRequest_get_responseBody(xhr, &varbody);
EXPECT_HR(hr, E_PENDING);
ok(hr == E_PENDING, "Unexpected hr %#lx.\n", hr);
ok(V_VT(&varbody) == VT_EMPTY, "got type %d\n", V_VT(&varbody));
V_VT(&varbody) = VT_I2;
V_I2(&varbody) = 1;
hr = IXMLHttpRequest_get_responseStream(xhr, &varbody);
EXPECT_HR(hr, E_PENDING);
ok(hr == E_PENDING, "Unexpected hr %#lx.\n", hr);
ok(V_VT(&varbody) == VT_EMPTY, "got type %d\n", V_VT(&varbody));
/* send before open */
hr = IXMLHttpRequest_send(xhr, dummy);
ok(hr == E_FAIL || broken(hr == E_UNEXPECTED) /* win2k */, "got 0x%08x\n", hr);
ok(hr == E_FAIL || broken(hr == E_UNEXPECTED) /* win2k */, "Unexpected hr %#lx.\n", hr);
/* initial status code */
hr = IXMLHttpRequest_get_status(xhr, NULL);
ok(hr == E_POINTER || broken(hr == E_INVALIDARG) /* <win8 */, "got 0x%08x\n", hr);
ok(hr == E_POINTER || broken(hr == E_INVALIDARG) /* <win8 */, "Unexpected hr %#lx.\n", hr);
status = 0xdeadbeef;
hr = IXMLHttpRequest_get_status(xhr, &status);
ok(hr == E_FAIL || broken(hr == E_UNEXPECTED) /* win2k */, "got 0x%08x\n", hr);
ok(status == READYSTATE_UNINITIALIZED || broken(status == 0xdeadbeef) /* <win8 */, "got %d\n", status);
ok(hr == E_FAIL || broken(hr == E_UNEXPECTED) /* win2k */, "Unexpected hr %#lx.\n", hr);
ok(status == READYSTATE_UNINITIALIZED || broken(status == 0xdeadbeef) /* <win8 */, "Unexpected state %ld.\n", status);
hr = IXMLHttpRequest_get_statusText(xhr, &str);
ok(hr == E_FAIL, "got 0x%08x\n", hr);
ok(hr == E_FAIL, "Unexpected hr %#lx.\n", hr);
/* invalid parameters */
test_open(xhr, NULL, NULL, E_INVALIDARG);
@ -1520,31 +1517,31 @@ static void test_XMLHTTP(void)
test_open(xhr, NULL, urlA, E_INVALIDARG);
hr = IXMLHttpRequest_setRequestHeader(xhr, NULL, NULL);
EXPECT_HR(hr, E_INVALIDARG);
ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = IXMLHttpRequest_setRequestHeader(xhr, _bstr_("header1"), NULL);
ok(hr == E_FAIL || broken(hr == E_UNEXPECTED) /* win2k */, "got 0x%08x\n", hr);
ok(hr == E_FAIL || broken(hr == E_UNEXPECTED) /* win2k */, "Unexpected hr %#lx.\n", hr);
hr = IXMLHttpRequest_setRequestHeader(xhr, NULL, _bstr_("value1"));
EXPECT_HR(hr, E_INVALIDARG);
ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = IXMLHttpRequest_setRequestHeader(xhr, _bstr_("header1"), _bstr_("value1"));
ok(hr == E_FAIL || broken(hr == E_UNEXPECTED) /* win2k */, "got 0x%08x\n", hr);
ok(hr == E_FAIL || broken(hr == E_UNEXPECTED) /* win2k */, "Unexpected hr %#lx.\n", hr);
hr = IXMLHttpRequest_get_readyState(xhr, NULL);
ok(hr == E_POINTER || broken(hr == E_INVALIDARG) /* <win8 */, "got 0x%08x\n", hr);
ok(hr == E_POINTER || broken(hr == E_INVALIDARG) /* <win8 */, "Unexpected hr %#lx.\n", hr);
state = -1;
hr = IXMLHttpRequest_get_readyState(xhr, &state);
EXPECT_HR(hr, S_OK);
ok(state == READYSTATE_UNINITIALIZED, "got %d, expected READYSTATE_UNINITIALIZED\n", state);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(state == READYSTATE_UNINITIALIZED, "Unexpected state %ld.\n", state);
httpreq = xhr;
event = create_dispevent();
EXPECT_REF(event, 1);
hr = IXMLHttpRequest_put_onreadystatechange(xhr, event);
EXPECT_HR(hr, S_OK);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
EXPECT_REF(event, 2);
g_unexpectedcall = g_expectedcall = 0;
@ -1557,33 +1554,33 @@ static void test_XMLHTTP(void)
/* status code after ::open() */
status = 0xdeadbeef;
hr = IXMLHttpRequest_get_status(xhr, &status);
ok(hr == E_FAIL || broken(hr == E_UNEXPECTED) /* win2k */, "got 0x%08x\n", hr);
ok(status == READYSTATE_UNINITIALIZED || broken(status == 0xdeadbeef) /* <win8 */, "got %d\n", status);
ok(hr == E_FAIL || broken(hr == E_UNEXPECTED) /* win2k */, "Unexpected hr %#lx.\n", hr);
ok(status == READYSTATE_UNINITIALIZED || broken(status == 0xdeadbeef) /* <win8 */, "Unexpected state %ld.\n", status);
state = -1;
hr = IXMLHttpRequest_get_readyState(xhr, &state);
EXPECT_HR(hr, S_OK);
ok(state == READYSTATE_LOADING, "got %d, expected READYSTATE_LOADING\n", state);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(state == READYSTATE_LOADING, "Unexpected state %ld.\n", state);
hr = IXMLHttpRequest_abort(xhr);
EXPECT_HR(hr, S_OK);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
state = -1;
hr = IXMLHttpRequest_get_readyState(xhr, &state);
EXPECT_HR(hr, S_OK);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(state == READYSTATE_UNINITIALIZED || broken(state == READYSTATE_LOADING) /* win2k */,
"got %d, expected READYSTATE_UNINITIALIZED\n", state);
"Unexpected state %ld.\n", state);
test_open(xhr, "POST", urlA, S_OK);
hr = IXMLHttpRequest_setRequestHeader(xhr, _bstr_("header1"), _bstr_("value1"));
EXPECT_HR(hr, S_OK);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXMLHttpRequest_setRequestHeader(xhr, NULL, _bstr_("value1"));
EXPECT_HR(hr, E_INVALIDARG);
ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = IXMLHttpRequest_setRequestHeader(xhr, _bstr_(""), _bstr_("value1"));
EXPECT_HR(hr, E_INVALIDARG);
ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
V_VT(&varbody) = VT_BSTR;
V_BSTR(&varbody) = _bstr_(bodyA);
@ -1595,42 +1592,42 @@ static void test_XMLHTTP(void)
IXMLHttpRequest_Release(xhr);
return;
}
EXPECT_HR(hr, S_OK);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* response headers */
hr = IXMLHttpRequest_getAllResponseHeaders(xhr, NULL);
ok(hr == E_POINTER || broken(hr == E_INVALIDARG) /* <win8 */, "got 0x%08x\n", hr);
ok(hr == E_POINTER || broken(hr == E_INVALIDARG) /* <win8 */, "Unexpected hr %#lx.\n", hr);
hr = IXMLHttpRequest_getAllResponseHeaders(xhr, &str);
EXPECT_HR(hr, S_OK);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* status line is stripped already */
ok(memcmp(str, L"HTTP", 4*sizeof(WCHAR)), "got response headers %s\n", wine_dbgstr_w(str));
ok(*str, "got empty headers\n");
hr = IXMLHttpRequest_getAllResponseHeaders(xhr, &str1);
EXPECT_HR(hr, S_OK);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(str1 != str, "got %p\n", str1);
SysFreeString(str1);
SysFreeString(str);
hr = IXMLHttpRequest_getResponseHeader(xhr, NULL, NULL);
EXPECT_HR(hr, E_INVALIDARG);
ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = IXMLHttpRequest_getResponseHeader(xhr, _bstr_("Date"), NULL);
ok(hr == E_POINTER || broken(hr == E_INVALIDARG) /* <win8 */, "got 0x%08x\n", hr);
ok(hr == E_POINTER || broken(hr == E_INVALIDARG) /* <win8 */, "Unexpected hr %#lx.\n", hr);
hr = IXMLHttpRequest_getResponseHeader(xhr, _bstr_("Date"), &str);
EXPECT_HR(hr, S_OK);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(*str != ' ', "got leading space in header %s\n", wine_dbgstr_w(str));
SysFreeString(str);
/* status code after ::send() */
status = 0xdeadbeef;
status = 0;
hr = IXMLHttpRequest_get_status(xhr, &status);
EXPECT_HR(hr, S_OK);
ok(status == 200, "got %d\n", status);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(status == 200, "Unexpected status %ld.\n", status);
hr = IXMLHttpRequest_get_statusText(xhr, NULL);
ok(hr == E_POINTER || broken(hr == E_INVALIDARG) /* <win8 */, "got 0x%08x\n", hr);
ok(hr == E_POINTER || broken(hr == E_INVALIDARG) /* <win8 */, "Unexpected hr %#lx.\n", hr);
hr = IXMLHttpRequest_get_statusText(xhr, &str);
EXPECT_HR(hr, S_OK);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(!lstrcmpW(str, L"OK"), "got status %s\n", wine_dbgstr_w(str));
SysFreeString(str);
@ -1639,10 +1636,10 @@ static void test_XMLHTTP(void)
V_BSTR(&varbody) = _bstr_(bodyA);
hr = IXMLHttpRequest_send(xhr, varbody);
ok(hr == E_FAIL || broken(hr == E_UNEXPECTED) /* win2k */, "got 0x%08x\n", hr);
ok(hr == E_FAIL || broken(hr == E_UNEXPECTED) /* win2k */, "Unexpected hr %#lx.\n", hr);
hr = IXMLHttpRequest_get_responseText(xhr, &bstrResponse);
EXPECT_HR(hr, S_OK);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* the server currently returns "FAILED" because the Content-Type header is
* not what the server expects */
if(hr == S_OK)
@ -1656,7 +1653,7 @@ static void test_XMLHTTP(void)
test_open(xhr, "POST", urlA, S_OK);
hr = IXMLHttpRequest_send(xhr, varbody);
EXPECT_HR(hr, S_OK);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* GET request */
test_open(xhr, "GET", xmltestA, S_OK);
@ -1670,33 +1667,33 @@ static void test_XMLHTTP(void)
IXMLHttpRequest_Release(xhr);
return;
}
EXPECT_HR(hr, S_OK);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXMLHttpRequest_get_responseText(xhr, NULL);
ok(hr == E_POINTER || broken(hr == E_INVALIDARG) /* <win8 */, "got 0x%08x\n", hr);
ok(hr == E_POINTER || broken(hr == E_INVALIDARG) /* <win8 */, "Unexpected hr %#lx.\n", hr);
hr = IXMLHttpRequest_get_responseText(xhr, &bstrResponse);
EXPECT_HR(hr, S_OK);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(!memcmp(bstrResponse, _bstr_(xmltestbodyA), sizeof(xmltestbodyA)*sizeof(WCHAR)),
"expected %s, got %s\n", xmltestbodyA, wine_dbgstr_w(bstrResponse));
SysFreeString(bstrResponse);
hr = IXMLHttpRequest_get_responseBody(xhr, NULL);
EXPECT_HR(hr, E_INVALIDARG);
ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
V_VT(&varbody) = VT_EMPTY;
hr = IXMLHttpRequest_get_responseBody(xhr, &varbody);
EXPECT_HR(hr, S_OK);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(V_VT(&varbody) == (VT_ARRAY|VT_UI1), "got type %d, expected %d\n", V_VT(&varbody), VT_ARRAY|VT_UI1);
ok(SafeArrayGetDim(V_ARRAY(&varbody)) == 1, "got %d, expected one dimension\n", SafeArrayGetDim(V_ARRAY(&varbody)));
bound = -1;
hr = SafeArrayGetLBound(V_ARRAY(&varbody), 1, &bound);
EXPECT_HR(hr, S_OK);
ok(bound == 0, "got %d, expected zero bound\n", bound);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(!bound, "Unexpected bound %ld.\n", bound);
hr = SafeArrayAccessData(V_ARRAY(&varbody), &ptr);
EXPECT_HR(hr, S_OK);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(memcmp(ptr, xmltestbodyA, sizeof(xmltestbodyA)-1) == 0, "got wrong body data\n");
SafeArrayUnaccessData(V_ARRAY(&varbody));
@ -1704,17 +1701,17 @@ static void test_XMLHTTP(void)
/* get_responseStream */
hr = IXMLHttpRequest_get_responseStream(xhr, NULL);
EXPECT_HR(hr, E_INVALIDARG);
ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
V_VT(&varbody) = VT_EMPTY;
hr = IXMLHttpRequest_get_responseStream(xhr, &varbody);
ok(V_VT(&varbody) == VT_UNKNOWN, "got type %d\n", V_VT(&varbody));
EXPECT_HR(hr, S_OK);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
EXPECT_REF(V_UNKNOWN(&varbody), 1);
g = NULL;
hr = GetHGlobalFromStream((IStream*)V_UNKNOWN(&varbody), &g);
EXPECT_HR(hr, S_OK);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(g != NULL, "got %p\n", g);
VariantClear(&varbody);
@ -1725,21 +1722,21 @@ static void test_XMLHTTP(void)
V_VT(&varbody) = VT_EMPTY;
hr = IXMLHttpRequest_send(xhr, varbody);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXMLHttpRequest_get_responseText(xhr, &str);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(!lstrcmpW(str, L"no referer set"), "got response text %s\n", wine_dbgstr_w(str));
SysFreeString(str);
/* interaction with object site */
hr = IXMLHttpRequest_QueryInterface(xhr, &IID_IObjectWithSite, (void**)&obj_site);
EXPECT_HR(hr, S_OK);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IObjectWithSite_SetSite(obj_site, NULL);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXMLHttpRequest_QueryInterface(xhr, &IID_IObjectWithSite, (void**)&obj_site2);
EXPECT_HR(hr, S_OK);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(obj_site == obj_site2 || broken(obj_site != obj_site2), "got new instance\n");
IObjectWithSite_Release(obj_site2);
@ -1750,38 +1747,38 @@ static void test_XMLHTTP(void)
V_VT(&varbody) = VT_EMPTY;
hr = IXMLHttpRequest_send(xhr, varbody);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXMLHttpRequest_get_responseText(xhr, &str);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(!lstrcmpW(str, str1), "got response text %s, expected %s\n", wine_dbgstr_w(str), wine_dbgstr_w(str1));
SysFreeString(str);
SysFreeString(str1);
/* try to set site another time */
hr = IObjectWithSite_SetSite(obj_site, &testsite);
EXPECT_HR(hr, S_OK);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IObjectWithSite_Release(obj_site);
/* HEAD request */
hr = IXMLHttpRequest_put_onreadystatechange(xhr, NULL);
ok(hr == S_OK, "Failed to reset state change handler, hr %#x.\n", hr);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
test_open(xhr, "HEAD", xmltestA, S_OK);
V_VT(&varbody) = VT_EMPTY;
hr = IXMLHttpRequest_send(xhr, varbody);
ok(hr == S_OK, "Failed to send HEAD request, hr %#x.\n", hr);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
str = NULL;
hr = IXMLHttpRequest_get_responseText(xhr, &str);
ok(hr == S_OK, "Failed to get response text, hr %#x.\n", hr);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(!*str, "Unexpected text %s.\n", wine_dbgstr_w(str));
SysFreeString(str);
hr = IXMLHttpRequest_getAllResponseHeaders(xhr, &str);
ok(hr == S_OK, "Failed to get response headers, hr %#x.\n", hr);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(str && *str, "Expected response headers.\n");
SysFreeString(str);
@ -1795,7 +1792,7 @@ static void test_XMLHTTP(void)
V_VT(&varbody) = VT_EMPTY;
hr = IXMLHttpRequest_send(xhr, varbody);
todo_wine
ok(hr == INET_E_RESOURCE_NOT_FOUND, "send to invalid host returned %#x.\n", hr);
ok(hr == INET_E_RESOURCE_NOT_FOUND, "Unexpected hr %#lx.\n", hr);
IXMLHttpRequest_Release(xhr);
free_bstrs();
@ -1822,10 +1819,10 @@ static void test_server_xhr(void)
IServerXMLHTTPRequest_Release(xhr);
return;
}
ok(hr == S_OK, "send failed: %08x\n", hr);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IServerXMLHTTPRequest_get_responseText(xhr, &response);
ok(hr == S_OK, "get_responseText failed: %08x\n", hr);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(!strcmp_wa(response, xmltestbodyA), "got %s\n", wine_dbgstr_w(response));
SysFreeString(response);
@ -1839,7 +1836,7 @@ static void test_server_xhr(void)
V_VT(&body) = VT_EMPTY;
hr = IServerXMLHTTPRequest_send(xhr, body);
todo_wine
ok(hr == WININET_E_NAME_NOT_RESOLVED, "send to invalid host returned %#x.\n", hr);
ok(hr == WININET_E_NAME_NOT_RESOLVED, "Unexpected hr %#lx.\n", hr);
IServerXMLHTTPRequest_Release(xhr);
free_bstrs();
@ -1876,11 +1873,11 @@ static void test_supporterrorinfo(void)
EXPECT_REF(xhr, 1);
hr = IXMLHttpRequest_QueryInterface(xhr, &IID_ISupportErrorInfo, (void **)&errorinfo);
ok(hr == S_OK, "Failed to get ISupportErrorInfo, hr %#x.\n", hr);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
EXPECT_REF(xhr, 2);
hr = IXMLHttpRequest_QueryInterface(xhr, &IID_ISupportErrorInfo, (void **)&errorinfo2);
ok(hr == S_OK, "Failed to get ISupportErrorInfo, hr %#x.\n", hr);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(errorinfo == errorinfo2, "Unexpected error info instance.\n");
EXPECT_REF(xhr, 3);
@ -1894,11 +1891,11 @@ static void test_supporterrorinfo(void)
EXPECT_REF(server_xhr, 1);
hr = IServerXMLHTTPRequest_QueryInterface(server_xhr, &IID_ISupportErrorInfo, (void **)&errorinfo);
ok(hr == S_OK, "Failed to get ISupportErrorInfo, hr %#x.\n", hr);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
EXPECT_REF(server_xhr, 2);
hr = IServerXMLHTTPRequest_QueryInterface(server_xhr, &IID_ISupportErrorInfo, (void **)&errorinfo2);
ok(hr == S_OK, "Failed to get ISupportErrorInfo, hr %#x.\n", hr);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(errorinfo == errorinfo2, "Unexpected error info instance.\n");
EXPECT_REF(server_xhr, 3);

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -108,44 +108,44 @@ static void create_test(void)
hr = CoCreateInstance(&CLSID_XMLParser30, NULL, CLSCTX_INPROC_SERVER, &IID_IXMLParser, (void**)&parser);
if (FAILED(hr))
{
win_skip("IXMLParser is not available (0x%08x)\n", hr);
win_skip("IXMLParser is not available, hr %#lx.\n", hr);
return;
}
flags = IXMLParser_GetFlags(parser);
ok(flags == 0, "Expected 0 got %d\n", flags);
ok(!flags, "Unexpected flags %#lx.\n", flags);
hr = IXMLParser_SetFlags(parser, XMLFLAG_SAX);
ok(hr == S_OK, "Expected S_OK got 0x%08x\n", hr);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
flags = IXMLParser_GetFlags(parser);
ok(flags == XMLFLAG_SAX, "Expected 0 got %d\n", flags);
ok(flags == XMLFLAG_SAX, "Unexpected flags %ld.\n", flags);
hr = IXMLParser_GetFactory(parser, NULL);
ok(hr == E_INVALIDARG, "Expected S_OK got 0x%08x\n", hr);
ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = IXMLParser_GetFactory(parser, &nodefactory);
ok(hr == S_OK, "Expected S_OK got 0x%08x\n", hr);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(nodefactory == NULL, "expected NULL\n");
hr = IXMLParser_SetFactory(parser, &thenodefactory);
ok(hr == S_OK, "Expected S_OK got 0x%08x\n", hr);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXMLParser_GetFactory(parser, &nodefactory);
ok(hr == S_OK, "Expected S_OK got 0x%08x\n", hr);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(nodefactory == &thenodefactory, "expected NULL\n");
hr = IXMLParser_SetInput(parser, NULL);
ok(hr == E_INVALIDARG, "Expected S_OK got 0x%08x\n", hr);
ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = IXMLParser_SetFactory(parser, NULL);
ok(hr == S_OK, "Expected S_OK got 0x%08x\n", hr);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXMLParser_SetFlags(parser, 0);
ok(hr == S_OK, "Expected S_OK got 0x%08x\n", hr);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXMLParser_GetParserState(parser);
ok(hr == XMLPARSER_IDLE, "got 0x%08x\n", hr);
ok(hr == XMLPARSER_IDLE, "Unexpected hr %#lx.\n", hr);
IXMLParser_Release(parser);
}

View file

@ -128,7 +128,7 @@ static HRESULT WINAPI HTMLEvents_Invoke(IDispatch *iface, DISPID dispIdMember, R
BSTR state;
hr = IHTMLDocument2_get_readyState(html_doc, &state);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
if (!memcmp(state, completeW, sizeof(completeW)))
loaded = TRUE;
SysFreeString(state);
@ -161,28 +161,28 @@ static void test_QueryInterface(void)
win_skip("Failed to create XMLView instance\n");
return;
}
ok(hres == S_OK, "CoCreateInstance returned %x, expected S_OK\n", hres);
ok(hres == S_OK, "Unexpected hr %#lx.\n", hres);
hres = IUnknown_QueryInterface(xmlview, &IID_IPersistMoniker, (void**)&unk);
ok(hres == S_OK, "QueryInterface(IID_IPersistMoniker) returned %x, expected S_OK\n", hres);
ok(hres == S_OK, "Unexpected hr %#lx.\n", hres);
IUnknown_Release(unk);
hres = IUnknown_QueryInterface(xmlview, &IID_IPersistHistory, (void**)&unk);
ok(hres == S_OK, "QueryInterface(IID_IPersistHistory) returned %x, expected S_OK\n", hres);
ok(hres == S_OK, "Unexpected hr %#lx.\n", hres);
IUnknown_Release(unk);
hres = IUnknown_QueryInterface(xmlview, &IID_IOleCommandTarget, (void**)&unk);
ok(hres == S_OK, "QueryInterface(IID_IOleCommandTarget) returned %x, expected S_OK\n", hres);
ok(hres == S_OK, "Unexpected hr %#lx.\n", hres);
IUnknown_Release(unk);
hres = IUnknown_QueryInterface(xmlview, &IID_IOleObject, (void**)&unk);
ok(hres == S_OK, "QueryInterface(IID_IOleObject) returned %x, expected S_OK\n", hres);
ok(hres == S_OK, "Unexpected hr %#lx.\n", hres);
IUnknown_Release(unk);
hres = IUnknown_QueryInterface(xmlview, &IID_IHTMLDocument, (void**)&htmldoc);
ok(hres == S_OK, "QueryInterface(IID_IHTMLDocument) returned %x, expected S_OK\n", hres);
ok(hres == S_OK, "Unexpected hr %#lx.\n", hres);
hres = IHTMLDocument_QueryInterface(htmldoc, &IID_IUnknown, (void**)&unk);
ok(hres == S_OK, "QueryInterface(IID_IUnknown) returned %x, expected S_OK\n", hres);
ok(hres == S_OK, "Unexpected hr %#lx.\n", hres);
ok(unk == xmlview, "Aggregation is not working as expected\n");
IUnknown_Release(unk);
IHTMLDocument_Release(htmldoc);
@ -218,26 +218,26 @@ static void test_Load(void)
win_skip("Failed to create XMLView instance\n");
return;
}
ok(hres == S_OK, "CoCreateInstance returned %x, expected S_OK\n", hres);
ok(hres == S_OK, "Unexpected hr %#lx.\n", hres);
hres = IPersistMoniker_QueryInterface(pers_mon, &IID_IHTMLDocument2, (void**)&html_doc);
ok(hres == S_OK, "QueryInterface(HTMLDocument2) returned %x, expected S_OK\n", hres);
ok(hres == S_OK, "Unexpected hr %#lx.\n", hres);
hres = IPersistMoniker_QueryInterface(pers_mon, &IID_IConnectionPointContainer, (void**)&cpc);
ok(hres == S_OK, "QueryInterface(IConnectionPointContainer) returned %x, expected S_OK\n", hres);
ok(hres == S_OK, "Unexpected hr %#lx.\n", hres);
hres = IConnectionPointContainer_FindConnectionPoint(cpc, &IID_IDispatch, &cp);
ok(hres == S_OK, "FindConnectionPoint returned %x, expected S_OK\n", hres);
ok(hres == S_OK, "Unexpected hr %#lx.\n", hres);
hres = IConnectionPoint_Advise(cp, (IUnknown*)&HTMLEvents, NULL);
ok(hres == S_OK, "Advise returned %x, expected S_OK\n", hres);
ok(hres == S_OK, "Unexpected hr %#lx.\n", hres);
IConnectionPoint_Release(cp);
IConnectionPointContainer_Release(cpc);
hres = CreateBindCtx(0, &bctx);
ok(hres == S_OK, "CreateBindCtx returned %x, expected S_OK\n", hres);
ok(hres == S_OK, "Unexpected hr %#lx.\n", hres);
hres = pCreateURLMoniker(NULL, buf, &mon);
ok(hres == S_OK, "CreateUrlMoniker returned %x, expected S_OK\n", hres);
ok(hres == S_OK, "Unexpected hr %#lx.\n", hres);
loaded = FALSE;
hres = IPersistMoniker_Load(pers_mon, TRUE, mon, bctx, 0);
ok(hres == S_OK, "Load returned %x, expected S_OK\n", hres);
ok(hres == S_OK, "Unexpected hr %#lx.\n", hres);
IBindCtx_Release(bctx);
IMoniker_Release(mon);
@ -247,9 +247,9 @@ static void test_Load(void)
}
hres = IHTMLDocument2_get_body(html_doc, &elem);
ok(hres == S_OK, "get_body returned %x, expected S_OK\n", hres);
ok(hres == S_OK, "Unexpected hr %#lx.\n", hres);
hres = IHTMLElement_get_outerHTML(elem, &source);
ok(hres == S_OK, "get_outerHTML returned %x, expected S_OK\n", hres);
ok(hres == S_OK, "Unexpected hr %#lx.\n", hres);
ok(!html_src_compare(source, xmlview_html), "Incorrect HTML source: %s\n", wine_dbgstr_w(source));
IHTMLElement_Release(elem);
SysFreeString(source);