msxml3: Implement ISAXAttributes::getLength() for MXAttributes.
This commit is contained in:
parent
70aa4f1a43
commit
3eaa0df728
|
@ -1727,8 +1727,14 @@ static ULONG WINAPI SAXAttributes_Release(ISAXAttributes *iface)
|
||||||
static HRESULT WINAPI SAXAttributes_getLength(ISAXAttributes *iface, int *length)
|
static HRESULT WINAPI SAXAttributes_getLength(ISAXAttributes *iface, int *length)
|
||||||
{
|
{
|
||||||
mxattributes *This = impl_from_ISAXAttributes( iface );
|
mxattributes *This = impl_from_ISAXAttributes( iface );
|
||||||
FIXME("(%p)->(%p): stub\n", This, length);
|
TRACE("(%p)->(%p)\n", This, length);
|
||||||
return E_NOTIMPL;
|
|
||||||
|
if (!length && (This->class_version == MSXML_DEFAULT || This->class_version == MSXML3))
|
||||||
|
return E_POINTER;
|
||||||
|
|
||||||
|
*length = This->length;
|
||||||
|
|
||||||
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI SAXAttributes_getURI(ISAXAttributes *iface, int nIndex, const WCHAR **pUrl,
|
static HRESULT WINAPI SAXAttributes_getURI(ISAXAttributes *iface, int nIndex, const WCHAR **pUrl,
|
||||||
|
|
|
@ -3315,34 +3315,30 @@ static void test_mxattr_addAttribute(void)
|
||||||
hr = IMXAttributes_QueryInterface(mxattr, &IID_ISAXAttributes, (void**)&saxattr);
|
hr = IMXAttributes_QueryInterface(mxattr, &IID_ISAXAttributes, (void**)&saxattr);
|
||||||
EXPECT_HR(hr, S_OK);
|
EXPECT_HR(hr, S_OK);
|
||||||
|
|
||||||
/* SAXAttributes30 and SAXAttributes60 both crash on this test */
|
/* SAXAttributes40 and SAXAttributes60 both crash on this test */
|
||||||
if (IsEqualGUID(table->clsid, &CLSID_SAXAttributes) ||
|
if (IsEqualGUID(table->clsid, &CLSID_SAXAttributes) ||
|
||||||
IsEqualGUID(table->clsid, &CLSID_SAXAttributes30))
|
IsEqualGUID(table->clsid, &CLSID_SAXAttributes30))
|
||||||
{
|
{
|
||||||
hr = ISAXAttributes_getLength(saxattr, NULL);
|
hr = ISAXAttributes_getLength(saxattr, NULL);
|
||||||
todo_wine
|
|
||||||
EXPECT_HR(hr, E_POINTER);
|
EXPECT_HR(hr, E_POINTER);
|
||||||
}
|
}
|
||||||
|
|
||||||
len = -1;
|
len = -1;
|
||||||
hr = ISAXAttributes_getLength(saxattr, &len);
|
hr = ISAXAttributes_getLength(saxattr, &len);
|
||||||
todo_wine {
|
|
||||||
EXPECT_HR(hr, S_OK);
|
EXPECT_HR(hr, S_OK);
|
||||||
ok(len == 0, "got %d\n", len);
|
ok(len == 0, "got %d\n", len);
|
||||||
}
|
|
||||||
hr = IMXAttributes_addAttribute(mxattr, _bstr_(table->uri), _bstr_(table->local),
|
hr = IMXAttributes_addAttribute(mxattr, _bstr_(table->uri), _bstr_(table->local),
|
||||||
_bstr_(table->qname), _bstr_(table->type), _bstr_(table->value));
|
_bstr_(table->qname), _bstr_(table->type), _bstr_(table->value));
|
||||||
ok(hr == table->hr, "%d: got 0x%08x, expected 0x%08x\n", i, hr, table->hr);
|
ok(hr == table->hr, "%d: got 0x%08x, expected 0x%08x\n", i, hr, table->hr);
|
||||||
|
|
||||||
len = -1;
|
len = -1;
|
||||||
hr = ISAXAttributes_getLength(saxattr, &len);
|
hr = ISAXAttributes_getLength(saxattr, &len);
|
||||||
todo_wine {
|
|
||||||
EXPECT_HR(hr, S_OK);
|
EXPECT_HR(hr, S_OK);
|
||||||
if (table->hr == S_OK)
|
if (table->hr == S_OK)
|
||||||
ok(len == 1, "%d: got %d length, expected 0\n", i, len);
|
ok(len == 1, "%d: got %d length, expected 0\n", i, len);
|
||||||
else
|
else
|
||||||
ok(len == 0, "%d: got %d length, expected 1\n", i, len);
|
ok(len == 0, "%d: got %d length, expected 1\n", i, len);
|
||||||
}
|
|
||||||
|
|
||||||
ISAXAttributes_Release(saxattr);
|
ISAXAttributes_Release(saxattr);
|
||||||
IMXAttributes_Release(mxattr);
|
IMXAttributes_Release(mxattr);
|
||||||
|
@ -3383,10 +3379,8 @@ todo_wine
|
||||||
|
|
||||||
len = -1;
|
len = -1;
|
||||||
hr = ISAXAttributes_getLength(saxattr, &len);
|
hr = ISAXAttributes_getLength(saxattr, &len);
|
||||||
todo_wine {
|
|
||||||
EXPECT_HR(hr, S_OK);
|
EXPECT_HR(hr, S_OK);
|
||||||
ok(len == 1, "got %d\n", len);
|
ok(len == 1, "got %d\n", len);
|
||||||
}
|
|
||||||
|
|
||||||
len = -1;
|
len = -1;
|
||||||
hr = ISAXAttributes_getQName(saxattr, 0, NULL, &len);
|
hr = ISAXAttributes_getQName(saxattr, 0, NULL, &len);
|
||||||
|
@ -3415,10 +3409,9 @@ todo_wine
|
||||||
|
|
||||||
len = -1;
|
len = -1;
|
||||||
hr = ISAXAttributes_getLength(saxattr, &len);
|
hr = ISAXAttributes_getLength(saxattr, &len);
|
||||||
todo_wine {
|
|
||||||
EXPECT_HR(hr, S_OK);
|
EXPECT_HR(hr, S_OK);
|
||||||
|
todo_wine
|
||||||
ok(len == 0, "got %d\n", len);
|
ok(len == 0, "got %d\n", len);
|
||||||
}
|
|
||||||
|
|
||||||
len = -1;
|
len = -1;
|
||||||
ptr = (void*)0xdeadbeef;
|
ptr = (void*)0xdeadbeef;
|
||||||
|
|
Loading…
Reference in New Issue