msxml3: Implement ISAXAttributes_getQName() for MXAttributes.

This commit is contained in:
Nikolay Sivov 2012-03-13 11:12:16 +03:00 committed by Alexandre Julliard
parent 3eaa0df728
commit 6ac1cc682b
2 changed files with 13 additions and 12 deletions

View File

@ -1756,8 +1756,16 @@ static HRESULT WINAPI SAXAttributes_getLocalName(ISAXAttributes *iface, int nInd
static HRESULT WINAPI SAXAttributes_getQName(ISAXAttributes *iface, int index, const WCHAR **qname, int *length)
{
mxattributes *This = impl_from_ISAXAttributes( iface );
FIXME("(%p)->(%d %p %p): stub\n", This, index, qname, length);
return E_NOTIMPL;
TRACE("(%p)->(%d %p %p)\n", This, index, qname, length);
if (index >= This->length) return E_INVALIDARG;
if (!qname || !length) return E_POINTER;
*qname = This->attr[index].qname;
*length = SysStringLen(This->attr[index].qname);
return S_OK;
}
static HRESULT WINAPI SAXAttributes_getName(ISAXAttributes *iface, int nIndex, const WCHAR **pUri, int *pUriLength,

View File

@ -3366,11 +3366,9 @@ static void test_mxattr_clear(void)
EXPECT_HR(hr, S_OK);
hr = ISAXAttributes_getQName(saxattr, 0, NULL, NULL);
todo_wine
EXPECT_HR(hr, E_INVALIDARG);
hr = ISAXAttributes_getQName(saxattr, 0, &ptr, &len);
todo_wine
EXPECT_HR(hr, E_INVALIDARG);
hr = IMXAttributes_addAttribute(mxattr, _bstr_("uri"), _bstr_("local"),
@ -3384,24 +3382,19 @@ todo_wine
len = -1;
hr = ISAXAttributes_getQName(saxattr, 0, NULL, &len);
todo_wine
EXPECT_HR(hr, E_POINTER);
ok(len == -1, "got %d\n", len);
ptr = (void*)0xdeadbeef;
hr = ISAXAttributes_getQName(saxattr, 0, &ptr, NULL);
todo_wine
EXPECT_HR(hr, E_POINTER);
ok(ptr == (void*)0xdeadbeef, "got %p\n", ptr);
len = 0;
hr = ISAXAttributes_getQName(saxattr, 0, &ptr, &len);
todo_wine {
EXPECT_HR(hr, S_OK);
ok(len == 5, "got %d\n", len);
if (hr == S_OK)
ok(!lstrcmpW(ptr, _bstr_("qname")), "got %s\n", wine_dbgstr_w(ptr));
}
hr = IMXAttributes_clear(mxattr);
todo_wine
@ -3416,11 +3409,11 @@ todo_wine
len = -1;
ptr = (void*)0xdeadbeef;
hr = ISAXAttributes_getQName(saxattr, 0, &ptr, &len);
todo_wine
todo_wine {
EXPECT_HR(hr, E_INVALIDARG);
ok(len == -1, "got %d\n", len);
ok(ptr == (void*)0xdeadbeef, "got %p\n", ptr);
}
IMXAttributes_Release(mxattr);
ISAXAttributes_Release(saxattr);
free_bstrs();