From: Daniel Lehman dlehman25@gmail.com
Based on patch from Damjan Jovanovic damjan.jov@gmail.com --- dlls/msxml3/tests/domdoc.c | 40 +++++++++++++++++++++++++++++++++----- 1 file changed, 35 insertions(+), 5 deletions(-)
diff --git a/dlls/msxml3/tests/domdoc.c b/dlls/msxml3/tests/domdoc.c index 8368afa09a1..00d31399ca3 100644 --- a/dlls/msxml3/tests/domdoc.c +++ b/dlls/msxml3/tests/domdoc.c @@ -13683,6 +13683,7 @@ static void test_namespaces_as_attributes(void) const char *uris[3]; const char *texts[3]; MSXML_VERSION versions; + BOOL todo; }; static const struct test tests[] = { { @@ -13711,6 +13712,27 @@ static void test_namespaces_as_attributes(void) { "" }, /* namespaceURI */ { "nshref" }, /* text */ }, + /* default namespace */ + { + "<a xmlns="nshref" />", 1, + { "xmlns" }, /* nodeName */ + { "xmlns" }, /* prefix */ + { "" }, /* baseName */ + { "" }, /* namespaceURI */ + { "nshref" }, /* text */ + ~MSXML6, /* versions */ + TRUE, /* todo */ + }, + { + "<a xmlns="nshref" />", 1, + { "xmlns" }, /* nodeName */ + { NULL }, /* prefix */ + { "xmlns" }, /* baseName */ + { "http://www.w3.org/2000/xmlns/" }, /* namespaceURI */ + { "nshref" }, /* text */ + MSXML6, /* versions */ + TRUE, /* todo */ + }, /* no properties or namespaces */ { "<a />", 0, @@ -13770,7 +13792,9 @@ static void test_namespaces_as_attributes(void) { item = NULL; hr = IXMLDOMNamedNodeMap_get_item(map, i, &item); + todo_wine_if(test->todo) ok(SUCCEEDED(hr), "Failed to get item, hr %#lx.\n", hr); + if (FAILED(hr)) continue;
str = NULL; hr = IXMLDOMNode_get_nodeName(item, &str); @@ -13782,24 +13806,30 @@ static void test_namespaces_as_attributes(void) hr = IXMLDOMNode_get_prefix(item, &str); if (test->prefixes[i]) { - ok(hr == S_OK, "Failed to get node name, hr %#lx.\n", hr); - ok(!lstrcmpW(str, _bstr_(test->prefixes[i])), "got %s\n", wine_dbgstr_w(str)); + /* MSXML4 can report different results with different service packs */ + ok(hr == S_OK || broken(entry->ver == MSXML4 && hr == S_FALSE), + "Failed to get prefix, hr %#lx.\n", hr); + ok(!lstrcmpW(str, _bstr_(test->prefixes[i])) || + broken(!str && entry->ver == MSXML4), "got %s\n", wine_dbgstr_w(str)); SysFreeString(str); } else - ok(hr == S_FALSE, "Failed to get node name, hr %#lx.\n", hr); + ok(hr == S_FALSE, "Failed to get prefix, hr %#lx.\n", hr);
str = NULL; hr = IXMLDOMNode_get_baseName(item, &str); ok(SUCCEEDED(hr), "Failed to get base name, hr %#lx.\n", hr); - ok(!lstrcmpW(str, _bstr_(test->basenames[i])), "got %s\n", wine_dbgstr_w(str)); + /* MSXML4 can report different results with different service packs */ + ok(!lstrcmpW(str, _bstr_(test->basenames[i])) || + broken(entry->ver == MSXML4 && !lstrcmpW(str, L"xmlns")), + "got %s\n", wine_dbgstr_w(str)); SysFreeString(str);
str = NULL; hr = IXMLDOMNode_get_namespaceURI(item, &str); if (test->uris[i]) { - ok(hr == S_OK, "Failed to get node name, hr %#lx.\n", hr); + ok(hr == S_OK, "Failed to get node namespace URI, hr %#lx.\n", hr); if (test->prefixes[i] && !strcmp(test->prefixes[i], "xmlns")) ok(!lstrcmpW(str, _bstr_(entry->xmlns_uri)), "got %s\n", wine_dbgstr_w(str)); else