As asked by Nikolay.
Just committed patches make these tests pass.
Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru>
---
dlls/msxml3/tests/domdoc.c | 43 +++++++++++++++++++++++++++++++++++++-
1 file changed, 42 insertions(+), 1 deletion(-)
diff --git a/dlls/msxml3/tests/domdoc.c b/dlls/msxml3/tests/domdoc.c
index 12482962c4b..e1c37ebaaaf 100644
--- a/dlls/msxml3/tests/domdoc.c
+++ b/dlls/msxml3/tests/domdoc.c
@@ -8529,6 +8529,9 @@ static void test_createProcessingInstruction(void)
static const char xml2_wine[] = "<?xml version=\"1.0\" encoding=\"windows-1252\"?>\n<test/>\n";
static const char xml3[] = "<?xml version=\"1.0\" standalone=\"yes\"?>\r\n<test/>\r\n";
static const char xml3_wine[] = "<?xml version=\"1.0\" standalone=\"yes\"?>\n<test/>\n";
+ static const WCHAR xml4[] = L"<?xml version=\"1.0\" encoding=\"UTF-16\"?>\r\n<test/>\r\n";
+ static const WCHAR xml5[] = L"\xfeff<?xml version=\"1.0\" encoding=\"UTF-16\"?>\r\n<test/>\r\n";
+ static const WCHAR xml5_wine[] = L"\xfeff<?xml version=\"1.0\" encoding=\"UTF-16\"?>\n<test/>\n";
IXMLDOMProcessingInstruction *pi;
IXMLDOMDocument *doc;
IXMLDOMNode *node, *item;
@@ -8542,7 +8545,7 @@ static void test_createProcessingInstruction(void)
LARGE_INTEGER off;
VARIANT_BOOL b;
HGLOBAL global;
- char *p;
+ void *p;
doc = create_document(&IID_IXMLDOMDocument);
@@ -8668,6 +8671,44 @@ todo_wine
IStream_Release(stream);
IXMLDOMDocument_Release(doc);
+
+ doc = create_document(&IID_IXMLDOMDocument);
+
+ hr = IXMLDOMDocument_createProcessingInstruction(doc, _bstr_("xml"), _bstr_("version=\"1.0\" encoding=\"UTF-16\""), &pi);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+ hr = IXMLDOMProcessingInstruction_QueryInterface(pi, &IID_IXMLDOMNode, (void **)&node);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+ hr = IXMLDOMDocument_appendChild(doc, node, NULL);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+
+ hr = IXMLDOMDocument_createElement(doc, _bstr_("test"), &element);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+ hr = IXMLDOMDocument_appendChild(doc, (IXMLDOMNode *)element, NULL);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+
+ hr = IXMLDOMDocument_get_xml(doc, &xml);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(!wcscmp(xml, xml4), "got %s\n", wine_dbgstr_w(xml));
+ SysFreeString(xml);
+
+ hr = CreateStreamOnHGlobal(NULL, TRUE, &stream);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+ V_VT(&var) = VT_UNKNOWN;
+ V_UNKNOWN(&var) = (IUnknown*)stream;
+ hr = IXMLDOMDocument_save(doc, var);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+
+ hr = GetHGlobalFromStream(stream, &global);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+ p = GlobalLock(global);
+ ok(!memcmp(p, xml5, sizeof(xml5) - sizeof(WCHAR)) || !memcmp(p, xml5_wine, sizeof(xml5_wine) - sizeof(WCHAR)), "got %s\n", wine_dbgstr_w(p));
+ GlobalUnlock(global);
+
+ IStream_Release(stream);
+ IXMLDOMElement_Release(element);
+ IXMLDOMNode_Release(node);
+ IXMLDOMProcessingInstruction_Release(pi);
+ IXMLDOMDocument_Release(doc);
}
static void test_put_nodeTypedValue(void)
--
2.31.1