Author: akhaldi
Date: Tue Jun 7 10:30:15 2016
New Revision: 71577
URL:
http://svn.reactos.org/svn/reactos?rev=71577&view=rev
Log:
[MSXML3_WINETEST] Sync with Wine Staging 1.9.11. CORE-11368
Modified:
trunk/rostests/winetests/msxml3/domdoc.c
trunk/rostests/winetests/msxml3/httpreq.c
trunk/rostests/winetests/msxml3/saxreader.c
trunk/rostests/winetests/msxml3/schema.c
trunk/rostests/winetests/msxml3/xmldoc.c
Modified: trunk/rostests/winetests/msxml3/domdoc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/msxml3/domdoc.c…
==============================================================================
--- trunk/rostests/winetests/msxml3/domdoc.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/msxml3/domdoc.c [iso-8859-1] Tue Jun 7 10:30:15 2016
@@ -6742,9 +6742,9 @@
BSTR sPart1 = _bstr_(szBasicTransformSSXMLPart1);
BSTR sPart2 = _bstr_(szBasicTransformSSXMLPart2);
BSTR sFileName = _bstr_(lpPathBuffer);
- int nLegnth = lstrlenW(sPart1) + lstrlenW(sPart2) + lstrlenW(sFileName) + 1;
-
- sXSL = SysAllocStringLen(NULL, nLegnth);
+ int nLength = lstrlenW(sPart1) + lstrlenW(sPart2) + lstrlenW(sFileName) + 1;
+
+ sXSL = SysAllocStringLen(NULL, nLength);
lstrcpyW(sXSL, sPart1);
lstrcatW(sXSL, sFileName);
lstrcatW(sXSL, sPart2);
@@ -9297,10 +9297,12 @@
{
const get_attributes_t *entry = get_attributes;
IXMLDOMNamedNodeMap *map;
- IXMLDOMDocument *doc;
+ IXMLDOMDocument *doc, *doc2;
IXMLDOMNode *node, *node2;
+ IXMLDOMElement *elem;
VARIANT_BOOL b;
HRESULT hr;
+ VARIANT v;
BSTR str;
LONG length;
@@ -9469,6 +9471,39 @@
ok(hr == S_OK, "got %08x\n", hr);
EXPECT_REF(node2, 1);
IXMLDOMNode_Release(node2);
+
+ IXMLDOMNamedNodeMap_Release(map);
+
+ /* append created element a different document, map still works */
+ hr = IXMLDOMDocument_createElement(doc, _bstr_("test"), &elem);
+ ok(hr == S_OK, "createElement failed: %08x\n", hr);
+
+ V_VT(&v) = VT_I4;
+ V_I4(&v) = 1;
+ hr = IXMLDOMElement_setAttribute(elem, _bstr_("testattr"), v);
+ ok(hr == S_OK, "setAttribute failed: %08x\n", hr);
+
+ hr = IXMLDOMElement_get_attributes(elem, &map);
+ ok(hr == S_OK, "get_attributes failed: %08x\n", hr);
+
+ length = 0;
+ hr = IXMLDOMNamedNodeMap_get_length(map, &length);
+ ok(hr == S_OK, "got %08x\n", hr);
+ ok(length == 1, "got %d\n", length);
+
+ doc2 = create_document(&IID_IXMLDOMDocument);
+
+ hr = IXMLDOMDocument_appendChild(doc2, (IXMLDOMNode*)elem, &node);
+ ok(hr == S_OK, "appendChild failed: %08x\n", hr);
+ ok(node == (IXMLDOMNode*)elem, "node != elem\n");
+ IXMLDOMNode_Release(node);
+ IXMLDOMElement_Release(elem);
+ IXMLDOMDocument_Release(doc2);
+
+ length = 0;
+ hr = IXMLDOMNamedNodeMap_get_length(map, &length);
+ ok(hr == S_OK, "got %08x\n", hr);
+ ok(length == 1, "got %d\n", length);
IXMLDOMNamedNodeMap_Release(map);
Modified: trunk/rostests/winetests/msxml3/httpreq.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/msxml3/httpreq.…
==============================================================================
--- trunk/rostests/winetests/msxml3/httpreq.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/msxml3/httpreq.c [iso-8859-1] Tue Jun 7 10:30:15 2016
@@ -49,9 +49,10 @@
#define EXPECT_REF(node,ref) _expect_ref((IUnknown*)node, ref, __LINE__)
static void _expect_ref(IUnknown* obj, ULONG ref, int line)
{
- ULONG rc = IUnknown_AddRef(obj);
- IUnknown_Release(obj);
- ok_(__FILE__,line)(rc-1 == ref, "expected refcount %d, got %d\n", ref,
rc-1);
+ ULONG rc;
+ IUnknown_AddRef(obj);
+ rc = IUnknown_Release(obj);
+ ok_(__FILE__, line)(rc == ref, "expected refcount %d, got %d\n", ref, rc);
}
DEFINE_GUID(SID_SContainerDispatch, 0xb722be00, 0x4e68, 0x101b, 0xa2, 0xbc, 0x00, 0xaa,
0x00, 0x40, 0x47, 0x70);
Modified: trunk/rostests/winetests/msxml3/saxreader.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/msxml3/saxreade…
==============================================================================
--- trunk/rostests/winetests/msxml3/saxreader.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/msxml3/saxreader.c [iso-8859-1] Tue Jun 7 10:30:15 2016
@@ -47,9 +47,10 @@
#define EXPECT_REF(obj,ref) _expect_ref((IUnknown*)obj, ref, __LINE__)
static void _expect_ref(IUnknown* obj, ULONG ref, int line)
{
- ULONG rc = IUnknown_AddRef(obj);
- IUnknown_Release(obj);
- ok_(__FILE__,line)(rc-1 == ref, "expected refcount %d, got %d\n", ref,
rc-1);
+ ULONG rc;
+ IUnknown_AddRef(obj);
+ rc = IUnknown_Release(obj);
+ ok_(__FILE__, line)(rc == ref, "expected refcount %d, got %d\n", ref, rc);
}
static LONG get_refcount(void *iface)
@@ -2931,7 +2932,6 @@
ok(hr == S_OK, "%s, expected S_OK, got %08x\n",
wine_dbgstr_guid(riids[i]), hr);
ok(writer2 == writer, "got %p, expected %p\n", writer2, writer);
EXPECT_REF(writer, 3);
- EXPECT_REF(writer2, 3);
IMXWriter_Release(writer2);
IUnknown_Release(handler);
}
@@ -3309,7 +3309,6 @@
pos2.QuadPart = 0;
hr = IStream_Seek(stream, pos, STREAM_SEEK_CUR, &pos2);
EXPECT_HR(hr, S_OK);
-todo_wine
ok(pos2.QuadPart != 0, "unexpected stream beginning\n");
hr = IMXWriter_get_output(writer, NULL);
@@ -4150,7 +4149,6 @@
V_UNKNOWN(&dest) = (IUnknown*)&mxstream;
hr = IMXWriter_put_output(writer, dest);
ok(hr == S_OK, "put_output failed with %08x on test %d\n", hr,
current_stream_test_index);
- VariantClear(&dest);
hr = IMXWriter_put_byteOrderMark(writer, test->bom);
ok(hr == S_OK, "put_byteOrderMark failed with %08x on test %d\n", hr,
current_stream_test_index);
@@ -4795,6 +4793,7 @@
ISAXLexicalHandler *lexical;
IVBSAXDeclHandler *vbdecl;
ISAXDeclHandler *decl;
+ ISAXDTDHandler *dtd;
IMXWriter *writer;
VARIANT dest;
HRESULT hr;
@@ -4993,19 +4992,70 @@
hr = IVBSAXDeclHandler_externalEntityDecl(vbdecl, NULL, NULL, NULL);
ok(hr == E_POINTER, "got 0x%08x\n", hr);
+ hr = ISAXDeclHandler_externalEntityDecl(decl, _bstr_("name"), 0, NULL, 0,
NULL, 0);
+ ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+
hr = ISAXDeclHandler_externalEntityDecl(decl, _bstr_("name"), -1, NULL, 0,
NULL, 0);
ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
hr = ISAXDeclHandler_externalEntityDecl(decl, _bstr_("name"),
strlen("name"), _bstr_("pubid"), strlen("pubid"),
_bstr_("sysid"), strlen("sysid"));
ok(hr == S_OK, "got 0x%08x\n", hr);
+
+ hr = ISAXDeclHandler_externalEntityDecl(decl, _bstr_("name"),
strlen("name"), NULL, 0, _bstr_("sysid"), strlen("sysid"));
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+
+ hr = ISAXDeclHandler_externalEntityDecl(decl, _bstr_("name"),
strlen("name"), _bstr_("pubid"), strlen("pubid"),
+ NULL, 0);
+ ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
V_VT(&dest) = VT_EMPTY;
hr = IMXWriter_get_output(writer, &dest);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(V_VT(&dest) == VT_BSTR, "got %d\n", V_VT(&dest));
- ok(!lstrcmpW(_bstr_("<!ENTITY name PUBLIC \"pubid\"
\"sysid\">\r\n"), V_BSTR(&dest)), "got wrong content
%s\n", wine_dbgstr_w(V_BSTR(&dest)));
+ ok(!lstrcmpW(_bstr_(
+ "<!ENTITY name PUBLIC \"pubid\"
\"sysid\">\r\n"
+ "<!ENTITY name SYSTEM \"sysid\">\r\n"),
+ V_BSTR(&dest)), "got wrong content %s\n",
wine_dbgstr_w(V_BSTR(&dest)));
+
VariantClear(&dest);
+
+ /* notation declaration */
+ hr = IMXWriter_QueryInterface(writer, &IID_ISAXDTDHandler, (void**)&dtd);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+
+ V_VT(&dest) = VT_EMPTY;
+ hr = IMXWriter_put_output(writer, dest);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+
+ hr = ISAXDTDHandler_notationDecl(dtd, NULL, 0, NULL, 0, NULL, 0);
+ ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+
+ hr = ISAXDTDHandler_notationDecl(dtd, _bstr_("name"),
strlen("name"), NULL, 0, NULL, 0);
+ ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+
+ hr = ISAXDTDHandler_notationDecl(dtd, _bstr_("name"),
strlen("name"), _bstr_("pubid"), strlen("pubid"), NULL, 0);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+
+ hr = ISAXDTDHandler_notationDecl(dtd, _bstr_("name"),
strlen("name"), _bstr_("pubid"), strlen("pubid"),
_bstr_("sysid"), strlen("sysid"));
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+
+ hr = ISAXDTDHandler_notationDecl(dtd, _bstr_("name"),
strlen("name"), NULL, 0, _bstr_("sysid"), strlen("sysid"));
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+
+ hr = IMXWriter_get_output(writer, &dest);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(V_VT(&dest) == VT_BSTR, "got %d\n", V_VT(&dest));
+ ok(!lstrcmpW(_bstr_(
+ "<!NOTATION name"
+ "<!NOTATION name PUBLIC \"pubid\">\r\n"
+ "<!NOTATION name PUBLIC \"pubid\"
\"sysid\">\r\n"
+ "<!NOTATION name SYSTEM \"sysid\">\r\n"),
+ V_BSTR(&dest)), "got wrong content %s\n",
wine_dbgstr_w(V_BSTR(&dest)));
+
+ VariantClear(&dest);
+
+ ISAXDTDHandler_Release(dtd);
ISAXContentHandler_Release(content);
ISAXLexicalHandler_Release(lexical);
@@ -5586,7 +5636,7 @@
if(FAILED(hr))
{
- skip("Failed to create SAXXMLReader instance\n");
+ win_skip("Failed to create SAXXMLReader instance\n");
CoUninitialize();
return;
}
@@ -5636,7 +5686,7 @@
test_mxattr_dispex();
}
else
- skip("SAXAttributes not supported\n");
+ win_skip("SAXAttributes not supported\n");
CoUninitialize();
}
Modified: trunk/rostests/winetests/msxml3/schema.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/msxml3/schema.c…
==============================================================================
--- trunk/rostests/winetests/msxml3/schema.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/msxml3/schema.c [iso-8859-1] Tue Jun 7 10:30:15 2016
@@ -514,6 +514,7 @@
VARIANT_BOOL b;
BSTR str;
LONG len;
+ HRESULT hr;
doc = create_document(&IID_IXMLDOMDocument2);
if (!doc)
@@ -563,6 +564,24 @@
ole_check(IXMLDOMSchemaCollection_remove(cache, NULL));
len = -1;
ole_check(IXMLDOMSchemaCollection_get_length(cache, &len));
+ ok(len == 0, "got %d\n", len);
+
+ /* same, but with VT_UNKNOWN type */
+ V_VT(&v) = VT_UNKNOWN;
+ V_UNKNOWN(&v) = (IUnknown*)doc;
+ hr = IXMLDOMSchemaCollection_add(cache, NULL, v);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+
+ len = -1;
+ hr = IXMLDOMSchemaCollection_get_length(cache, &len);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(len == 1, "got %d\n", len);
+
+ hr = IXMLDOMSchemaCollection_remove(cache, NULL);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+ len = -1;
+ hr = IXMLDOMSchemaCollection_get_length(cache, &len);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
ok(len == 0, "got %d\n", len);
str = SysAllocString(xdr_schema_uri);
@@ -1638,6 +1657,24 @@
free_bstrs();
}
+static void test_ifaces(void)
+{
+ IXMLDOMSchemaCollection2 *cache;
+ IUnknown *unk;
+ HRESULT hr;
+
+ cache = create_cache_version(60, &IID_IXMLDOMSchemaCollection2);
+ if (!cache) return;
+
+ /* CLSID_XMLSchemaCache60 is returned as an interface (the same as
IXMLDOMSchemaCollection2). */
+ hr = IXMLDOMSchemaCollection2_QueryInterface(cache, &CLSID_XMLSchemaCache60,
(void**)&unk);
+ ok (hr == S_OK, "Could not get CLSID_XMLSchemaCache60 iface: %08x\n", hr);
+ ok (unk == (IUnknown*)cache, "unk != cache\n");
+
+ IUnknown_Release(unk);
+ IXMLDOMSchemaCollection2_Release(cache);
+}
+
START_TEST(schema)
{
HRESULT r;
@@ -1655,6 +1692,7 @@
test_dispex();
test_get();
test_remove();
+ test_ifaces();
CoUninitialize();
}
Modified: trunk/rostests/winetests/msxml3/xmldoc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/msxml3/xmldoc.c…
==============================================================================
--- trunk/rostests/winetests/msxml3/xmldoc.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/msxml3/xmldoc.c [iso-8859-1] Tue Jun 7 10:30:15 2016
@@ -520,7 +520,7 @@
&IID_IXMLDocument, (LPVOID*)&doc);
if (FAILED(hr))
{
- skip("Failed to create XMLDocument instance\n");
+ win_skip("Failed to create XMLDocument instance\n");
return FALSE;
}