[XMLLITE_WINETEST] Sync with Wine Staging 1.7.55. CORE-10536
authorAmine Khaldi <amine.khaldi@reactos.org>
Fri, 20 Nov 2015 10:11:33 +0000 (10:11 +0000)
committerAmine Khaldi <amine.khaldi@reactos.org>
Fri, 20 Nov 2015 10:11:33 +0000 (10:11 +0000)
svn path=/trunk/; revision=69948

rostests/winetests/xmllite/reader.c
rostests/winetests/xmllite/writer.c

index 54138e9..820f6a2 100644 (file)
@@ -1436,6 +1436,7 @@ static void test_readvaluechunk(void)
     ok(value[0] == 'c', "got %s\n", wine_dbgstr_w(value));
 
     IXmlReader_Release(reader);
     ok(value[0] == 'c', "got %s\n", wine_dbgstr_w(value));
 
     IXmlReader_Release(reader);
+    IStream_Release(stream);
 }
 
 static struct test_entry cdata_tests[] = {
 }
 
 static struct test_entry cdata_tests[] = {
index 04d25d5..4ca8b64 100644 (file)
@@ -30,6 +30,7 @@
 
 #include <windef.h>
 #include <winbase.h>
 
 #include <windef.h>
 #include <winbase.h>
+#include <winnls.h>
 #include <objbase.h>
 #include <ole2.h>
 #include <xmllite.h>
 #include <objbase.h>
 #include <ole2.h>
 #include <xmllite.h>
@@ -43,6 +44,10 @@ static HRESULT (WINAPI *pCreateXmlWriterOutputWithEncodingName)(IUnknown *stream
                                                                 IMalloc *imalloc,
                                                                 LPCWSTR encoding_name,
                                                                 IXmlWriterOutput **output);
                                                                 IMalloc *imalloc,
                                                                 LPCWSTR encoding_name,
                                                                 IXmlWriterOutput **output);
+static HRESULT (WINAPI *pCreateXmlWriterOutputWithEncodingCodePage)(IUnknown *stream,
+                                                                    IMalloc *imalloc,
+                                                                    UINT codepage,
+                                                                    IXmlWriterOutput **output);
 
 static HRESULT WINAPI testoutput_QueryInterface(IUnknown *iface, REFIID riid, void **obj)
 {
 
 static HRESULT WINAPI testoutput_QueryInterface(IUnknown *iface, REFIID riid, void **obj)
 {
@@ -175,6 +180,7 @@ static BOOL init_pointers(void)
 #define MAKEFUNC(f) if (!(p##f = (void*)GetProcAddress(mod, #f))) return FALSE;
     MAKEFUNC(CreateXmlWriter);
     MAKEFUNC(CreateXmlWriterOutputWithEncodingName);
 #define MAKEFUNC(f) if (!(p##f = (void*)GetProcAddress(mod, #f))) return FALSE;
     MAKEFUNC(CreateXmlWriter);
     MAKEFUNC(CreateXmlWriterOutputWithEncodingName);
+    MAKEFUNC(CreateXmlWriterOutputWithEncodingCodePage);
 #undef MAKEFUNC
 
     return TRUE;
 #undef MAKEFUNC
 
     return TRUE;
@@ -200,6 +206,20 @@ static void test_writeroutput(void)
     ok(unk != NULL, "got %p\n", unk);
     /* releasing 'unk' crashes on native */
     IUnknown_Release(output);
     ok(unk != NULL, "got %p\n", unk);
     /* releasing 'unk' crashes on native */
     IUnknown_Release(output);
+
+    output = NULL;
+    hr = pCreateXmlWriterOutputWithEncodingCodePage(&testoutput, NULL, ~0u, &output);
+    ok(hr == S_OK, "got %08x\n", hr);
+    IUnknown_Release(output);
+
+    hr = pCreateXmlWriterOutputWithEncodingCodePage(&testoutput, NULL, CP_UTF8, &output);
+    ok(hr == S_OK, "got %08x\n", hr);
+    unk = NULL;
+    hr = IUnknown_QueryInterface(output, &IID_IXmlWriterOutput, (void**)&unk);
+    ok(hr == S_OK, "got %08x\n", hr);
+    ok(unk != NULL, "got %p\n", unk);
+    /* releasing 'unk' crashes on native */
+    IUnknown_Release(output);
 }
 
 static void test_writestartdocument(void)
 }
 
 static void test_writestartdocument(void)