msxml3: Fixed ISupportErrorInfo for IXMLDOMNamedNodeMap.

This commit is contained in:
Nikolay Sivov 2011-11-22 23:02:54 +03:00 committed by Alexandre Julliard
parent 9687ceaf1d
commit c2976f2d5f
2 changed files with 50 additions and 12 deletions

View File

@ -308,7 +308,7 @@ static HRESULT WINAPI support_error_QueryInterface(
REFIID riid, void** ppvObject ) REFIID riid, void** ppvObject )
{ {
xmlnodemap *This = impl_from_ISupportErrorInfo( iface ); 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); return IXMLDOMNamedNodeMap_QueryInterface(&This->IXMLDOMNamedNodeMap_iface, riid, ppvObject);
} }
@ -330,8 +330,9 @@ static HRESULT WINAPI support_error_InterfaceSupportsErrorInfo(
ISupportErrorInfo *iface, ISupportErrorInfo *iface,
REFIID riid ) REFIID riid )
{ {
FIXME("(%p)->(%s)\n", iface, debugstr_guid(riid)); xmlnodemap *This = impl_from_ISupportErrorInfo( iface );
return S_FALSE; TRACE("(%p)->(%s)\n", This, debugstr_guid(riid));
return IsEqualGUID(riid, &IID_IXMLDOMNamedNodeMap) ? S_OK : S_FALSE;
} }
static const struct ISupportErrorInfoVtbl support_error_vtbl = static const struct ISupportErrorInfoVtbl support_error_vtbl =

View File

@ -2815,14 +2815,6 @@ static void test_domnode( void )
if (map) 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 ); str = SysAllocString( szdl );
r = IXMLDOMNamedNodeMap_getNamedItem( map, str, &node ); r = IXMLDOMNamedNodeMap_getNamedItem( map, str, &node );
ok( r == S_OK, "getNamedItem returned wrong code\n"); 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 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; const supporterror_t *ptr = supporterror_test;
ISupportErrorInfo *errorinfo, *info2; ISupportErrorInfo *errorinfo, *info2;
IXMLDOMNamedNodeMap *map, *map2;
IXMLDOMDocument *doc; IXMLDOMDocument *doc;
IXMLDOMElement *elem;
VARIANT_BOOL b;
IUnknown *unk; IUnknown *unk;
REFIID *iid; REFIID *iid;
void *dummy; void *dummy;
@ -10794,8 +10790,13 @@ static void test_supporterrorinfo(void)
hr = IXMLDOMDocument_createNode(doc, type, _bstr_(ptr->name), NULL, &node); hr = IXMLDOMDocument_createNode(doc, type, _bstr_(ptr->name), NULL, &node);
ok(hr == S_OK, "%d: got 0x%08x\n", ptr->type, hr); ok(hr == S_OK, "%d: got 0x%08x\n", ptr->type, hr);
EXPECT_REF(node, 1);
hr = IXMLDOMNode_QueryInterface(node, &IID_ISupportErrorInfo, (void**)&errorinfo); hr = IXMLDOMNode_QueryInterface(node, &IID_ISupportErrorInfo, (void**)&errorinfo);
ok(hr == S_OK, "%d: got 0x%08x\n", ptr->type, hr); 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; iid = ptr->iids;
@ -10817,6 +10818,42 @@ static void test_supporterrorinfo(void)
ptr++; 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); IXMLDOMDocument_Release(doc);
free_bstrs(); free_bstrs();
} }