Commit b9b2dafb authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

xmllite/tests: Use static linking to xmllite.dll.

parent 41f22e4c
TESTDLL = xmllite.dll TESTDLL = xmllite.dll
IMPORTS = ole32 IMPORTS = xmllite ole32
C_SRCS = \ C_SRCS = \
reader.c \ reader.c \
......
...@@ -33,14 +33,6 @@ ...@@ -33,14 +33,6 @@
DEFINE_GUID(IID_IXmlReaderInput, 0x0b3ccc9b, 0x9214, 0x428b, 0xa2, 0xae, 0xef, 0x3a, 0xa8, 0x71, 0xaf, 0xda); DEFINE_GUID(IID_IXmlReaderInput, 0x0b3ccc9b, 0x9214, 0x428b, 0xa2, 0xae, 0xef, 0x3a, 0xa8, 0x71, 0xaf, 0xda);
static HRESULT (WINAPI *pCreateXmlReader)(REFIID riid, void **ppvObject, IMalloc *pMalloc);
static HRESULT (WINAPI *pCreateXmlReaderInputWithEncodingName)(IUnknown *stream,
IMalloc *pMalloc,
LPCWSTR encoding,
BOOL hint,
LPCWSTR base_uri,
IXmlReaderInput **ppInput);
static WCHAR *a2w(const char *str) static WCHAR *a2w(const char *str)
{ {
int len = MultiByteToWideChar(CP_ACP, 0, str, -1, NULL, 0); int len = MultiByteToWideChar(CP_ACP, 0, str, -1, NULL, 0);
...@@ -367,25 +359,6 @@ static const ISequentialStreamVtbl teststreamvtbl = ...@@ -367,25 +359,6 @@ static const ISequentialStreamVtbl teststreamvtbl =
teststream_Write teststream_Write
}; };
static BOOL init_pointers(void)
{
/* don't free module here, it's to be unloaded on exit */
HMODULE mod = LoadLibraryA("xmllite.dll");
if (!mod)
{
win_skip("xmllite library not available\n");
return FALSE;
}
#define MAKEFUNC(f) if (!(p##f = (void*)GetProcAddress(mod, #f))) return FALSE;
MAKEFUNC(CreateXmlReader);
MAKEFUNC(CreateXmlReaderInputWithEncodingName);
#undef MAKEFUNC
return TRUE;
}
static HRESULT WINAPI resolver_QI(IXmlResolver *iface, REFIID riid, void **obj) static HRESULT WINAPI resolver_QI(IXmlResolver *iface, REFIID riid, void **obj)
{ {
ok(0, "unexpected call, riid %s\n", wine_dbgstr_guid(riid)); ok(0, "unexpected call, riid %s\n", wine_dbgstr_guid(riid));
...@@ -440,11 +413,11 @@ static void test_reader_create(void) ...@@ -440,11 +413,11 @@ static void test_reader_create(void)
/* crashes native */ /* crashes native */
if (0) if (0)
{ {
pCreateXmlReader(&IID_IXmlReader, NULL, NULL); CreateXmlReader(&IID_IXmlReader, NULL, NULL);
pCreateXmlReader(NULL, (void**)&reader, NULL); CreateXmlReader(NULL, (void**)&reader, NULL);
} }
hr = pCreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL); hr = CreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL);
ok(hr == S_OK, "Expected S_OK, got %08x\n", hr); ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
test_read_state(reader, XmlReadState_Closed, -1, FALSE); test_read_state(reader, XmlReadState_Closed, -1, FALSE);
...@@ -517,9 +490,9 @@ static void test_readerinput(void) ...@@ -517,9 +490,9 @@ static void test_readerinput(void)
HRESULT hr; HRESULT hr;
LONG ref; LONG ref;
hr = pCreateXmlReaderInputWithEncodingName(NULL, NULL, NULL, FALSE, NULL, NULL); hr = CreateXmlReaderInputWithEncodingName(NULL, NULL, NULL, FALSE, NULL, NULL);
ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %08x\n", hr); ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %08x\n", hr);
hr = pCreateXmlReaderInputWithEncodingName(NULL, NULL, NULL, FALSE, NULL, &reader_input); hr = CreateXmlReaderInputWithEncodingName(NULL, NULL, NULL, FALSE, NULL, &reader_input);
ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %08x\n", hr); ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %08x\n", hr);
hr = CreateStreamOnHGlobal(NULL, TRUE, &stream); hr = CreateStreamOnHGlobal(NULL, TRUE, &stream);
...@@ -528,7 +501,7 @@ static void test_readerinput(void) ...@@ -528,7 +501,7 @@ static void test_readerinput(void)
ref = IStream_AddRef(stream); ref = IStream_AddRef(stream);
ok(ref == 2, "Expected 2, got %d\n", ref); ok(ref == 2, "Expected 2, got %d\n", ref);
IStream_Release(stream); IStream_Release(stream);
hr = pCreateXmlReaderInputWithEncodingName((IUnknown*)stream, NULL, NULL, FALSE, NULL, &reader_input); hr = CreateXmlReaderInputWithEncodingName((IUnknown*)stream, NULL, NULL, FALSE, NULL, &reader_input);
ok(hr == S_OK, "Expected S_OK, got %08x\n", hr); ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
hr = IUnknown_QueryInterface(reader_input, &IID_IStream, (void**)&stream2); hr = IUnknown_QueryInterface(reader_input, &IID_IStream, (void**)&stream2);
...@@ -543,7 +516,7 @@ static void test_readerinput(void) ...@@ -543,7 +516,7 @@ static void test_readerinput(void)
IStream_Release(stream); IStream_Release(stream);
/* try ::SetInput() with valid IXmlReaderInput */ /* try ::SetInput() with valid IXmlReaderInput */
hr = pCreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL); hr = CreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL);
ok(hr == S_OK, "Expected S_OK, got %08x\n", hr); ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
ref = IUnknown_AddRef(reader_input); ref = IUnknown_AddRef(reader_input);
...@@ -609,7 +582,7 @@ static void test_readerinput(void) ...@@ -609,7 +582,7 @@ static void test_readerinput(void)
ref = IUnknown_AddRef(input); ref = IUnknown_AddRef(input);
ok(ref == 2, "Expected 2, got %d\n", ref); ok(ref == 2, "Expected 2, got %d\n", ref);
IUnknown_Release(input); IUnknown_Release(input);
hr = pCreateXmlReaderInputWithEncodingName(input, NULL, NULL, FALSE, NULL, &reader_input); hr = CreateXmlReaderInputWithEncodingName(input, NULL, NULL, FALSE, NULL, &reader_input);
ok(hr == S_OK, "Expected S_OK, got %08x\n", hr); ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
ok_iids(&input_iids, empty_seq, NULL, FALSE); ok_iids(&input_iids, empty_seq, NULL, FALSE);
/* IXmlReaderInput stores stream interface as IUnknown */ /* IXmlReaderInput stores stream interface as IUnknown */
...@@ -617,7 +590,7 @@ static void test_readerinput(void) ...@@ -617,7 +590,7 @@ static void test_readerinput(void)
ok(ref == 3, "Expected 3, got %d\n", ref); ok(ref == 3, "Expected 3, got %d\n", ref);
IUnknown_Release(input); IUnknown_Release(input);
hr = pCreateXmlReader(&IID_IXmlReader, (LPVOID*)&reader, NULL); hr = CreateXmlReader(&IID_IXmlReader, (LPVOID*)&reader, NULL);
ok(hr == S_OK, "Expected S_OK, got %08x\n", hr); ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
input_iids.count = 0; input_iids.count = 0;
...@@ -648,7 +621,7 @@ static void test_readerinput(void) ...@@ -648,7 +621,7 @@ static void test_readerinput(void)
ok_iids(&input_iids, setinput_readerinput, NULL, FALSE); ok_iids(&input_iids, setinput_readerinput, NULL, FALSE);
/* another reader */ /* another reader */
hr = pCreateXmlReader(&IID_IXmlReader, (LPVOID*)&reader2, NULL); hr = CreateXmlReader(&IID_IXmlReader, (LPVOID*)&reader2, NULL);
ok(hr == S_OK, "Expected S_OK, got %08x\n", hr); ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
/* resolving from IXmlReaderInput to IStream/ISequentialStream is done at /* resolving from IXmlReaderInput to IStream/ISequentialStream is done at
...@@ -671,7 +644,7 @@ static void test_reader_state(void) ...@@ -671,7 +644,7 @@ static void test_reader_state(void)
XmlNodeType nodetype; XmlNodeType nodetype;
HRESULT hr; HRESULT hr;
hr = pCreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL); hr = CreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL);
ok(hr == S_OK, "Expected S_OK, got %08x\n", hr); ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
/* invalid arguments */ /* invalid arguments */
...@@ -711,7 +684,7 @@ static void test_read_xmldeclaration(void) ...@@ -711,7 +684,7 @@ static void test_read_xmldeclaration(void)
BOOL ret; BOOL ret;
const WCHAR *val; const WCHAR *val;
hr = pCreateXmlReader(&IID_IXmlReader, (LPVOID*)&reader, NULL); hr = CreateXmlReader(&IID_IXmlReader, (LPVOID*)&reader, NULL);
ok(hr == S_OK, "Expected S_OK, got %08x\n", hr); ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
/* position methods with Null args */ /* position methods with Null args */
...@@ -932,7 +905,7 @@ static void test_read_comment(void) ...@@ -932,7 +905,7 @@ static void test_read_comment(void)
IXmlReader *reader; IXmlReader *reader;
HRESULT hr; HRESULT hr;
hr = pCreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL); hr = CreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL);
ok(hr == S_OK, "S_OK, got %08x\n", hr); ok(hr == S_OK, "S_OK, got %08x\n", hr);
while (test->xml) while (test->xml)
...@@ -1014,7 +987,7 @@ static void test_read_pi(void) ...@@ -1014,7 +987,7 @@ static void test_read_pi(void)
IXmlReader *reader; IXmlReader *reader;
HRESULT hr; HRESULT hr;
hr = pCreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL); hr = CreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL);
ok(hr == S_OK, "S_OK, got %08x\n", hr); ok(hr == S_OK, "S_OK, got %08x\n", hr);
while (test->xml) while (test->xml)
...@@ -1130,7 +1103,7 @@ static void test_read_full(void) ...@@ -1130,7 +1103,7 @@ static void test_read_full(void)
HRESULT hr; HRESULT hr;
int i; int i;
hr = pCreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL); hr = CreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL);
ok(hr == S_OK, "S_OK, got %08x\n", hr); ok(hr == S_OK, "S_OK, got %08x\n", hr);
stream = create_stream_on_data(test->xml, strlen(test->xml)+1); stream = create_stream_on_data(test->xml, strlen(test->xml)+1);
...@@ -1179,7 +1152,7 @@ static void test_read_dtd(void) ...@@ -1179,7 +1152,7 @@ static void test_read_dtd(void)
UINT len, count; UINT len, count;
HRESULT hr; HRESULT hr;
hr = pCreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL); hr = CreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL);
ok(hr == S_OK, "S_OK, got %08x\n", hr); ok(hr == S_OK, "S_OK, got %08x\n", hr);
hr = IXmlReader_SetProperty(reader, XmlReaderProperty_DtdProcessing, DtdProcessing_Parse); hr = IXmlReader_SetProperty(reader, XmlReaderProperty_DtdProcessing, DtdProcessing_Parse);
...@@ -1272,7 +1245,7 @@ static void test_read_element(void) ...@@ -1272,7 +1245,7 @@ static void test_read_element(void)
UINT depth; UINT depth;
HRESULT hr; HRESULT hr;
hr = pCreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL); hr = CreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL);
ok(hr == S_OK, "S_OK, got %08x\n", hr); ok(hr == S_OK, "S_OK, got %08x\n", hr);
while (test->xml) while (test->xml)
...@@ -1403,7 +1376,7 @@ static void test_read_pending(void) ...@@ -1403,7 +1376,7 @@ static void test_read_pending(void)
HRESULT hr; HRESULT hr;
int c; int c;
hr = pCreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL); hr = CreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL);
ok(hr == S_OK, "S_OK, got 0x%08x\n", hr); ok(hr == S_OK, "S_OK, got 0x%08x\n", hr);
hr = IXmlReader_SetInput(reader, (IUnknown*)&teststream); hr = IXmlReader_SetInput(reader, (IUnknown*)&teststream);
...@@ -1441,7 +1414,7 @@ static void test_readvaluechunk(void) ...@@ -1441,7 +1414,7 @@ static void test_readvaluechunk(void)
HRESULT hr; HRESULT hr;
UINT c; UINT c;
hr = pCreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL); hr = CreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL);
ok(hr == S_OK, "S_OK, got %08x\n", hr); ok(hr == S_OK, "S_OK, got %08x\n", hr);
stream = create_stream_on_data(testA, sizeof(testA)); stream = create_stream_on_data(testA, sizeof(testA));
...@@ -1496,7 +1469,7 @@ static void test_read_cdata(void) ...@@ -1496,7 +1469,7 @@ static void test_read_cdata(void)
IXmlReader *reader; IXmlReader *reader;
HRESULT hr; HRESULT hr;
hr = pCreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL); hr = CreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL);
ok(hr == S_OK, "S_OK, got %08x\n", hr); ok(hr == S_OK, "S_OK, got %08x\n", hr);
while (test->xml) while (test->xml)
...@@ -1589,7 +1562,7 @@ static void test_read_text(void) ...@@ -1589,7 +1562,7 @@ static void test_read_text(void)
IXmlReader *reader; IXmlReader *reader;
HRESULT hr; HRESULT hr;
hr = pCreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL); hr = CreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL);
ok(hr == S_OK, "S_OK, got %08x\n", hr); ok(hr == S_OK, "S_OK, got %08x\n", hr);
while (test->xml) while (test->xml)
...@@ -1687,7 +1660,7 @@ static void test_isemptyelement(void) ...@@ -1687,7 +1660,7 @@ static void test_isemptyelement(void)
IXmlReader *reader; IXmlReader *reader;
HRESULT hr; HRESULT hr;
hr = pCreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL); hr = CreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL);
ok(hr == S_OK, "S_OK, got %08x\n", hr); ok(hr == S_OK, "S_OK, got %08x\n", hr);
while (test->xml) while (test->xml)
...@@ -1745,7 +1718,7 @@ static void test_read_attribute(void) ...@@ -1745,7 +1718,7 @@ static void test_read_attribute(void)
IXmlReader *reader; IXmlReader *reader;
HRESULT hr; HRESULT hr;
hr = pCreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL); hr = CreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL);
ok(hr == S_OK, "S_OK, got %08x\n", hr); ok(hr == S_OK, "S_OK, got %08x\n", hr);
while (test->xml) while (test->xml)
...@@ -1814,9 +1787,6 @@ static void test_read_attribute(void) ...@@ -1814,9 +1787,6 @@ static void test_read_attribute(void)
START_TEST(reader) START_TEST(reader)
{ {
if (!init_pointers())
return;
test_reader_create(); test_reader_create();
test_readerinput(); test_readerinput();
test_reader_state(); test_reader_state();
......
...@@ -31,16 +31,6 @@ ...@@ -31,16 +31,6 @@
#include "initguid.h" #include "initguid.h"
DEFINE_GUID(IID_IXmlWriterOutput, 0xc1131708, 0x0f59, 0x477f, 0x93, 0x59, 0x7d, 0x33, 0x24, 0x51, 0xbc, 0x1a); DEFINE_GUID(IID_IXmlWriterOutput, 0xc1131708, 0x0f59, 0x477f, 0x93, 0x59, 0x7d, 0x33, 0x24, 0x51, 0xbc, 0x1a);
static HRESULT (WINAPI *pCreateXmlWriter)(REFIID riid, void **ppvObject, IMalloc *pMalloc);
static HRESULT (WINAPI *pCreateXmlWriterOutputWithEncodingName)(IUnknown *stream,
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)
{ {
if (IsEqualGUID(riid, &IID_IUnknown)) { if (IsEqualGUID(riid, &IID_IUnknown)) {
...@@ -127,11 +117,11 @@ static void test_writer_create(void) ...@@ -127,11 +117,11 @@ static void test_writer_create(void)
/* crashes native */ /* crashes native */
if (0) if (0)
{ {
pCreateXmlWriter(&IID_IXmlWriter, NULL, NULL); CreateXmlWriter(&IID_IXmlWriter, NULL, NULL);
pCreateXmlWriter(NULL, (void**)&writer, NULL); CreateXmlWriter(NULL, (void**)&writer, NULL);
} }
hr = pCreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL); hr = CreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL);
ok(hr == S_OK, "Expected S_OK, got %08x\n", hr); ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
/* check default properties values */ /* check default properties values */
...@@ -158,26 +148,6 @@ static void test_writer_create(void) ...@@ -158,26 +148,6 @@ static void test_writer_create(void)
IXmlWriter_Release(writer); IXmlWriter_Release(writer);
} }
static BOOL init_pointers(void)
{
/* don't free module here, it's to be unloaded on exit */
HMODULE mod = LoadLibraryA("xmllite.dll");
if (!mod)
{
win_skip("xmllite library not available\n");
return FALSE;
}
#define MAKEFUNC(f) if (!(p##f = (void*)GetProcAddress(mod, #f))) return FALSE;
MAKEFUNC(CreateXmlWriter);
MAKEFUNC(CreateXmlWriterOutputWithEncodingName);
MAKEFUNC(CreateXmlWriterOutputWithEncodingCodePage);
#undef MAKEFUNC
return TRUE;
}
static void test_writeroutput(void) static void test_writeroutput(void)
{ {
static const WCHAR utf16W[] = {'u','t','f','-','1','6',0}; static const WCHAR utf16W[] = {'u','t','f','-','1','6',0};
...@@ -186,11 +156,11 @@ static void test_writeroutput(void) ...@@ -186,11 +156,11 @@ static void test_writeroutput(void)
HRESULT hr; HRESULT hr;
output = NULL; output = NULL;
hr = pCreateXmlWriterOutputWithEncodingName(&testoutput, NULL, NULL, &output); hr = CreateXmlWriterOutputWithEncodingName(&testoutput, NULL, NULL, &output);
ok(hr == S_OK, "got %08x\n", hr); ok(hr == S_OK, "got %08x\n", hr);
IUnknown_Release(output); IUnknown_Release(output);
hr = pCreateXmlWriterOutputWithEncodingName(&testoutput, NULL, utf16W, &output); hr = CreateXmlWriterOutputWithEncodingName(&testoutput, NULL, utf16W, &output);
ok(hr == S_OK, "got %08x\n", hr); ok(hr == S_OK, "got %08x\n", hr);
unk = NULL; unk = NULL;
hr = IUnknown_QueryInterface(output, &IID_IXmlWriterOutput, (void**)&unk); hr = IUnknown_QueryInterface(output, &IID_IXmlWriterOutput, (void**)&unk);
...@@ -200,11 +170,11 @@ static void test_writeroutput(void) ...@@ -200,11 +170,11 @@ static void test_writeroutput(void)
IUnknown_Release(output); IUnknown_Release(output);
output = NULL; output = NULL;
hr = pCreateXmlWriterOutputWithEncodingCodePage(&testoutput, NULL, ~0u, &output); hr = CreateXmlWriterOutputWithEncodingCodePage(&testoutput, NULL, ~0u, &output);
ok(hr == S_OK, "got %08x\n", hr); ok(hr == S_OK, "got %08x\n", hr);
IUnknown_Release(output); IUnknown_Release(output);
hr = pCreateXmlWriterOutputWithEncodingCodePage(&testoutput, NULL, CP_UTF8, &output); hr = CreateXmlWriterOutputWithEncodingCodePage(&testoutput, NULL, CP_UTF8, &output);
ok(hr == S_OK, "got %08x\n", hr); ok(hr == S_OK, "got %08x\n", hr);
unk = NULL; unk = NULL;
hr = IUnknown_QueryInterface(output, &IID_IXmlWriterOutput, (void**)&unk); hr = IUnknown_QueryInterface(output, &IID_IXmlWriterOutput, (void**)&unk);
...@@ -226,7 +196,7 @@ static void test_writestartdocument(void) ...@@ -226,7 +196,7 @@ static void test_writestartdocument(void)
HRESULT hr; HRESULT hr;
char *ptr; char *ptr;
hr = pCreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL); hr = CreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL);
ok(hr == S_OK, "Expected S_OK, got %08x\n", hr); ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
/* output not set */ /* output not set */
...@@ -306,7 +276,7 @@ static void test_flush(void) ...@@ -306,7 +276,7 @@ static void test_flush(void)
IXmlWriter *writer; IXmlWriter *writer;
HRESULT hr; HRESULT hr;
hr = pCreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL); hr = CreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL);
ok(hr == S_OK, "Expected S_OK, got %08x\n", hr); ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
hr = IXmlWriter_SetOutput(writer, (IUnknown*)&teststream); hr = IXmlWriter_SetOutput(writer, (IUnknown*)&teststream);
...@@ -342,7 +312,7 @@ static void test_omitxmldeclaration(void) ...@@ -342,7 +312,7 @@ static void test_omitxmldeclaration(void)
HRESULT hr; HRESULT hr;
char *ptr; char *ptr;
hr = pCreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL); hr = CreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL);
ok(hr == S_OK, "Expected S_OK, got %08x\n", hr); ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
hr = CreateStreamOnHGlobal(NULL, TRUE, &stream); hr = CreateStreamOnHGlobal(NULL, TRUE, &stream);
...@@ -440,10 +410,10 @@ static void test_bom(void) ...@@ -440,10 +410,10 @@ static void test_bom(void)
hr = CreateStreamOnHGlobal(NULL, TRUE, &stream); hr = CreateStreamOnHGlobal(NULL, TRUE, &stream);
ok(hr == S_OK, "got 0x%08x\n", hr); ok(hr == S_OK, "got 0x%08x\n", hr);
hr = pCreateXmlWriterOutputWithEncodingName((IUnknown*)stream, NULL, utf16W, &output); hr = CreateXmlWriterOutputWithEncodingName((IUnknown*)stream, NULL, utf16W, &output);
ok(hr == S_OK, "got %08x\n", hr); ok(hr == S_OK, "got %08x\n", hr);
hr = pCreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL); hr = CreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL);
ok(hr == S_OK, "Expected S_OK, got %08x\n", hr); ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
hr = IXmlWriter_SetProperty(writer, XmlWriterProperty_OmitXmlDeclaration, TRUE); hr = IXmlWriter_SetProperty(writer, XmlWriterProperty_OmitXmlDeclaration, TRUE);
...@@ -473,7 +443,7 @@ static void test_bom(void) ...@@ -473,7 +443,7 @@ static void test_bom(void)
hr = CreateStreamOnHGlobal(NULL, TRUE, &stream); hr = CreateStreamOnHGlobal(NULL, TRUE, &stream);
ok(hr == S_OK, "got 0x%08x\n", hr); ok(hr == S_OK, "got 0x%08x\n", hr);
hr = pCreateXmlWriterOutputWithEncodingName((IUnknown*)stream, NULL, utf16W, &output); hr = CreateXmlWriterOutputWithEncodingName((IUnknown*)stream, NULL, utf16W, &output);
ok(hr == S_OK, "got %08x\n", hr); ok(hr == S_OK, "got %08x\n", hr);
hr = IXmlWriter_SetOutput(writer, output); hr = IXmlWriter_SetOutput(writer, output);
...@@ -499,7 +469,7 @@ static void test_bom(void) ...@@ -499,7 +469,7 @@ static void test_bom(void)
hr = CreateStreamOnHGlobal(NULL, TRUE, &stream); hr = CreateStreamOnHGlobal(NULL, TRUE, &stream);
ok(hr == S_OK, "got 0x%08x\n", hr); ok(hr == S_OK, "got 0x%08x\n", hr);
hr = pCreateXmlWriterOutputWithEncodingName((IUnknown*)stream, NULL, utf16W, &output); hr = CreateXmlWriterOutputWithEncodingName((IUnknown*)stream, NULL, utf16W, &output);
ok(hr == S_OK, "got %08x\n", hr); ok(hr == S_OK, "got %08x\n", hr);
hr = IXmlWriter_SetOutput(writer, output); hr = IXmlWriter_SetOutput(writer, output);
...@@ -525,7 +495,7 @@ static void test_bom(void) ...@@ -525,7 +495,7 @@ static void test_bom(void)
hr = CreateStreamOnHGlobal(NULL, TRUE, &stream); hr = CreateStreamOnHGlobal(NULL, TRUE, &stream);
ok(hr == S_OK, "got 0x%08x\n", hr); ok(hr == S_OK, "got 0x%08x\n", hr);
hr = pCreateXmlWriterOutputWithEncodingName((IUnknown*)stream, NULL, utf16W, &output); hr = CreateXmlWriterOutputWithEncodingName((IUnknown*)stream, NULL, utf16W, &output);
ok(hr == S_OK, "got %08x\n", hr); ok(hr == S_OK, "got %08x\n", hr);
hr = IXmlWriter_SetOutput(writer, output); hr = IXmlWriter_SetOutput(writer, output);
...@@ -565,7 +535,7 @@ static void test_writestartelement(void) ...@@ -565,7 +535,7 @@ static void test_writestartelement(void)
hr = CreateStreamOnHGlobal(NULL, TRUE, &stream); hr = CreateStreamOnHGlobal(NULL, TRUE, &stream);
ok(hr == S_OK, "got 0x%08x\n", hr); ok(hr == S_OK, "got 0x%08x\n", hr);
hr = pCreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL); hr = CreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL);
ok(hr == S_OK, "Expected S_OK, got %08x\n", hr); ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
hr = IXmlWriter_WriteStartElement(writer, NULL, aW, NULL); hr = IXmlWriter_WriteStartElement(writer, NULL, aW, NULL);
...@@ -612,7 +582,7 @@ static void test_writestartelement(void) ...@@ -612,7 +582,7 @@ static void test_writestartelement(void)
IXmlWriter_Release(writer); IXmlWriter_Release(writer);
/* WriteElementString */ /* WriteElementString */
hr = pCreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL); hr = CreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL);
ok(hr == S_OK, "Expected S_OK, got %08x\n", hr); ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
hr = CreateStreamOnHGlobal(NULL, TRUE, &stream); hr = CreateStreamOnHGlobal(NULL, TRUE, &stream);
...@@ -657,7 +627,7 @@ static void test_writeendelement(void) ...@@ -657,7 +627,7 @@ static void test_writeendelement(void)
hr = CreateStreamOnHGlobal(NULL, TRUE, &stream); hr = CreateStreamOnHGlobal(NULL, TRUE, &stream);
ok(hr == S_OK, "got 0x%08x\n", hr); ok(hr == S_OK, "got 0x%08x\n", hr);
hr = pCreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL); hr = CreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL);
ok(hr == S_OK, "Expected S_OK, got %08x\n", hr); ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
hr = IXmlWriter_SetOutput(writer, (IUnknown*)stream); hr = IXmlWriter_SetOutput(writer, (IUnknown*)stream);
...@@ -702,7 +672,7 @@ static void test_writeenddocument(void) ...@@ -702,7 +672,7 @@ static void test_writeenddocument(void)
hr = CreateStreamOnHGlobal(NULL, TRUE, &stream); hr = CreateStreamOnHGlobal(NULL, TRUE, &stream);
ok(hr == S_OK, "got 0x%08x\n", hr); ok(hr == S_OK, "got 0x%08x\n", hr);
hr = pCreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL); hr = CreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL);
ok(hr == S_OK, "Expected S_OK, got %08x\n", hr); ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
hr = IXmlWriter_WriteEndDocument(writer); hr = IXmlWriter_WriteEndDocument(writer);
...@@ -769,7 +739,7 @@ static void test_WriteComment(void) ...@@ -769,7 +739,7 @@ static void test_WriteComment(void)
hr = CreateStreamOnHGlobal(NULL, TRUE, &stream); hr = CreateStreamOnHGlobal(NULL, TRUE, &stream);
ok(hr == S_OK, "got 0x%08x\n", hr); ok(hr == S_OK, "got 0x%08x\n", hr);
hr = pCreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL); hr = CreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL);
ok(hr == S_OK, "Expected S_OK, got %08x\n", hr); ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
hr = IXmlWriter_SetProperty(writer, XmlWriterProperty_OmitXmlDeclaration, TRUE); hr = IXmlWriter_SetProperty(writer, XmlWriterProperty_OmitXmlDeclaration, TRUE);
...@@ -829,7 +799,7 @@ static void test_WriteCData(void) ...@@ -829,7 +799,7 @@ static void test_WriteCData(void)
hr = CreateStreamOnHGlobal(NULL, TRUE, &stream); hr = CreateStreamOnHGlobal(NULL, TRUE, &stream);
ok(hr == S_OK, "got 0x%08x\n", hr); ok(hr == S_OK, "got 0x%08x\n", hr);
hr = pCreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL); hr = CreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL);
ok(hr == S_OK, "Expected S_OK, got %08x\n", hr); ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
hr = IXmlWriter_SetProperty(writer, XmlWriterProperty_OmitXmlDeclaration, TRUE); hr = IXmlWriter_SetProperty(writer, XmlWriterProperty_OmitXmlDeclaration, TRUE);
...@@ -892,7 +862,7 @@ static void test_WriteRaw(void) ...@@ -892,7 +862,7 @@ static void test_WriteRaw(void)
hr = CreateStreamOnHGlobal(NULL, TRUE, &stream); hr = CreateStreamOnHGlobal(NULL, TRUE, &stream);
ok(hr == S_OK, "got 0x%08x\n", hr); ok(hr == S_OK, "got 0x%08x\n", hr);
hr = pCreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL); hr = CreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL);
ok(hr == S_OK, "Expected S_OK, got %08x\n", hr); ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
hr = IXmlWriter_WriteRaw(writer, NULL); hr = IXmlWriter_WriteRaw(writer, NULL);
...@@ -943,9 +913,6 @@ static void test_WriteRaw(void) ...@@ -943,9 +913,6 @@ static void test_WriteRaw(void)
START_TEST(writer) START_TEST(writer)
{ {
if (!init_pointers())
return;
test_writer_create(); test_writer_create();
test_writeroutput(); test_writeroutput();
test_writestartdocument(); test_writestartdocument();
......
...@@ -300,3 +300,5 @@ cpp_quote("STDAPI CreateXmlWriter(REFIID riid, void **ppvObject, IMalloc *pMallo ...@@ -300,3 +300,5 @@ cpp_quote("STDAPI CreateXmlWriter(REFIID riid, void **ppvObject, IMalloc *pMallo
cpp_quote("typedef IUnknown IXmlWriterOutput;") cpp_quote("typedef IUnknown IXmlWriterOutput;")
cpp_quote("STDAPI CreateXmlWriterOutputWithEncodingName(IUnknown *stream, IMalloc *pMalloc,") cpp_quote("STDAPI CreateXmlWriterOutputWithEncodingName(IUnknown *stream, IMalloc *pMalloc,")
cpp_quote(" LPCWSTR encoding, IXmlWriterOutput **output);") cpp_quote(" LPCWSTR encoding, IXmlWriterOutput **output);")
cpp_quote("STDAPI CreateXmlWriterOutputWithEncodingCodePage(IUnknown *stream, IMalloc *pMalloc,")
cpp_quote(" UINT codepage, IXmlWriterOutput **output);")
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment