[MSXML3_WINETEST] Sync with Wine Staging 3.3. CORE-14434
authorAmine Khaldi <amine.khaldi@reactos.org>
Tue, 20 Mar 2018 11:29:29 +0000 (12:29 +0100)
committerAmine Khaldi <amine.khaldi@reactos.org>
Tue, 20 Mar 2018 11:29:29 +0000 (12:29 +0100)
modules/rostests/winetests/msxml3/CMakeLists.txt
modules/rostests/winetests/msxml3/domdoc.c
modules/rostests/winetests/msxml3/guid.c [new file with mode: 0644]
modules/rostests/winetests/msxml3/httpreq.c
modules/rostests/winetests/msxml3/precomp.h
modules/rostests/winetests/msxml3/saxreader.c
modules/rostests/winetests/msxml3/schema.c
modules/rostests/winetests/msxml3/xmldoc.c
modules/rostests/winetests/msxml3/xmlparser.c
modules/rostests/winetests/msxml3/xmlview.c

index 2d82418..84c0d46 100644 (file)
@@ -13,7 +13,12 @@ list(APPEND SOURCE
     xmlview.c
     precomp.h)
 
-add_executable(msxml3_winetest ${SOURCE} testlist.c rsrc.rc)
+add_executable(msxml3_winetest
+    ${SOURCE}
+    guid.c
+    testlist.c
+    rsrc.rc)
+
 add_idl_headers(xmlparser_idlheader_test xmlparser.idl)
 add_dependencies(msxml3_winetest xmlparser_idlheader_test)
 set_module_type(msxml3_winetest win32cui)
index 03ac016..57bc88d 100644 (file)
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
-#include "precomp.h"
 
-#include <asptlb.h>
+#define COBJMACROS
+#define CONST_VTABLE
+
+#include <stdio.h>
+#include <assert.h>
+
+#include "windows.h"
+
+#include "msxml.h"
+#include "msxml2.h"
+#include "msxml2did.h"
+#include "ole2.h"
+#include "dispex.h"
+#include "objsafe.h"
+#include "mshtml.h"
+#include "initguid.h"
+#include "asptlb.h"
+
+#include "wine/heap.h"
+#include "wine/test.h"
 
 /* undef the #define in msxml2 so that we can access all versions */
 #undef CLSID_DOMDocument
@@ -155,7 +173,7 @@ static ULONG WINAPI dispevent_Release(IDispatch *iface)
     ULONG ref = InterlockedDecrement( &This->ref );
 
     if (ref == 0)
-        HeapFree(GetProcessHeap(), 0, This);
+        heap_free(This);
 
     return ref;
 }
@@ -215,7 +233,7 @@ static const IDispatchVtbl dispeventVtbl =
 
 static IDispatch* create_dispevent(void)
 {
-    dispevent *event = HeapAlloc(GetProcessHeap(), 0, sizeof(*event));
+    dispevent *event = heap_alloc(sizeof(*event));
 
     event->IDispatch_iface.lpVtbl = &dispeventVtbl;
     event->ref = 1;
@@ -682,8 +700,10 @@ static void _expect_list_len(IXMLDOMNodeList *list, LONG len, int line)
 #define EXPECT_HR(hr,hr_exp) \
     ok(hr == hr_exp, "got 0x%08x, expected 0x%08x\n", hr, hr_exp)
 
+#ifdef __REACTOS__
 #define EXPECT_NOT_HR(hr,hr_exp) \
     ok(hr != hr_exp, "got 0x%08x, expected not 0x%08x\n", hr, hr_exp)
+#endif
 
 static const WCHAR szEmpty[] = { 0 };
 static const WCHAR szIncomplete[] = {
@@ -10168,13 +10188,68 @@ static void write_to_file(const char *name, const char *data)
     CloseHandle(hfile);
 }
 
+static void test_doc_load_from_path(IXMLDOMDocument *doc, const char *path)
+{
+    IXMLDOMDocument *doc2;
+    IXMLDOMElement *elem;
+    BSTR url, url2;
+    VARIANT_BOOL b;
+    VARIANT src;
+    HRESULT hr;
+
+    url = _bstr_(path);
+
+    V_VT(&src) = VT_BSTR;
+    V_BSTR(&src) = url;
+    hr = IXMLDOMDocument_load(doc, src, &b);
+    ok(hr == S_OK, "Failed to load document, %#x.\n", hr);
+    ok(b == VARIANT_TRUE, "got %d\n", b);
+
+    V_VT(&src) = VT_BSTR | VT_BYREF;
+    V_BSTRREF(&src) = &url;
+    hr = IXMLDOMDocument_load(doc, src, &b);
+    ok(hr == S_OK, "Failed to load document, %#x.\n", hr);
+    ok(b == VARIANT_TRUE, "got %d\n", b);
+
+    url = NULL;
+    hr = IXMLDOMDocument_get_url(doc, &url);
+    ok(hr == S_OK, "Failed to get document url, hr %#x.\n", hr);
+
+    hr = IXMLDOMDocument_get_documentElement(doc, &elem);
+    ok(hr == S_OK, "got 0x%08x\n", hr);
+
+    /* Create another instance for the same document, check url */
+    hr = IXMLDOMElement_get_ownerDocument(elem, &doc2);
+    ok(hr == S_OK, "Failed to get owner document, hr %#x.\n", hr);
+
+    hr = IXMLDOMDocument_get_url(doc2, &url2);
+    ok(hr == S_OK, "Failed to get document url, hr %#x.\n", hr);
+    ok(!lstrcmpW(url, url2), "Unexpected url %s.\n", wine_dbgstr_w(url2));
+
+    IXMLDOMDocument_Release(doc2);
+    IXMLDOMElement_Release(elem);
+    SysFreeString(url2);
+    SysFreeString(url);
+}
+
+static void url_forward_slash(char *url)
+{
+    char *p = url;
+
+    while (*p)
+    {
+        if (*p == '\\')
+            *p = '/';
+        p++;
+    }
+}
+
 static void test_load(void)
 {
-    IXMLDOMDocument *doc, *doc2;
-    BSTR pathW, bstr1, bstr2;
+    char path[MAX_PATH], path2[MAX_PATH];
     IXMLDOMNodeList *list;
-    IXMLDOMElement *elem;
-    char path[MAX_PATH];
+    IXMLDOMDocument *doc;
+    BSTR bstr1, bstr2;
     VARIANT_BOOL b;
     VARIANT src;
     HRESULT hr;
@@ -10195,47 +10270,26 @@ static void test_load(void)
     EXPECT_HR(hr, E_INVALIDARG);
     ok(b == VARIANT_FALSE, "got %d\n", b);
 
-    pathW = _bstr_(path);
-
-    /* load from path: VT_BSTR */
-    V_VT(&src) = VT_BSTR;
-    V_BSTR(&src) = pathW;
-    hr = IXMLDOMDocument_load(doc, src, &b);
-    EXPECT_HR(hr, S_OK);
-    ok(b == VARIANT_TRUE, "got %d\n", b);
-
-    bstr1 = NULL;
-    hr = IXMLDOMDocument_get_url(doc, &bstr1);
-    ok(hr == S_OK, "got 0x%08x\n", hr);
-    SysFreeString(bstr1);
-
-    /* load from a path: VT_BSTR|VT_BYREF */
-    V_VT(&src) = VT_BSTR | VT_BYREF;
-    V_BSTRREF(&src) = &pathW;
-    hr = IXMLDOMDocument_load(doc, src, &b);
-    EXPECT_HR(hr, S_OK);
-    ok(b == VARIANT_TRUE, "got %d\n", b);
-
-    bstr1 = NULL;
-    hr = IXMLDOMDocument_get_url(doc, &bstr1);
-    ok(hr == S_OK, "got 0x%08x\n", hr);
+    /* "file://" url */
+    strcpy(path2, "file://");
+    strcat(path2, path);
+    test_doc_load_from_path(doc, path2);
 
-    hr = IXMLDOMDocument_get_documentElement(doc, &elem);
-    ok(hr == S_OK, "got 0x%08x\n", hr);
+    /* file:// url, forward slashes */
+    url_forward_slash(path2);
+    test_doc_load_from_path(doc, path2);
 
-    /* create another instance for the same document, check url */
-    hr = IXMLDOMElement_get_ownerDocument(elem, &doc2);
-    ok(hr == S_OK, "got 0x%08x\n", hr);
+    /* "file:/" url */
+    strcpy(path2, "file:/");
+    strcat(path2, path);
+    test_doc_load_from_path(doc, path);
 
-    hr = IXMLDOMDocument_get_url(doc, &bstr2);
-    ok(hr == S_OK, "got 0x%08x\n", hr);
-    ok(!lstrcmpW(bstr1, bstr2), "got %s\n", wine_dbgstr_w(bstr2));
+    /* file:/ with forward slashes. */
+    url_forward_slash(path2);
+    test_doc_load_from_path(doc, path2);
 
-    IXMLDOMDocument_Release(doc2);
-    IXMLDOMElement_Release(elem);
-
-    SysFreeString(bstr1);
-    SysFreeString(bstr2);
+    /* Regular local path. */
+    test_doc_load_from_path(doc, path);
 
     /* load from a path: VT_BSTR|VT_BYREF, null ptr */
     V_VT(&src) = VT_BSTR | VT_BYREF;
@@ -10255,7 +10309,7 @@ static void test_load(void)
     write_to_file(path, nocontent);
 
     V_VT(&src) = VT_BSTR;
-    V_BSTR(&src) = pathW;
+    V_BSTR(&src) = _bstr_(path);
     b = VARIANT_TRUE;
     hr = IXMLDOMDocument_load(doc, src, &b);
     ok(hr == S_FALSE, "got 0x%08x\n", hr);
@@ -12124,34 +12178,148 @@ static void test_put_data(void)
        type++;
     }
 
-    /* \r\n sequence is never escaped */
+    IXMLDOMDocument_Release(doc);
+    free_bstrs();
+}
+
+static void test_newline_normalization(void)
+{
+    const struct msxmlsupported_data_t *table = domdoc_support_data;
+    IXMLDOMDocument *doc;
+    IXMLDOMText *text;
+    IXMLDOMNode *node;
+    VARIANT v;
+    VARIANT_BOOL b;
+    BSTR s;
+    HRESULT hr;
+    LONG length;
+
     V_VT(&v) = VT_I2;
     V_I2(&v) = NODE_TEXT;
 
-    hr = IXMLDOMDocument_createNode(doc, v, _bstr_("name"), NULL, &node);
-    ok(hr == S_OK, "got 0x%08x\n", hr);
+    while (table->clsid)
+    {
+        if (!is_clsid_supported(table->clsid, &IID_IXMLDOMDocument))
+        {
+            table++;
+            continue;
+        }
 
-    IXMLDOMNode_QueryInterface(node, &IID_IXMLDOMText, (void**)&text);
+        hr = CoCreateInstance(table->clsid, NULL, CLSCTX_INPROC_SERVER, &IID_IXMLDOMDocument, (void**)&doc);
+        ok(hr == S_OK, "got 0x%08x\n", hr);
 
-    hr = IXMLDOMText_put_data(text, _bstr_("\r\n"));
-    ok(hr == S_OK, "got 0x%08x\n", hr);
+        hr = IXMLDOMDocument_createNode(doc, v, _bstr_("name"), NULL, &node);
+        ok(hr == S_OK, "got 0x%08x\n", hr);
 
-    hr = IXMLDOMText_get_data(text, &get_data);
-    ok(hr == S_OK, "got 0x%08x\n", hr);
-todo_wine
-    ok(!lstrcmpW(get_data, _bstr_("\n")), "got %s\n", wine_dbgstr_w(get_data));
-    SysFreeString(get_data);
+        IXMLDOMNode_QueryInterface(node, &IID_IXMLDOMText, (void**)&text);
 
-    hr = IXMLDOMText_get_xml(text, &get_data);
-    ok(hr == S_OK, "got 0x%08x\n", hr);
-    ok(!lstrcmpW(get_data, _bstr_("\r\n")), "got %s\n", wine_dbgstr_w(get_data));
-    SysFreeString(get_data);
+        /* \r\n is normalized to \n and back to \r\n */
 
-    IXMLDOMText_Release(text);
-    IXMLDOMNode_Release(node);
+        hr = IXMLDOMText_put_data(text, _bstr_("\r\n"));
+        ok(hr == S_OK, "got 0x%08x\n", hr);
 
-    IXMLDOMDocument_Release(doc);
-    free_bstrs();
+        hr = IXMLDOMText_get_data(text, &s);
+        ok(hr == S_OK, "got 0x%08x\n", hr);
+        ok(!lstrcmpW(s, _bstr_("\n")), "got %s\n", wine_dbgstr_w(s));
+        SysFreeString(s);
+
+        hr = IXMLDOMText_get_length(text, &length);
+        ok(hr == S_OK, "got 0x%08x\n", hr);
+        ok(length == 1, "got %d, expected 1\n", length);
+
+        hr = IXMLDOMText_get_xml(text, &s);
+        ok(hr == S_OK, "got 0x%08x\n", hr);
+        ok(!lstrcmpW(s, _bstr_("\r\n")), "got %s\n", wine_dbgstr_w(s));
+        SysFreeString(s);
+
+        /* \r\r\n is normalized to \n\n and back to \r\n\r\n */
+
+        hr = IXMLDOMText_put_data(text, _bstr_("\r\r\n"));
+        ok(hr == S_OK, "got 0x%08x\n", hr);
+
+        hr = IXMLDOMText_get_data(text, &s);
+        ok(hr == S_OK, "got 0x%08x\n", hr);
+        ok(!lstrcmpW(s, _bstr_("\n\n")), "got %s\n", wine_dbgstr_w(s));
+        SysFreeString(s);
+
+        hr = IXMLDOMText_get_length(text, &length);
+        ok(hr == S_OK, "got 0x%08x\n", hr);
+        ok(length == 2, "got %d, expected 2\n", length);
+
+        hr = IXMLDOMText_get_xml(text, &s);
+        ok(hr == S_OK, "got 0x%08x\n", hr);
+        ok(!lstrcmpW(s, _bstr_("\r\n\r\n")), "got %s\n", wine_dbgstr_w(s));
+        SysFreeString(s);
+
+        /* the same normalizations are applied when loading a document as a whole */
+
+        hr = IXMLDOMDocument_loadXML(doc, _bstr_("<?xml version=\"1.0\"?><root>foo\n\r\n\r\r\nbar</root>"), &b);
+        ok(hr == S_OK, "got 0x%08x\n", hr);
+
+        hr = IXMLDOMDocument_get_text(doc, &s);
+        ok(hr == S_OK, "got 0x%08x\n", hr);
+        ok(!lstrcmpW(s, _bstr_("foo\n\n\n\nbar")), "got %s\n", wine_dbgstr_w(s));
+        SysFreeString(s);
+
+        hr = IXMLDOMDocument_get_xml(doc, &s);
+        ok(hr == S_OK, "got 0x%08x\n", hr);
+        ok(!lstrcmpW(s, _bstr_("<?xml version=\"1.0\"?>\r\n<root>foo\r\n\r\n\r\n\r\nbar</root>\r\n")),
+           "got %s\n", wine_dbgstr_w(s));
+        SysFreeString(s);
+
+        /* even if xml:space="preserve" */
+
+        hr = IXMLDOMDocument_loadXML(doc, _bstr_("<?xml version=\"1.0\"?>"
+                                                 "<root xml:space=\"preserve\">foo\n\r\n\r\r\nbar</root>"), &b);
+        ok(hr == S_OK, "got 0x%08x\n", hr);
+
+        hr = IXMLDOMDocument_get_text(doc, &s);
+        ok(hr == S_OK, "got 0x%08x\n", hr);
+        ok(!lstrcmpW(s, _bstr_("foo\n\n\n\nbar")), "got %s\n", wine_dbgstr_w(s));
+        SysFreeString(s);
+
+        hr = IXMLDOMDocument_get_xml(doc, &s);
+        ok(hr == S_OK, "got 0x%08x\n", hr);
+        ok(!lstrcmpW(s, _bstr_("<?xml version=\"1.0\"?>\r\n"
+                               "<root xml:space=\"preserve\">foo\r\n\r\n\r\n\r\nbar</root>\r\n")),
+           "got %s\n", wine_dbgstr_w(s));
+        SysFreeString(s);
+
+        /* or preserveWhiteSpace is set */
+
+        hr = IXMLDOMDocument_put_preserveWhiteSpace(doc, VARIANT_TRUE);
+        ok(hr == S_OK, "got 0x%08x\n", hr);
+
+        hr = IXMLDOMDocument_loadXML(doc, _bstr_("<?xml version=\"1.0\"?><root>foo\n\r\n\r\r\nbar</root>"), &b);
+        ok(hr == S_OK, "got 0x%08x\n", hr);
+
+        hr = IXMLDOMDocument_get_text(doc, &s);
+        ok(hr == S_OK, "got 0x%08x\n", hr);
+        ok(!lstrcmpW(s, _bstr_("foo\n\n\n\nbar")), "got %s\n", wine_dbgstr_w(s));
+        SysFreeString(s);
+
+        hr = IXMLDOMDocument_get_xml(doc, &s);
+        ok(hr == S_OK, "got 0x%08x\n", hr);
+        if (IsEqualGUID(table->clsid, &CLSID_DOMDocument60))
+        {
+            /* DOMDocument60 does the newline normalization but does not insert line breaks around the root node */
+todo_wine
+            ok(!lstrcmpW(s, _bstr_("<?xml version=\"1.0\"?><root>foo\r\n\r\n\r\n\r\nbar</root>")),
+               "got %s\n", wine_dbgstr_w(s));
+        }
+        else
+        {
+            ok(!lstrcmpW(s, _bstr_("<?xml version=\"1.0\"?>\r\n<root>foo\r\n\r\n\r\n\r\nbar</root>\r\n")),
+               "got %s\n", wine_dbgstr_w(s));
+        }
+        SysFreeString(s);
+
+        IXMLDOMText_Release(text);
+        IXMLDOMNode_Release(node);
+        IXMLDOMDocument_Release(doc);
+        free_bstrs();
+        table++;
+    }
 }
 
 static void test_putref_schemas(void)
@@ -12735,6 +12903,7 @@ START_TEST(domdoc)
     test_nodeValue();
     test_get_namespaces();
     test_put_data();
+    test_newline_normalization();
     test_putref_schemas();
     test_namedmap_newenum();
     test_xmlns_attribute();
diff --git a/modules/rostests/winetests/msxml3/guid.c b/modules/rostests/winetests/msxml3/guid.c
new file mode 100644 (file)
index 0000000..a35fcdd
--- /dev/null
@@ -0,0 +1,16 @@
+/* DO NOT USE THE PRECOMPILED HEADER FOR THIS FILE! */
+
+#include <stdarg.h>
+
+#define WIN32_NO_STATUS
+#define _INC_WINDOWS
+
+#include <windef.h>
+#include <winbase.h>
+#include <initguid.h>
+#include <objsafe.h>
+#include <msxml2.h>
+#include <mshtml.h>
+#include <xmlparser.h>
+
+/* NO CODE HERE, THIS IS JUST REQUIRED FOR THE GUID DEFINITIONS */
index 9c4e488..4f51ef9 100644 (file)
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
-#include "precomp.h"
+
+#define COBJMACROS
+#define CONST_VTABLE
+
+#include <stdio.h>
+#include <assert.h>
+
+#include "windows.h"
+
+#include "msxml2.h"
+#include "msxml2did.h"
+#include "dispex.h"
+
+#include "initguid.h"
+#include "objsafe.h"
+#include "mshtml.h"
+
+#include "wine/heap.h"
+#include "wine/test.h"
 
 #define EXPECT_HR(hr,hr_exp) \
     ok(hr == hr_exp, "got 0x%08x, expected 0x%08x\n", hr, hr_exp)
