Commit 538bc11b authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

xmllite/tests: Add a test for IsEmptyElement() on attributes.

parent fdbbf6de
......@@ -1833,16 +1833,15 @@ static void test_isemptyelement(void)
{
struct test_entry_empty *test = empty_element_tests;
IXmlReader *reader;
XmlNodeType type;
HRESULT hr;
BOOL ret;
hr = CreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
while (test->xml)
{
XmlNodeType type;
BOOL ret;
set_input_string(reader, test->xml);
type = XmlNodeType_None;
......@@ -1856,6 +1855,23 @@ static void test_isemptyelement(void)
test++;
}
/* Move to an attribute of an empty element. */
set_input_string(reader, "<a attr1=\'b\' />");
hr = IXmlReader_Read(reader, &type);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(type == XmlNodeType_Element, "Unexpected node type %d.\n", type);
ret = IXmlReader_IsEmptyElement(reader);
ok(ret, "Unexpected empty flag %d.\n", ret);
hr = IXmlReader_MoveToFirstAttribute(reader);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlReader_GetNodeType(reader, &type);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(type == XmlNodeType_Attribute, "Unexpected node type %d.\n", type);
ret = IXmlReader_IsEmptyElement(reader);
ok(!ret, "Unexpected empty flag %d.\n", ret);
IXmlReader_Release(reader);
}
......
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