Commit c2976f2d authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

msxml3: Fixed ISupportErrorInfo for IXMLDOMNamedNodeMap.

parent 9687ceaf
......@@ -308,7 +308,7 @@ static HRESULT WINAPI support_error_QueryInterface(
REFIID riid, void** ppvObject )
{
xmlnodemap *This = impl_from_ISupportErrorInfo( iface );
TRACE("%p %s %p\n", iface, debugstr_guid(riid), ppvObject);
TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppvObject);
return IXMLDOMNamedNodeMap_QueryInterface(&This->IXMLDOMNamedNodeMap_iface, riid, ppvObject);
}
......@@ -330,8 +330,9 @@ static HRESULT WINAPI support_error_InterfaceSupportsErrorInfo(
ISupportErrorInfo *iface,
REFIID riid )
{
FIXME("(%p)->(%s)\n", iface, debugstr_guid(riid));
return S_FALSE;
xmlnodemap *This = impl_from_ISupportErrorInfo( iface );
TRACE("(%p)->(%s)\n", This, debugstr_guid(riid));
return IsEqualGUID(riid, &IID_IXMLDOMNamedNodeMap) ? S_OK : S_FALSE;
}
static const struct ISupportErrorInfoVtbl support_error_vtbl =
......
......@@ -2815,14 +2815,6 @@ static void test_domnode( void )
if (map)
{
ISupportErrorInfo *support_error;
r = IXMLDOMNamedNodeMap_QueryInterface( map, &IID_ISupportErrorInfo, (void**)&support_error );
ok( r == S_OK, "ret %08x\n", r );
r = ISupportErrorInfo_InterfaceSupportsErrorInfo( support_error, &IID_IXMLDOMNamedNodeMap );
todo_wine EXPECT_HR(r, S_OK);
ISupportErrorInfo_Release( support_error );
str = SysAllocString( szdl );
r = IXMLDOMNamedNodeMap_getNamedItem( map, str, &node );
ok( r == S_OK, "getNamedItem returned wrong code\n");
......@@ -10733,10 +10725,14 @@ static const supporterror_t supporterror_test[] = {
static void test_supporterrorinfo(void)
{
static REFIID iids[4] = { &IID_IXMLDOMDocument, &IID_IXMLDOMDocument2, &IID_IXMLDOMDocument3 };
static REFIID iids[5] = { &IID_IXMLDOMNode, &IID_IXMLDOMDocument,
&IID_IXMLDOMDocument2, &IID_IXMLDOMDocument3 };
const supporterror_t *ptr = supporterror_test;
ISupportErrorInfo *errorinfo, *info2;
IXMLDOMNamedNodeMap *map, *map2;
IXMLDOMDocument *doc;
IXMLDOMElement *elem;
VARIANT_BOOL b;
IUnknown *unk;
REFIID *iid;
void *dummy;
......@@ -10794,8 +10790,13 @@ static void test_supporterrorinfo(void)
hr = IXMLDOMDocument_createNode(doc, type, _bstr_(ptr->name), NULL, &node);
ok(hr == S_OK, "%d: got 0x%08x\n", ptr->type, hr);
EXPECT_REF(node, 1);
hr = IXMLDOMNode_QueryInterface(node, &IID_ISupportErrorInfo, (void**)&errorinfo);
ok(hr == S_OK, "%d: got 0x%08x\n", ptr->type, hr);
EXPECT_REF(node, 1);
hr = ISupportErrorInfo_QueryInterface(errorinfo, &IID_IXMLDOMNode, &dummy);
ok(hr == E_NOINTERFACE, "%d: got 0x%08x\n", ptr->type, hr);
iid = ptr->iids;
......@@ -10817,6 +10818,42 @@ static void test_supporterrorinfo(void)
ptr++;
}
/* IXMLDOMNamedNodeMap */
b = VARIANT_FALSE;
hr = IXMLDOMDocument_loadXML(doc, _bstr_(complete4A), &b);
EXPECT_HR(hr, S_OK);
ok(b == VARIANT_TRUE, "got %d\n", b);
hr = IXMLDOMDocument_get_documentElement(doc, &elem);
EXPECT_HR(hr, S_OK);
hr = IXMLDOMElement_get_attributes(elem, &map);
EXPECT_HR(hr, S_OK);
EXPECT_REF(map, 1);
hr = IXMLDOMNamedNodeMap_QueryInterface(map, &IID_ISupportErrorInfo, (void**)&errorinfo);
EXPECT_HR(hr, S_OK);
EXPECT_REF(map, 2);
hr = ISupportErrorInfo_InterfaceSupportsErrorInfo(errorinfo, &IID_IXMLDOMNamedNodeMap);
EXPECT_HR(hr, S_OK);
hr = ISupportErrorInfo_QueryInterface(errorinfo, &IID_IXMLDOMNamedNodeMap, (void**)&map2);
EXPECT_HR(hr, S_OK);
ok(map == map2, "got %p\n", map2);
IXMLDOMNamedNodeMap_Release(map2);
EXPECT_REF(errorinfo, 2);
hr = ISupportErrorInfo_QueryInterface(errorinfo, &IID_IUnknown, (void**)&unk);
EXPECT_HR(hr, S_OK);
EXPECT_REF(errorinfo, 3);
EXPECT_REF(map, 3);
IUnknown_Release(unk);
ISupportErrorInfo_Release(errorinfo);
IXMLDOMNamedNodeMap_Release(map);
IXMLDOMElement_Release(elem);
IXMLDOMDocument_Release(doc);
free_bstrs();
}
......
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