@@ -1226,7 +1244,7 @@ static ULONG WINAPI dispevent_Release(IDispatch *iface)
     ULONG ref = InterlockedDecrement( &This->ref );
 
     if (ref == 0)
-        HeapFree(GetProcessHeap(), 0, This);
+        heap_free(This);
 
     return ref;
 }
@@ -1303,7 +1321,7 @@ static const IDispatchVtbl dispeventVtbl =
 
 static IDispatch* create_dispevent(void)
 {
-    dispevent *event = HeapAlloc(GetProcessHeap(), 0, sizeof(*event));
+    dispevent *event = heap_alloc(sizeof(*event));
 
     event->IDispatch_iface.lpVtbl = &dispeventVtbl;
     event->ref = 1;
index 888b1e6..9bdbab5 100644 (file)
@@ -1,9 +1,8 @@
+
 #ifndef _MSXML3_WINETEST_PRECOMP_H_
 #define _MSXML3_WINETEST_PRECOMP_H_
 
 #define WIN32_NO_STATUS
-#define _INC_WINDOWS
-#define COM_NO_WINDOWS_H
 
 #define COBJMACROS
 #define CONST_VTABLE
 #include <assert.h>
 
 #include <wine/test.h>
+#include <wine/heap.h>
 
-#include <winnls.h>
-#include <wingdi.h>
-#include <initguid.h>
+#include <windows.h>
 #include <ole2.h>
 #include <msxml2.h>
-#include <msxml2did.h>
 #include <objsafe.h>
+#include <ocidl.h>
+#include <dispex.h>
 #include <mshtml.h>
 #include <xmlparser.h>
 
index ed0eede..3ed332e 100644 (file)
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
-#include "precomp.h"
+#define COBJMACROS
+#define CONST_VTABLE
 
-DEFINE_GUID(GUID_NULL,0,0,0,0,0,0,0,0,0,0,0);
+#include <stdio.h>
+#include <assert.h>
+
+#include "windows.h"
+#include "ole2.h"
+#include "msxml2.h"
+#include "msxml2did.h"
+#include "ocidl.h"
+#include "dispex.h"
+
+#include "wine/heap.h"
+#include "wine/test.h"
 
 static const WCHAR emptyW[] = {0};
 
@@ -246,16 +258,13 @@ static void add_call(struct call_sequence **seq, int sequence_index,
     if (!call_seq->sequence)
     {
         call_seq->size = 10;
-        call_seq->sequence = HeapAlloc(GetProcessHeap(), 0,
-                                      call_seq->size * sizeof (struct call_entry));
+        call_seq->sequence = heap_alloc(call_seq->size * sizeof (struct call_entry));
     }
 
     if (call_seq->count == call_seq->size)
     {
         call_seq->size *= 2;
-        call_seq->sequence = HeapReAlloc(GetProcessHeap(), 0,
-                                        call_seq->sequence,
-                                        call_seq->size * sizeof (struct call_entry));
+        call_seq->sequence = heap_realloc(call_seq->sequence, call_seq->size * sizeof (struct call_entry));
     }
 
     assert(call_seq->sequence);
@@ -290,7 +299,7 @@ static inline void flush_sequence(struct call_sequence **seg, int sequence_index
             SysFreeString(call_seq->sequence[i].attributes[j].qnameW);
             SysFreeString(call_seq->sequence[i].attributes[j].valueW);
         }
-        HeapFree(GetProcessHeap(), 0, call_seq->sequence[i].attributes);
+        heap_free(call_seq->sequence[i].attributes);
         call_seq->sequence[i].attr_count = 0;
 
         SysFreeString(call_seq->sequence[i].arg1W);
@@ -298,7 +307,7 @@ static inline void flush_sequence(struct call_sequence **seg, int sequence_index
         SysFreeString(call_seq->sequence[i].arg3W);
     }
 
-    HeapFree(GetProcessHeap(), 0, call_seq->sequence);
+    heap_free(call_seq->sequence);
     call_seq->sequence = NULL;
     call_seq->count = call_seq->size = 0;
 }
@@ -525,7 +534,7 @@ static void init_call_sequences(struct call_sequence **seq, int n)
     int i;
 
     for (i = 0; i < n; i++)
-        seq[i] = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(struct call_sequence));
+        seq[i] = heap_alloc_zero(sizeof(struct call_sequence));
 }
 
 static const WCHAR szSimpleXML[] = {
@@ -1212,7 +1221,7 @@ static HRESULT WINAPI contentHandler_startElement(
         int i;
 
         struct attribute_entry *attr;
-        attr = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len*sizeof(struct attribute_entry));
+        attr = heap_alloc_zero(len * sizeof(*attr));
 
         v = VARIANT_TRUE;
         hr = ISAXXMLReader_getFeature(g_reader, _bstr_("http://xml.org/sax/features/namespaces"), &v);
@@ -2780,6 +2789,36 @@ static void test_saxreader_features(void)
             continue;
         }
 
