From: Daniel Lehman dlehman25@gmail.com
--- dlls/msxml4/tests/domdoc.c | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-)
diff --git a/dlls/msxml4/tests/domdoc.c b/dlls/msxml4/tests/domdoc.c index 66b4610fe0e..93887cc9857 100644 --- a/dlls/msxml4/tests/domdoc.c +++ b/dlls/msxml4/tests/domdoc.c @@ -171,6 +171,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[] = { { @@ -202,6 +203,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, @@ -227,8 +239,8 @@ static void test_namespaces_as_attributes(void) ok(hr == S_OK, "Failed to load xml, hr %#lx.\n", hr);
node = NULL; - hr = IXMLDOMDocument2_selectSingleNode(doc, _bstr_("a"), &node); - ok(SUCCEEDED(hr), "Failed to select a node, hr %#lx.\n", hr); + hr = IXMLDOMDocument2_get_firstChild(doc, &node); + ok(SUCCEEDED(hr), "Failed to get first child node, hr %#lx.\n", hr);
hr = IXMLDOMNode_get_attributes(node, &map); ok(SUCCEEDED(hr), "Failed to get attributes, hr %#lx.\n", hr); @@ -247,7 +259,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); @@ -259,8 +273,10 @@ static void test_namespaces_as_attributes(void) hr = IXMLDOMNode_get_prefix(item, &str); if (test->prefixes[i]) { - ok(hr == S_OK, "Failed to get prefix, 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(hr == S_FALSE), "Failed to get prefix, hr %#lx.\n", hr); + ok(!lstrcmpW(str, _bstr_(test->prefixes[i])) || broken(!str), + "got %s\n", wine_dbgstr_w(str)); SysFreeString(str); } else @@ -269,7 +285,9 @@ static void test_namespaces_as_attributes(void) 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(!lstrcmpW(str, L"xmlns")), + "got %s\n", wine_dbgstr_w(str)); SysFreeString(str);
str = NULL;