mirror of
git://source.winehq.org/git/wine.git
synced 2024-11-05 18:01:34 +00:00
xmllite/tests: Added move_to_element helper.
Signed-off-by: Jacek Caban <jacek@codeweavers.com> Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
004d615f83
commit
def5587379
1 changed files with 14 additions and 14 deletions
|
@ -256,6 +256,14 @@ static void _next_attribute(unsigned line, IXmlReader *reader)
|
||||||
ok_(__FILE__,line)(hr == S_OK, "MoveToNextAttribute returned %08x\n", hr);
|
ok_(__FILE__,line)(hr == S_OK, "MoveToNextAttribute returned %08x\n", hr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define move_to_element(a) _move_to_element(__LINE__,a)
|
||||||
|
static void _move_to_element(unsigned line, IXmlReader *reader)
|
||||||
|
{
|
||||||
|
HRESULT hr;
|
||||||
|
hr = IXmlReader_MoveToElement(reader);
|
||||||
|
ok_(__FILE__,line)(hr == S_OK, "MoveToElement failed: %08x\n", hr);
|
||||||
|
}
|
||||||
|
|
||||||
static void test_read_state(IXmlReader *reader, XmlReadState expected,
|
static void test_read_state(IXmlReader *reader, XmlReadState expected,
|
||||||
XmlReadState exp_broken, int line)
|
XmlReadState exp_broken, int line)
|
||||||
{
|
{
|
||||||
|
@ -943,8 +951,7 @@ static void test_read_xmldeclaration(void)
|
||||||
|
|
||||||
TEST_DEPTH(reader, 1);
|
TEST_DEPTH(reader, 1);
|
||||||
|
|
||||||
hr = IXmlReader_MoveToElement(reader);
|
move_to_element(reader);
|
||||||
ok(hr == S_OK, "got %08x\n", hr);
|
|
||||||
TEST_READER_POSITION2(reader, 1, 3, ~0u, 55);
|
TEST_READER_POSITION2(reader, 1, 3, ~0u, 55);
|
||||||
|
|
||||||
type = XmlNodeType_None;
|
type = XmlNodeType_None;
|
||||||
|
@ -1302,8 +1309,7 @@ static void test_read_public_dtd(void)
|
||||||
reader_name(reader, "SYSTEM");
|
reader_name(reader, "SYSTEM");
|
||||||
reader_value(reader, "externalid uri");
|
reader_value(reader, "externalid uri");
|
||||||
|
|
||||||
hr = IXmlReader_MoveToElement(reader);
|
move_to_element(reader);
|
||||||
ok(hr == S_OK, "got 0x%08x\n", hr);
|
|
||||||
|
|
||||||
len = 0;
|
len = 0;
|
||||||
str = NULL;
|
str = NULL;
|
||||||
|
@ -1367,8 +1373,7 @@ static void test_read_system_dtd(void)
|
||||||
reader_name(reader, "SYSTEM");
|
reader_name(reader, "SYSTEM");
|
||||||
reader_value(reader, "externalid uri");
|
reader_value(reader, "externalid uri");
|
||||||
|
|
||||||
hr = IXmlReader_MoveToElement(reader);
|
move_to_element(reader);
|
||||||
ok(hr == S_OK, "got 0x%08x\n", hr);
|
|
||||||
|
|
||||||
len = 0;
|
len = 0;
|
||||||
str = NULL;
|
str = NULL;
|
||||||
|
@ -1539,9 +1544,7 @@ static void test_read_element(void)
|
||||||
ok(hr == S_OK, "got %08x\n", hr);
|
ok(hr == S_OK, "got %08x\n", hr);
|
||||||
ok(depth == depths[i] + 1, "%u: got depth %u, expected %u\n", i, depth, depths[i] + 1);
|
ok(depth == depths[i] + 1, "%u: got depth %u, expected %u\n", i, depth, depths[i] + 1);
|
||||||
|
|
||||||
hr = IXmlReader_MoveToElement(reader);
|
move_to_element(reader);
|
||||||
ok(hr == S_OK, "got %08x\n", hr);
|
|
||||||
|
|
||||||
reader_value(reader, "");
|
reader_value(reader, "");
|
||||||
|
|
||||||
depth = 123;
|
depth = 123;
|
||||||
|
@ -2045,9 +2048,7 @@ static void test_prefix(void)
|
||||||
reader_prefix(reader, prefix_tests[i].prefix3);
|
reader_prefix(reader, prefix_tests[i].prefix3);
|
||||||
|
|
||||||
/* back to the element, check prefix */
|
/* back to the element, check prefix */
|
||||||
hr = IXmlReader_MoveToElement(reader);
|
move_to_element(reader);
|
||||||
ok(hr == S_OK, "MoveToElement() failed, %#x.\n", hr);
|
|
||||||
|
|
||||||
reader_prefix(reader, prefix_tests[i].prefix1);
|
reader_prefix(reader, prefix_tests[i].prefix1);
|
||||||
|
|
||||||
IStream_Release(stream);
|
IStream_Release(stream);
|
||||||
|
@ -2473,8 +2474,7 @@ static void test_reader_position(void)
|
||||||
next_attribute(reader);
|
next_attribute(reader);
|
||||||
TEST_READER_POSITION2(reader, 1, 24, ~0u, 34);
|
TEST_READER_POSITION2(reader, 1, 24, ~0u, 34);
|
||||||
|
|
||||||
hr = IXmlReader_MoveToElement(reader);
|
move_to_element(reader);
|
||||||
ok(hr == S_OK, "got %08x\n", hr);
|
|
||||||
TEST_READER_POSITION2(reader, 1, 2, ~0u, 34);
|
TEST_READER_POSITION2(reader, 1, 2, ~0u, 34);
|
||||||
|
|
||||||
hr = IXmlReader_Read(reader, &type);
|
hr = IXmlReader_Read(reader, &type);
|
||||||
|
|
Loading…
Reference in a new issue