From: Daniel Lehman dlehman25@gmail.com
--- dlls/msxml6/tests/domdoc.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/dlls/msxml6/tests/domdoc.c b/dlls/msxml6/tests/domdoc.c index 3aad799523d..0c156023b6b 100644 --- a/dlls/msxml6/tests/domdoc.c +++ b/dlls/msxml6/tests/domdoc.c @@ -67,6 +67,7 @@ static void test_namespaces_as_attributes(void) const WCHAR *uris[3]; const WCHAR *texts[3]; const WCHAR *xmls[3]; + BOOL todo; }; static const struct test tests[] = { @@ -99,6 +100,17 @@ static void test_namespaces_as_attributes(void) { L"nshref" }, /* text */ { L"xmlns:ns="nshref"" }, /* xml */ }, + /* default namespace */ + { + L"<a xmlns="nshref" />", 1, + { L"xmlns" }, /* nodeName */ + { NULL }, /* prefix */ + { L"xmlns" }, /* baseName */ + { L"http://www.w3.org/2000/xmlns/" }, /* namespaceURI */ + { L"nshref" }, /* text */ + { L"xmlns="nshref"" }, /* xml */ + TRUE, /* todo */ + }, /* no properties or namespaces */ { L"<a />", 0, @@ -125,7 +137,7 @@ static void test_namespaces_as_attributes(void) ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
node = NULL; - hr = IXMLDOMDocument2_selectSingleNode(doc, _bstr_(L"a"), &node); + hr = IXMLDOMDocument2_get_firstChild(doc, &node); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXMLDOMNode_get_attributes(node, &map); @@ -145,7 +157,9 @@ static void test_namespaces_as_attributes(void) { item = NULL; hr = IXMLDOMNamedNodeMap_get_item(map, i, &item); + todo_wine_if(test->todo) ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + if (hr != S_OK) continue;
str = NULL; hr = IXMLDOMNode_get_nodeName(item, &str);
From: Daniel Lehman dlehman25@gmail.com
--- dlls/msxml4/tests/domdoc.c | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-)
diff --git a/dlls/msxml4/tests/domdoc.c b/dlls/msxml4/tests/domdoc.c index 1784804c0c6..530a481679f 100644 --- a/dlls/msxml4/tests/domdoc.c +++ b/dlls/msxml4/tests/domdoc.c @@ -67,6 +67,7 @@ static void test_namespaces_as_attributes(void) const WCHAR *uris[3]; const WCHAR *texts[3]; const WCHAR *xmls[3]; + BOOL todo; }; static const struct test tests[] = { @@ -99,6 +100,17 @@ static void test_namespaces_as_attributes(void) { L"nshref" }, /* text */ { L"xmlns:ns="nshref"" }, /* xml */ }, + /* default namespace */ + { + L"<a xmlns="nshref" />", 1, + { L"xmlns" }, /* nodeName */ + { L"xmlns" }, /* prefix */ + { L"" }, /* baseName */ + { L"" }, /* namespaceURI */ + { L"nshref" }, /* text */ + { L"xmlns="nshref"" }, /* xml */ + TRUE, /* todo */ + }, /* no properties or namespaces */ { L"<a />", 0, @@ -125,7 +137,7 @@ static void test_namespaces_as_attributes(void) ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
node = NULL; - hr = IXMLDOMDocument2_selectSingleNode(doc, _bstr_(L"a"), &node); + hr = IXMLDOMDocument2_get_firstChild(doc, &node); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXMLDOMNode_get_attributes(node, &map); @@ -145,7 +157,9 @@ static void test_namespaces_as_attributes(void) { item = NULL; hr = IXMLDOMNamedNodeMap_get_item(map, i, &item); + todo_wine_if(test->todo) ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + if (hr != S_OK) continue;
str = NULL; hr = IXMLDOMNode_get_nodeName(item, &str); @@ -157,8 +171,10 @@ static void test_namespaces_as_attributes(void) hr = IXMLDOMNode_get_prefix(item, &str); if (test->prefixes[i]) { - ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); - ok(!lstrcmpW(str, test->prefixes[i]), "got %s\n", wine_dbgstr_w(str)); + /* MSXML4 can report different results with different service packs */ + ok(hr == S_OK || broken(hr == S_FALSE), "Unexpected hr %#lx.\n", hr); + ok(!lstrcmpW(str, test->prefixes[i]) || broken(!str), + "got %s\n", wine_dbgstr_w(str)); SysFreeString(str); } else @@ -166,8 +182,10 @@ static void test_namespaces_as_attributes(void)
str = NULL; hr = IXMLDOMNode_get_baseName(item, &str); + /* MSXML4 can report different results with different service packs */ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); - ok(!lstrcmpW(str, test->basenames[i]), "got %s\n", wine_dbgstr_w(str)); + ok(!lstrcmpW(str, test->basenames[i]) || broken(!lstrcmpW(str, L"xmlns")), + "got %s\n", wine_dbgstr_w(str)); SysFreeString(str);
str = NULL;
From: Daniel Lehman dlehman25@gmail.com
--- dlls/msxml3/tests/domdoc.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
diff --git a/dlls/msxml3/tests/domdoc.c b/dlls/msxml3/tests/domdoc.c index ebc6476069a..d8a4bd47ef6 100644 --- a/dlls/msxml3/tests/domdoc.c +++ b/dlls/msxml3/tests/domdoc.c @@ -13676,6 +13676,7 @@ static void test_namespaces_as_attributes(void) const char *uris[3]; const char *texts[3]; const char *xmls[3]; + BOOL todo; }; static const struct test tests[] = { { @@ -13707,6 +13708,17 @@ static void test_namespaces_as_attributes(void) { "nshref" }, /* text */ { "xmlns:ns="nshref"" }, /* xml */ }, + /* default namespace */ + { + "<a xmlns="nshref" />", 1, + { "xmlns" }, /* nodeName */ + { "xmlns" }, /* prefix */ + { "" }, /* baseName */ + { "" }, /* namespaceURI */ + { "nshref" }, /* text */ + { "xmlns="nshref"" }, /* xml */ + TRUE, /* todo */ + }, /* no properties or namespaces */ { "<a />", 0, @@ -13760,7 +13772,9 @@ static void test_namespaces_as_attributes(void) { item = NULL; hr = IXMLDOMNamedNodeMap_get_item(map, i, &item); + todo_wine_if(test->todo) ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + if (hr != S_OK) continue;
str = NULL; hr = IXMLDOMNode_get_nodeName(item, &str);
This merge request was approved by Nikolay Sivov.