+        if (IsEqualGUID(entry->guid, &CLSID_SAXXMLReader40) ||
+                IsEqualGUID(entry->guid, &CLSID_SAXXMLReader60))
+        {
+            value = VARIANT_TRUE;
+            hr = ISAXXMLReader_getFeature(reader, _bstr_("exhaustive-errors"), &value);
+            ok(hr == S_OK, "Failed to get feature value, hr %#x.\n", hr);
+            ok(value == VARIANT_FALSE, "Unexpected default feature value.\n");
+            hr = ISAXXMLReader_putFeature(reader, _bstr_("exhaustive-errors"), VARIANT_FALSE);
+            ok(hr == S_OK, "Failed to put feature value, hr %#x.\n", hr);
+
+            value = VARIANT_TRUE;
+            hr = ISAXXMLReader_getFeature(reader, _bstr_("schema-validation"), &value);
+            ok(hr == S_OK, "Failed to get feature value, hr %#x.\n", hr);
+            ok(value == VARIANT_FALSE, "Unexpected default feature value.\n");
+            hr = ISAXXMLReader_putFeature(reader, _bstr_("exhaustive-errors"), VARIANT_FALSE);
+            ok(hr == S_OK, "Failed to put feature value, hr %#x.\n", hr);
+        }
+        else
+        {
+            value = 123;
+            hr = ISAXXMLReader_getFeature(reader, _bstr_("exhaustive-errors"), &value);
+            ok(hr == E_INVALIDARG, "Failed to get feature value, hr %#x.\n", hr);
+            ok(value == 123, "Unexpected value %d.\n", value);
+
+            value = 123;
+            hr = ISAXXMLReader_getFeature(reader, _bstr_("schema-validation"), &value);
+            ok(hr == E_INVALIDARG, "Failed to get feature value, hr %#x.\n", hr);
+            ok(value == 123, "Unexpected value %d.\n", value);
+        }
+
         name = feature_names;
         while (*name)
         {
@@ -3296,7 +3335,7 @@ static void test_mxwriter_flush(void)
     ok(pos2.QuadPart == 0, "expected stream beginning\n");
 
     len = 2048;
-    buff = HeapAlloc(GetProcessHeap(), 0, len+1);
+    buff = heap_alloc(len + 1);
     memset(buff, 'A', len);
     buff[len] = 0;
     hr = ISAXContentHandler_characters(content, _bstr_(buff), len);
@@ -3379,7 +3418,7 @@ static void test_mxwriter_flush(void)
     ok(SysStringLen(V_BSTR(&dest)) == len, "got len=%d, expected %d\n", SysStringLen(V_BSTR(&dest)), len);
     VariantClear(&dest);
 
-    HeapFree(GetProcessHeap(), 0, buff);
+    heap_free(buff);
     ISAXContentHandler_Release(content);
     IStream_Release(stream);
     IMXWriter_Release(writer);
index 306c65d..799365b 100644 (file)
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
-#include "precomp.h"
+#include <stdio.h>
+#include <assert.h>
+#define COBJMACROS
 
-DEFINE_GUID(GUID_NULL,0,0,0,0,0,0,0,0,0,0,0);
+#include "initguid.h"
+#include "windows.h"
+#include "ole2.h"
+#include "msxml2.h"
+#undef CLSID_DOMDocument
+#include "msxml2did.h"
+#include "dispex.h"
+
+#include "wine/test.h"
+
+#ifdef __REACTOS__
+#include <cguid.h>
+#endif
 
 #define EXPECT_HR(hr,hr_exp) \
     ok(hr == hr_exp, "got 0x%08x, expected 0x%08x\n", hr, hr_exp)
@@ -426,8 +440,13 @@ static const CHAR szOpenSeqXML4[] = "<test><x/><x/><y/><z/><z/><v/></test>";
                   wine_dbgstr_longlong(v1), wine_dbgstr_longlong(v2)); \
 }
 
