Signed-off-by: Ziqing Hui zhui@codeweavers.com --- dlls/xmllite/tests/reader.c | 9 +++++++++ 1 file changed, 9 insertions(+)
diff --git a/dlls/xmllite/tests/reader.c b/dlls/xmllite/tests/reader.c index c1778a9764e..7b68365ac48 100644 --- a/dlls/xmllite/tests/reader.c +++ b/dlls/xmllite/tests/reader.c @@ -2570,11 +2570,13 @@ static void test_attribute_by_name(void) ok(hr == S_FALSE, "Unexpected hr %#lx.\n", hr);
read_node(reader, XmlNodeType_Element); + TEST_DEPTH(reader, 0);
hr = IXmlReader_MoveToAttributeByName(reader, L"", NULL); ok(hr == S_FALSE, "Unexpected hr %#lx.\n", hr);
read_node(reader, XmlNodeType_Element); + TEST_DEPTH(reader, 1);
hr = IXmlReader_MoveToAttributeByName(reader, NULL, NULL); ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); @@ -2590,14 +2592,17 @@ static void test_attribute_by_name(void)
hr = IXmlReader_MoveToAttributeByName(reader, L"xmlns", xmlns_uriW); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + todo_wine TEST_DEPTH(reader, 2); reader_value(reader, L"myns");
hr = IXmlReader_MoveToAttributeByName(reader, L"a", NULL); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + todo_wine TEST_DEPTH(reader, 2); reader_value(reader, L"value a");
hr = IXmlReader_MoveToAttributeByName(reader, L"b", NULL); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + todo_wine TEST_DEPTH(reader, 2); reader_value(reader, L"value b");
hr = IXmlReader_MoveToAttributeByName(reader, L"a", L"myns"); @@ -2608,18 +2613,22 @@ static void test_attribute_by_name(void)
hr = IXmlReader_MoveToAttributeByName(reader, L"ns", xmlns_uriW); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + todo_wine TEST_DEPTH(reader, 2); reader_value(reader, L"ns uri");
hr = IXmlReader_MoveToAttributeByName(reader, L"b", L""); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + todo_wine TEST_DEPTH(reader, 2); reader_value(reader, L"value b");
hr = IXmlReader_MoveToAttributeByName(reader, L"c", NULL); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + todo_wine TEST_DEPTH(reader, 2); reader_value(reader, L"value c2");
hr = IXmlReader_MoveToAttributeByName(reader, L"c", L"ns uri"); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + todo_wine TEST_DEPTH(reader, 2); reader_value(reader, L"value c");
IXmlReader_Release(reader);
Signed-off-by: Ziqing Hui zhui@codeweavers.com --- dlls/xmllite/reader.c | 2 ++ dlls/xmllite/tests/reader.c | 14 +++++++------- 2 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/dlls/xmllite/reader.c b/dlls/xmllite/reader.c index 03bb6c409b7..17f2a264f2a 100644 --- a/dlls/xmllite/reader.c +++ b/dlls/xmllite/reader.c @@ -3071,6 +3071,8 @@ static HRESULT WINAPI xmlreader_MoveToAttributeByName(IXmlReader* iface, if (name_len == target_name_len && uri_len == target_uri_len && !wcscmp(name, local_name) && !wcscmp(uri, namespace_uri)) { + if (!This->attr) + reader_inc_depth(This); reader_set_current_attribute(This, attr); return S_OK; } diff --git a/dlls/xmllite/tests/reader.c b/dlls/xmllite/tests/reader.c index 7b68365ac48..2ea781ce992 100644 --- a/dlls/xmllite/tests/reader.c +++ b/dlls/xmllite/tests/reader.c @@ -2592,17 +2592,17 @@ static void test_attribute_by_name(void)
hr = IXmlReader_MoveToAttributeByName(reader, L"xmlns", xmlns_uriW); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); - todo_wine TEST_DEPTH(reader, 2); + TEST_DEPTH(reader, 2); reader_value(reader, L"myns");
hr = IXmlReader_MoveToAttributeByName(reader, L"a", NULL); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); - todo_wine TEST_DEPTH(reader, 2); + TEST_DEPTH(reader, 2); reader_value(reader, L"value a");
hr = IXmlReader_MoveToAttributeByName(reader, L"b", NULL); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); - todo_wine TEST_DEPTH(reader, 2); + TEST_DEPTH(reader, 2); reader_value(reader, L"value b");
hr = IXmlReader_MoveToAttributeByName(reader, L"a", L"myns"); @@ -2613,22 +2613,22 @@ static void test_attribute_by_name(void)
hr = IXmlReader_MoveToAttributeByName(reader, L"ns", xmlns_uriW); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); - todo_wine TEST_DEPTH(reader, 2); + TEST_DEPTH(reader, 2); reader_value(reader, L"ns uri");
hr = IXmlReader_MoveToAttributeByName(reader, L"b", L""); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); - todo_wine TEST_DEPTH(reader, 2); + TEST_DEPTH(reader, 2); reader_value(reader, L"value b");
hr = IXmlReader_MoveToAttributeByName(reader, L"c", NULL); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); - todo_wine TEST_DEPTH(reader, 2); + TEST_DEPTH(reader, 2); reader_value(reader, L"value c2");
hr = IXmlReader_MoveToAttributeByName(reader, L"c", L"ns uri"); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); - todo_wine TEST_DEPTH(reader, 2); + TEST_DEPTH(reader, 2); reader_value(reader, L"value c");
IXmlReader_Release(reader);
On 6/2/22 09:15, Ziqing Hui wrote:
@@ -3071,6 +3071,8 @@ static HRESULT WINAPI xmlreader_MoveToAttributeByName(IXmlReader* iface, if (name_len == target_name_len && uri_len == target_uri_len && !wcscmp(name, local_name) && !wcscmp(uri, namespace_uri)) {
if (!This->attr)
reader_inc_depth(This); reader_set_current_attribute(This, attr); return S_OK; }
I think this call could be moved in reader_set_current_attribute(), and removed from reader_move_to_first_attribute().
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=115979
Your paranoid android.
=== build (build log) ===
WineRunBuild.pl:error: The build timed out