+#ifdef __REACTOS__
 #define expect_int64(expr, x, base) _expect64(expr, #x, base, LONG64, _strtoi64)
 #define expect_uint64(expr, x, base) _expect64(expr, #x, base, ULONG64, _strtoui64)
+#else
+#define expect_int64(expr, x, base) _expect64(expr, #x, base, LONG64, strtoll)
+#define expect_uint64(expr, x, base) _expect64(expr, #x, base, ULONG64, strtoull)
+#endif
 
 static BSTR alloced_bstrs[256];
 static int alloced_bstrs_count;
index ee031bc..359297f 100644 (file)
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
-#include "precomp.h"
+#define COBJMACROS
+
+#include <stdio.h>
+#include "windows.h"
+#include "ole2.h"
+#include "msxml2.h"
+#include "msxml2did.h"
+#include "ocidl.h"
+
+#include "wine/test.h"
 
 #define EXPECT_HR(hr,hr_exp) \
     ok(hr == hr_exp, "got 0x%08x, expected 0x%08x\n", hr, hr_exp)
index 0bb2ecb..32514e3 100644 (file)
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
+#define COBJMACROS
+#define CONST_VTABLE
+
+#include <stdio.h>
+#include <assert.h>
+
+#include "windows.h"
+#include "ole2.h"
+#include "xmlparser.h"
+#include "wine/test.h"
 
-#include "precomp.h"
 
 static HRESULT WINAPI nodefact_QueryInterface(IXMLNodeFactory *iface,
         REFIID riid, void **ppvObject)
index d3a0903..dc8ab7d 100644 (file)
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
-
-#include "precomp.h"
-
-#include <perhist.h>
-#include <docobj.h>
-
-#define DISPID_HTMLDOCUMENTEVENTS2_ONREADYSTATECHANGE DISPID_READYSTATECHANGE
+#define COBJMACROS
+#define CONST_VTABLE
+
+#include <stdio.h>
+#include <assert.h>
+
+#include "windows.h"
+#include "ole2.h"
+#include "mshtml.h"
+#include "mshtmdid.h"
+#include "initguid.h"
+#include "perhist.h"
+#include "docobj.h"
+#include "urlmon.h"
+#include "xmlparser.h"
+
+#include "wine/test.h"
 
 HRESULT (WINAPI *pCreateURLMoniker)(IMoniker*, LPCWSTR, IMoniker**);