mirror of
https://github.com/reactos/reactos.git
synced 2025-01-03 21:09:19 +00:00
[MSXML3_WINETEST]
* Sync with Wine 1.5.26. svn path=/trunk/; revision=58580
This commit is contained in:
parent
e8316eb4bf
commit
aaa2bdfbce
9 changed files with 2696 additions and 1614 deletions
|
@ -3,6 +3,7 @@ add_definitions(-D__ROS_LONG64__)
|
|||
|
||||
list(APPEND SOURCE
|
||||
domdoc.c
|
||||
httpreq.c
|
||||
saxreader.c
|
||||
schema.c
|
||||
testlist.c
|
||||
|
|
File diff suppressed because it is too large
Load diff
1792
rostests/winetests/msxml3/httpreq.c
Normal file
1792
rostests/winetests/msxml3/httpreq.c
Normal file
File diff suppressed because it is too large
Load diff
|
@ -20,20 +20,25 @@
|
|||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#define WIN32_NO_STATUS
|
||||
#define _INC_WINDOWS
|
||||
#define COM_NO_WINDOWS_H
|
||||
|
||||
#define COBJMACROS
|
||||
#define CONST_VTABLE
|
||||
|
||||
#include <stdio.h>
|
||||
//#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/test.h>
|
||||
//#include "windows.h"
|
||||
#include <winnls.h>
|
||||
#include <ole2.h>
|
||||
#include <msxml2.h>
|
||||
#include <msxml2did.h>
|
||||
//#include "ocidl.h"
|
||||
#include <dispex.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)
|
||||
|
@ -168,9 +173,11 @@ typedef enum _CH {
|
|||
CH_IGNORABLEWHITESPACE,
|
||||
CH_PROCESSINGINSTRUCTION,
|
||||
CH_SKIPPEDENTITY,
|
||||
LH_STARTCDATA,
|
||||
LH_ENDCDATA,
|
||||
EH_ERROR,
|
||||
EH_FATALERROR,
|
||||
EG_IGNORABLEWARNING,
|
||||
EH_IGNORABLEWARNING,
|
||||
EVENT_LAST
|
||||
} CH;
|
||||
|
||||
|
@ -187,6 +194,8 @@ static const char *event_names[EVENT_LAST] = {
|
|||
"ignorableWhitespace",
|
||||
"processingInstruction",
|
||||
"skippedEntity",
|
||||
"startCDATA",
|
||||
"endCDATA",
|
||||
"error",
|
||||
"fatalError",
|
||||
"ignorableWarning"
|
||||
|
@ -410,6 +419,8 @@ static void ok_sequence_(struct call_sequence **seq, int sequence_index,
|
|||
case CH_PUTDOCUMENTLOCATOR:
|
||||
case CH_STARTDOCUMENT:
|
||||
case CH_ENDDOCUMENT:
|
||||
case LH_STARTCDATA:
|
||||
case LH_ENDCDATA:
|
||||
break;
|
||||
case CH_STARTPREFIXMAPPING:
|
||||
/* prefix, uri */
|
||||
|
@ -459,7 +470,7 @@ static void ok_sequence_(struct call_sequence **seq, int sequence_index,
|
|||
context, get_event_name(actual->id), expected->ret, actual->ret);
|
||||
break;
|
||||
case EH_ERROR:
|
||||
case EG_IGNORABLEWARNING:
|
||||
case EH_IGNORABLEWARNING:
|
||||
default:
|
||||
ok(0, "%s: callback not handled, %s\n", context, get_event_name(actual->id));
|
||||
}
|
||||
|
@ -570,6 +581,17 @@ static const char test_attributes[] =
|
|||
"<node1 xmlns:p=\"test\" />"
|
||||
"</document>\n";
|
||||
|
||||
static const char test_cdata_xml[] =
|
||||
"<?xml version=\"1.0\" ?>"
|
||||
"<a><![CDATA[Some \r\ntext\n\r\ndata\n\n]]></a>";
|
||||
|
||||
static const char test2_cdata_xml[] =
|
||||
"<?xml version=\"1.0\" ?>"
|
||||
"<a><![CDATA[\n\r\nSome \r\ntext\n\r\ndata\n\n]]></a>";
|
||||
|
||||
static const char test3_cdata_xml[] =
|
||||
"<?xml version=\"1.0\" ?><a><![CDATA[Some text data]]></a>";
|
||||
|
||||
static struct call_entry content_handler_test1[] = {
|
||||
{ CH_PUTDOCUMENTLOCATOR, 0, 0, S_OK },
|
||||
{ CH_STARTDOCUMENT, 0, 0, S_OK },
|
||||
|
@ -894,6 +916,94 @@ static struct call_entry attribute_norm_alt[] = {
|
|||
{ CH_ENDTEST }
|
||||
};
|
||||
|
||||
static struct call_entry cdata_test[] = {
|
||||
{ CH_PUTDOCUMENTLOCATOR, 0, 0, S_OK },
|
||||
{ CH_STARTDOCUMENT, 0, 0, S_OK },
|
||||
{ CH_STARTELEMENT, 1, 26, S_OK, "", "a", "a" },
|
||||
{ LH_STARTCDATA, 1, 35, S_OK },
|
||||
{ CH_CHARACTERS, 1, 35, S_OK, "Some \n" },
|
||||
{ CH_CHARACTERS, 1, 42, S_OK, "text\n\n" },
|
||||
{ CH_CHARACTERS, 1, 49, S_OK, "data\n\n" },
|
||||
{ LH_ENDCDATA, 1, 49, S_OK },
|
||||
{ CH_ENDELEMENT, 6, 6, S_OK, "", "a", "a" },
|
||||
{ CH_ENDDOCUMENT, 0, 0, S_OK },
|
||||
{ CH_ENDTEST }
|
||||
};
|
||||
|
||||
static struct call_entry cdata_test2[] = {
|
||||
{ CH_PUTDOCUMENTLOCATOR, 0, 0, S_OK },
|
||||
{ CH_STARTDOCUMENT, 0, 0, S_OK },
|
||||
{ CH_STARTELEMENT, 1, 26, S_OK, "", "a", "a" },
|
||||
{ LH_STARTCDATA, 1, 35, S_OK },
|
||||
{ CH_CHARACTERS, 1, 35, S_OK, "\n\n" },
|
||||
{ CH_CHARACTERS, 1, 38, S_OK, "Some \n" },
|
||||
{ CH_CHARACTERS, 1, 45, S_OK, "text\n\n" },
|
||||
{ CH_CHARACTERS, 1, 52, S_OK, "data\n\n" },
|
||||
{ LH_ENDCDATA, 1, 52, S_OK },
|
||||
{ CH_ENDELEMENT, 8, 6, S_OK, "", "a", "a" },
|
||||
{ CH_ENDDOCUMENT, 0, 0, S_OK },
|
||||
{ CH_ENDTEST }
|
||||
};
|
||||
|
||||
static struct call_entry cdata_test3[] = {
|
||||
{ CH_PUTDOCUMENTLOCATOR, 0, 0, S_OK },
|
||||
{ CH_STARTDOCUMENT, 0, 0, S_OK },
|
||||
{ CH_STARTELEMENT, 1, 26, S_OK, "", "a", "a" },
|
||||
{ LH_STARTCDATA, 1, 35, S_OK },
|
||||
{ CH_CHARACTERS, 1, 35, S_OK, "Some text data" },
|
||||
{ LH_ENDCDATA, 1, 35, S_OK },
|
||||
{ CH_ENDELEMENT, 1, 54, S_OK, "", "a", "a" },
|
||||
{ CH_ENDDOCUMENT, 0, 0, S_OK },
|
||||
{ CH_ENDTEST }
|
||||
};
|
||||
|
||||
/* this is what MSXML6 does */
|
||||
static struct call_entry cdata_test_alt[] = {
|
||||
{ CH_PUTDOCUMENTLOCATOR, 1, 0, S_OK },
|
||||
{ CH_STARTDOCUMENT, 1, 22, S_OK },
|
||||
{ CH_STARTELEMENT, 1, 25, S_OK, "", "a", "a" },
|
||||
{ LH_STARTCDATA, 1, 34, S_OK },
|
||||
{ CH_CHARACTERS, 1, 40, S_OK, "Some " },
|
||||
{ CH_CHARACTERS, 2, 0, S_OK, "\n" },
|
||||
{ CH_CHARACTERS, 3, 1, S_OK, "text\n" },
|
||||
{ CH_CHARACTERS, 4, 0, S_OK, "\n" },
|
||||
{ CH_CHARACTERS, 6, 3, S_OK, "data\n\n" },
|
||||
{ LH_ENDCDATA, 6, 3, S_OK },
|
||||
{ CH_ENDELEMENT, 6, 7, S_OK, "", "a", "a" },
|
||||
{ CH_ENDDOCUMENT, 6, 7, S_OK },
|
||||
{ CH_ENDTEST }
|
||||
};
|
||||
|
||||
static struct call_entry cdata_test2_alt[] = {
|
||||
{ CH_PUTDOCUMENTLOCATOR, 1, 0, S_OK },
|
||||
{ CH_STARTDOCUMENT, 1, 22, S_OK },
|
||||
{ CH_STARTELEMENT, 1, 25, S_OK, "", "a", "a" },
|
||||
{ LH_STARTCDATA, 1, 34, S_OK },
|
||||
{ CH_CHARACTERS, 2, 1, S_OK, "\n" },
|
||||
{ CH_CHARACTERS, 3, 0, S_OK, "\n" },
|
||||
{ CH_CHARACTERS, 3, 6, S_OK, "Some " },
|
||||
{ CH_CHARACTERS, 4, 0, S_OK, "\n" },
|
||||
{ CH_CHARACTERS, 5, 1, S_OK, "text\n" },
|
||||
{ CH_CHARACTERS, 6, 0, S_OK, "\n" },
|
||||
{ CH_CHARACTERS, 8, 3, S_OK, "data\n\n" },
|
||||
{ LH_ENDCDATA, 8, 3, S_OK },
|
||||
{ CH_ENDELEMENT, 8, 7, S_OK, "", "a", "a" },
|
||||
{ CH_ENDDOCUMENT, 8, 7, S_OK },
|
||||
{ CH_ENDTEST }
|
||||
};
|
||||
|
||||
static struct call_entry cdata_test3_alt[] = {
|
||||
{ CH_PUTDOCUMENTLOCATOR, 1, 0, S_OK },
|
||||
{ CH_STARTDOCUMENT, 1, 22, S_OK },
|
||||
{ CH_STARTELEMENT, 1, 25, S_OK, "", "a", "a" },
|
||||
{ LH_STARTCDATA, 1, 34, S_OK },
|
||||
{ CH_CHARACTERS, 1, 51, S_OK, "Some text data" },
|
||||
{ LH_ENDCDATA, 1, 51, S_OK },
|
||||
{ CH_ENDELEMENT, 1, 55, S_OK, "", "a", "a" },
|
||||
{ CH_ENDDOCUMENT, 1, 55, S_OK },
|
||||
{ CH_ENDTEST }
|
||||
};
|
||||
|
||||
static const char xmlspace_attr[] =
|
||||
"<?xml version=\"1.0\" encoding=\"UTF-16\"?>"
|
||||
"<a xml:space=\"preserve\"> Some text data </a>";
|
||||
|
@ -1191,6 +1301,7 @@ static HRESULT WINAPI contentHandler_skippedEntity(
|
|||
init_call_entry(locator, &call);
|
||||
call.id = CH_SKIPPEDENTITY;
|
||||
call.arg1W = SysAllocStringLen(name, len);
|
||||
add_call(sequences, CONTENT_HANDLER_INDEX, &call);
|
||||
|
||||
return get_expected_ret();
|
||||
}
|
||||
|
@ -1274,7 +1385,7 @@ static HRESULT WINAPI isaxerrorHandler_fatalError(
|
|||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI isaxerrorHanddler_ignorableWarning(
|
||||
static HRESULT WINAPI isaxerrorHandler_ignorableWarning(
|
||||
ISAXErrorHandler* iface,
|
||||
ISAXLocator *pLocator,
|
||||
const WCHAR *pErrorMessage,
|
||||
|
@ -1291,7 +1402,7 @@ static const ISAXErrorHandlerVtbl errorHandlerVtbl =
|
|||
isaxerrorHandler_Release,
|
||||
isaxerrorHandler_error,
|
||||
isaxerrorHandler_fatalError,
|
||||
isaxerrorHanddler_ignorableWarning
|
||||
isaxerrorHandler_ignorableWarning
|
||||
};
|
||||
|
||||
static ISAXErrorHandler errorHandler = { &errorHandlerVtbl };
|
||||
|
@ -1582,14 +1693,24 @@ static HRESULT WINAPI isaxlexical_endEntity(ISAXLexicalHandler *iface,
|
|||
|
||||
static HRESULT WINAPI isaxlexical_startCDATA(ISAXLexicalHandler *iface)
|
||||
{
|
||||
ok(0, "call not expected\n");
|
||||
return E_NOTIMPL;
|
||||
struct call_entry call;
|
||||
|
||||
init_call_entry(locator, &call);
|
||||
call.id = LH_STARTCDATA;
|
||||
add_call(sequences, CONTENT_HANDLER_INDEX, &call);
|
||||
|
||||
return get_expected_ret();
|
||||
}
|
||||
|
||||
static HRESULT WINAPI isaxlexical_endCDATA(ISAXLexicalHandler *iface)
|
||||
{
|
||||
ok(0, "call not expected\n");
|
||||
return E_NOTIMPL;
|
||||
struct call_entry call;
|
||||
|
||||
init_call_entry(locator, &call);
|
||||
call.id = LH_ENDCDATA;
|
||||
add_call(sequences, CONTENT_HANDLER_INDEX, &call);
|
||||
|
||||
return get_expected_ret();
|
||||
}
|
||||
|
||||
static HRESULT WINAPI isaxlexical_comment(ISAXLexicalHandler *iface,
|
||||
|
@ -1879,6 +2000,27 @@ static struct msxmlsupported_data_t reader_support_data[] =
|
|||
{ NULL }
|
||||
};
|
||||
|
||||
static struct saxlexicalhandler lexicalhandler;
|
||||
static struct saxdeclhandler declhandler;
|
||||
|
||||
static IStream *create_test_stream(const char *data, int len)
|
||||
{
|
||||
ULARGE_INTEGER size;
|
||||
LARGE_INTEGER pos;
|
||||
IStream *stream;
|
||||
ULONG written;
|
||||
|
||||
if (len == -1) len = strlen(data);
|
||||
CreateStreamOnHGlobal(NULL, TRUE, &stream);
|
||||
size.QuadPart = len;
|
||||
IStream_SetSize(stream, size);
|
||||
IStream_Write(stream, data, len, &written);
|
||||
pos.QuadPart = 0;
|
||||
IStream_Seek(stream, pos, STREAM_SEEK_SET, NULL);
|
||||
|
||||
return stream;
|
||||
}
|
||||
|
||||
static void test_saxreader(void)
|
||||
{
|
||||
const struct msxmlsupported_data_t *table = reader_support_data;
|
||||
|
@ -1891,8 +2033,6 @@ static void test_saxreader(void)
|
|||
SAFEARRAYBOUND SADim[1];
|
||||
char *ptr = NULL;
|
||||
IStream *stream;
|
||||
ULARGE_INTEGER size;
|
||||
LARGE_INTEGER pos;
|
||||
ULONG written;
|
||||
HANDLE file;
|
||||
static const CHAR testXmlA[] = "test.xml";
|
||||
|
@ -1903,6 +2043,7 @@ static void test_saxreader(void)
|
|||
while (table->clsid)
|
||||
{
|
||||
struct call_entry *test_seq;
|
||||
ISAXEntityResolver *resolver;
|
||||
BSTR str;
|
||||
|
||||
if (!is_clsid_supported(table->clsid, reader_support_data))
|
||||
|
@ -1985,12 +2126,7 @@ static void test_saxreader(void)
|
|||
|
||||
SafeArrayDestroy(sa);
|
||||
|
||||
CreateStreamOnHGlobal(NULL, TRUE, &stream);
|
||||
size.QuadPart = strlen(testXML);
|
||||
IStream_SetSize(stream, size);
|
||||
IStream_Write(stream, testXML, strlen(testXML), &written);
|
||||
pos.QuadPart = 0;
|
||||
IStream_Seek(stream, pos, STREAM_SEEK_SET, NULL);
|
||||
stream = create_test_stream(testXML, -1);
|
||||
V_VT(&var) = VT_UNKNOWN;
|
||||
V_UNKNOWN(&var) = (IUnknown*)stream;
|
||||
|
||||
|
@ -2001,12 +2137,7 @@ static void test_saxreader(void)
|
|||
|
||||
IStream_Release(stream);
|
||||
|
||||
CreateStreamOnHGlobal(NULL, TRUE, &stream);
|
||||
size.QuadPart = strlen(test_attributes);
|
||||
IStream_SetSize(stream, size);
|
||||
IStream_Write(stream, test_attributes, strlen(test_attributes), &written);
|
||||
pos.QuadPart = 0;
|
||||
IStream_Seek(stream, pos, STREAM_SEEK_SET, NULL);
|
||||
stream = create_test_stream(test_attributes, -1);
|
||||
V_VT(&var) = VT_UNKNOWN;
|
||||
V_UNKNOWN(&var) = (IUnknown*)stream;
|
||||
|
||||
|
@ -2144,12 +2275,7 @@ static void test_saxreader(void)
|
|||
hr = ISAXXMLReader_putFeature(reader, _bstr_("http://xml.org/sax/features/namespaces"), VARIANT_FALSE);
|
||||
EXPECT_HR(hr, S_OK);
|
||||
|
||||
CreateStreamOnHGlobal(NULL, TRUE, &stream);
|
||||
size.QuadPart = strlen(test_attributes);
|
||||
IStream_SetSize(stream, size);
|
||||
IStream_Write(stream, test_attributes, strlen(test_attributes), &written);
|
||||
pos.QuadPart = 0;
|
||||
IStream_Seek(stream, pos, STREAM_SEEK_SET, NULL);
|
||||
stream = create_test_stream(test_attributes, -1);
|
||||
V_VT(&var) = VT_UNKNOWN;
|
||||
V_UNKNOWN(&var) = (IUnknown*)stream;
|
||||
|
||||
|
@ -2172,12 +2298,7 @@ static void test_saxreader(void)
|
|||
hr = ISAXXMLReader_putFeature(reader, _bstr_("http://xml.org/sax/features/namespace-prefixes"), VARIANT_FALSE);
|
||||
EXPECT_HR(hr, S_OK);
|
||||
|
||||
CreateStreamOnHGlobal(NULL, TRUE, &stream);
|
||||
size.QuadPart = strlen(test_attributes);
|
||||
IStream_SetSize(stream, size);
|
||||
IStream_Write(stream, test_attributes, strlen(test_attributes), &written);
|
||||
pos.QuadPart = 0;
|
||||
IStream_Seek(stream, pos, STREAM_SEEK_SET, NULL);
|
||||
stream = create_test_stream(test_attributes, -1);
|
||||
V_VT(&var) = VT_UNKNOWN;
|
||||
V_UNKNOWN(&var) = (IUnknown*)stream;
|
||||
|
||||
|
@ -2198,12 +2319,7 @@ static void test_saxreader(void)
|
|||
EXPECT_HR(hr, S_OK);
|
||||
|
||||
/* attribute normalization */
|
||||
CreateStreamOnHGlobal(NULL, TRUE, &stream);
|
||||
size.QuadPart = strlen(attribute_normalize);
|
||||
IStream_SetSize(stream, size);
|
||||
IStream_Write(stream, attribute_normalize, strlen(attribute_normalize), &written);
|
||||
pos.QuadPart = 0;
|
||||
IStream_Seek(stream, pos, STREAM_SEEK_SET, NULL);
|
||||
stream = create_test_stream(attribute_normalize, -1);
|
||||
V_VT(&var) = VT_UNKNOWN;
|
||||
V_UNKNOWN(&var) = (IUnknown*)stream;
|
||||
|
||||
|
@ -2220,6 +2336,70 @@ static void test_saxreader(void)
|
|||
EXPECT_HR(hr, S_OK);
|
||||
ok_sequence(sequences, CONTENT_HANDLER_INDEX, test_seq, "attribute value normalization", TRUE);
|
||||
|
||||
resolver = (void*)0xdeadbeef;
|
||||
hr = ISAXXMLReader_getEntityResolver(reader, &resolver);
|
||||
ok(hr == S_OK, "got 0x%08x\n", hr);
|
||||
ok(resolver == NULL, "got %p\n", resolver);
|
||||
|
||||
hr = ISAXXMLReader_putEntityResolver(reader, NULL);
|
||||
ok(hr == S_OK || broken(hr == E_FAIL), "got 0x%08x\n", hr);
|
||||
|
||||
/* CDATA sections */
|
||||
init_saxlexicalhandler(&lexicalhandler, S_OK);
|
||||
|
||||
V_VT(&var) = VT_UNKNOWN;
|
||||
V_UNKNOWN(&var) = (IUnknown*)&lexicalhandler.ISAXLexicalHandler_iface;
|
||||
hr = ISAXXMLReader_putProperty(reader, _bstr_("http://xml.org/sax/properties/lexical-handler"), var);
|
||||
ok(hr == S_OK, "got 0x%08x\n", hr);
|
||||
|
||||
stream = create_test_stream(test_cdata_xml, -1);
|
||||
V_VT(&var) = VT_UNKNOWN;
|
||||
V_UNKNOWN(&var) = (IUnknown*)stream;
|
||||
|
||||
if (IsEqualGUID(table->clsid, &CLSID_SAXXMLReader60))
|
||||
test_seq = cdata_test_alt;
|
||||
else
|
||||
test_seq = cdata_test;
|
||||
|
||||
set_expected_seq(test_seq);
|
||||
hr = ISAXXMLReader_parse(reader, var);
|
||||
ok(hr == S_OK, "got 0x%08x\n", hr);
|
||||
ok_sequence(sequences, CONTENT_HANDLER_INDEX, test_seq, "cdata test", TRUE);
|
||||
|
||||
/* 2. CDATA sections */
|
||||
stream = create_test_stream(test2_cdata_xml, -1);
|
||||
V_VT(&var) = VT_UNKNOWN;
|
||||
V_UNKNOWN(&var) = (IUnknown*)stream;
|
||||
|
||||
if (IsEqualGUID(table->clsid, &CLSID_SAXXMLReader60))
|
||||
test_seq = cdata_test2_alt;
|
||||
else
|
||||
test_seq = cdata_test2;
|
||||
|
||||
set_expected_seq(test_seq);
|
||||
hr = ISAXXMLReader_parse(reader, var);
|
||||
ok(hr == S_OK, "got 0x%08x\n", hr);
|
||||
ok_sequence(sequences, CONTENT_HANDLER_INDEX, test_seq, "cdata test 2", TRUE);
|
||||
|
||||
IStream_Release(stream);
|
||||
|
||||
/* 3. CDATA sections */
|
||||
stream = create_test_stream(test3_cdata_xml, -1);
|
||||
V_VT(&var) = VT_UNKNOWN;
|
||||
V_UNKNOWN(&var) = (IUnknown*)stream;
|
||||
|
||||
if (IsEqualGUID(table->clsid, &CLSID_SAXXMLReader60))
|
||||
test_seq = cdata_test3_alt;
|
||||
else
|
||||
test_seq = cdata_test3;
|
||||
|
||||
set_expected_seq(test_seq);
|
||||
hr = ISAXXMLReader_parse(reader, var);
|
||||
ok(hr == S_OK, "got 0x%08x\n", hr);
|
||||
ok_sequence(sequences, CONTENT_HANDLER_INDEX, test_seq, "cdata test 3", TRUE);
|
||||
|
||||
IStream_Release(stream);
|
||||
|
||||
ISAXXMLReader_Release(reader);
|
||||
table++;
|
||||
}
|
||||
|
@ -2233,9 +2413,6 @@ struct saxreader_props_test_t
|
|||
IUnknown *iface;
|
||||
};
|
||||
|
||||
static struct saxlexicalhandler lexicalhandler;
|
||||
static struct saxdeclhandler declhandler;
|
||||
|
||||
static const struct saxreader_props_test_t props_test_data[] = {
|
||||
{ "http://xml.org/sax/properties/lexical-handler", (IUnknown*)&lexicalhandler.ISAXLexicalHandler_iface },
|
||||
{ "http://xml.org/sax/properties/declaration-handler", (IUnknown*)&declhandler.ISAXDeclHandler_iface },
|
||||
|
|
|
@ -19,18 +19,26 @@
|
|||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#define WIN32_NO_STATUS
|
||||
#define _INC_WINDOWS
|
||||
#define COM_NO_WINDOWS_H
|
||||
|
||||
//#include <stdio.h>
|
||||
#include <assert.h>
|
||||
#define COBJMACROS
|
||||
|
||||
#include "initguid.h"
|
||||
#include "windows.h"
|
||||
#include "ole2.h"
|
||||
#include "msxml2.h"
|
||||
#include "msxml2did.h"
|
||||
#include "dispex.h"
|
||||
#include <wine/test.h>
|
||||
|
||||
#include "wine/test.h"
|
||||
#include <initguid.h>
|
||||
//#include "windows.h"
|
||||
#include <winnls.h>
|
||||
#include <ole2.h>
|
||||
#include <msxml2.h>
|
||||
#include <msxml2did.h>
|
||||
#include <dispex.h>
|
||||
|
||||
|
||||
DEFINE_GUID(GUID_NULL,0,0,0,0,0,0,0,0,0,0,0);
|
||||
|
||||
#define EXPECT_HR(hr,hr_exp) \
|
||||
ok(hr == hr_exp, "got 0x%08x, expected 0x%08x\n", hr, hr_exp)
|
||||
|
@ -1463,8 +1471,11 @@ static void test_obj_dispex(IUnknown *obj)
|
|||
static void test_dispex(void)
|
||||
{
|
||||
IXMLDOMSchemaCollection *cache;
|
||||
IDispatchEx *dispex;
|
||||
IUnknown *unk;
|
||||
HRESULT hr;
|
||||
DISPPARAMS dispparams;
|
||||
VARIANT arg, ret;
|
||||
|
||||
cache = create_cache(&IID_IXMLDOMSchemaCollection);
|
||||
if (!cache) return;
|
||||
|
@ -1474,6 +1485,25 @@ static void test_dispex(void)
|
|||
test_obj_dispex(unk);
|
||||
IUnknown_Release(unk);
|
||||
|
||||
hr = IXMLDOMSchemaCollection_QueryInterface(cache, &IID_IDispatchEx, (void**)&dispex);
|
||||
ok(hr == S_OK, "got 0x%08x\n", hr);
|
||||
|
||||
V_VT(&arg) = VT_I4;
|
||||
V_I4(&arg) = 0;
|
||||
dispparams.cArgs = 1;
|
||||
dispparams.cNamedArgs = 0;
|
||||
dispparams.rgdispidNamedArgs = NULL;
|
||||
dispparams.rgvarg = &arg;
|
||||
|
||||
V_VT(&ret) = VT_EMPTY;
|
||||
V_DISPATCH(&ret) = (void*)0x1;
|
||||
hr = IDispatchEx_Invoke(dispex, DISPID_VALUE, &IID_NULL, 0, DISPATCH_METHOD, &dispparams, &ret, NULL, NULL);
|
||||
ok(hr == DISP_E_MEMBERNOTFOUND, "got 0x%08x\n", hr);
|
||||
ok(V_VT(&ret) == VT_EMPTY, "got %d\n", V_VT(&ret));
|
||||
ok(V_DISPATCH(&ret) == (void*)0x1, "got %p\n", V_DISPATCH(&ret));
|
||||
|
||||
IDispatchEx_Release(dispex);
|
||||
|
||||
IXMLDOMSchemaCollection_Release(cache);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,12 +1,10 @@
|
|||
/* Automatically generated file; DO NOT EDIT!! */
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
|
||||
#define STANDALONE
|
||||
#include "wine/test.h"
|
||||
#include <wine/test.h>
|
||||
|
||||
extern void func_domdoc(void);
|
||||
extern void func_httpreq(void);
|
||||
extern void func_saxreader(void);
|
||||
extern void func_schema(void);
|
||||
extern void func_xmldoc(void);
|
||||
|
@ -16,6 +14,7 @@ extern void func_xmlview(void);
|
|||
const struct test winetest_testlist[] =
|
||||
{
|
||||
{ "domdoc", func_domdoc },
|
||||
{ "httpreq", func_httpreq },
|
||||
{ "saxreader", func_saxreader },
|
||||
{ "schema", func_schema },
|
||||
{ "xmldoc", func_xmldoc },
|
||||
|
|
|
@ -18,16 +18,21 @@
|
|||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#define WIN32_NO_STATUS
|
||||
#define _INC_WINDOWS
|
||||
#define COM_NO_WINDOWS_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>
|
||||
|
||||
#include "wine/test.h"
|
||||
//#include <stdio.h>
|
||||
//#include "windows.h"
|
||||
#include <winnls.h>
|
||||
#include <ole2.h>
|
||||
#include <msxml2.h>
|
||||
#include <msxml2did.h>
|
||||
#include <ocidl.h>
|
||||
|
||||
#define EXPECT_HR(hr,hr_exp) \
|
||||
ok(hr == hr_exp, "got 0x%08x, expected 0x%08x\n", hr, hr_exp)
|
||||
|
|
|
@ -17,21 +17,97 @@
|
|||
* 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 WIN32_NO_STATUS
|
||||
#define _INC_WINDOWS
|
||||
#define COM_NO_WINDOWS_H
|
||||
|
||||
#define COBJMACROS
|
||||
#define CONST_VTABLE
|
||||
|
||||
#include <stdio.h>
|
||||
#include <assert.h>
|
||||
//#include <stdio.h>
|
||||
//#include <assert.h>
|
||||
|
||||
#include "windows.h"
|
||||
#include "ole2.h"
|
||||
#include "xmlparser.h"
|
||||
#include "wine/test.h"
|
||||
#include <wine/test.h>
|
||||
|
||||
//#include "windows.h"
|
||||
#include <ole2.h>
|
||||
#include <xmlparser.h>
|
||||
|
||||
static HRESULT WINAPI nodefact_QueryInterface(IXMLNodeFactory *iface,
|
||||
REFIID riid, void **ppvObject)
|
||||
{
|
||||
*ppvObject = NULL;
|
||||
|
||||
if (IsEqualGUID(riid, &IID_IXMLNodeFactory) ||
|
||||
IsEqualGUID(riid, &IID_IUnknown))
|
||||
*ppvObject = iface;
|
||||
else
|
||||
return E_NOINTERFACE;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static ULONG WINAPI nodefact_AddRef(IXMLNodeFactory *iface)
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
|
||||
static ULONG WINAPI nodefact_Release(IXMLNodeFactory *iface)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI nodefact_NotifyEvent(IXMLNodeFactory *iface,
|
||||
IXMLNodeSource *pSource, XML_NODEFACTORY_EVENT iEvt)
|
||||
{
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI nodefact_BeginChildren(IXMLNodeFactory *iface,
|
||||
IXMLNodeSource *pSource, XML_NODE_INFO *pNodeInfo)
|
||||
{
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI nodefact_EndChildren(IXMLNodeFactory *iface,
|
||||
IXMLNodeSource *pSource, BOOL fEmpty, XML_NODE_INFO *pNodeInfo)
|
||||
{
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI nodefact_Error(IXMLNodeFactory *iface,
|
||||
IXMLNodeSource *pSource, HRESULT hrErrorCode, USHORT cNumRecs,
|
||||
XML_NODE_INFO **ppNodeInfo)
|
||||
{
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI nodefact_CreateNode(IXMLNodeFactory *iface, IXMLNodeSource *pSource,
|
||||
PVOID pNodeParent, USHORT cNumRecs, XML_NODE_INFO **ppNodeInfo)
|
||||
{
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static const IXMLNodeFactoryVtbl nodefactoryVtbl =
|
||||
{
|
||||
nodefact_QueryInterface,
|
||||
nodefact_AddRef,
|
||||
nodefact_Release,
|
||||
nodefact_NotifyEvent,
|
||||
nodefact_BeginChildren,
|
||||
nodefact_EndChildren,
|
||||
nodefact_Error,
|
||||
nodefact_CreateNode
|
||||
};
|
||||
|
||||
static IXMLNodeFactory thenodefactory = { &nodefactoryVtbl };
|
||||
|
||||
static void create_test(void)
|
||||
{
|
||||
HRESULT hr;
|
||||
IXMLParser *parser;
|
||||
IXMLNodeFactory *nodefactory;
|
||||
DWORD flags;
|
||||
|
||||
hr = CoCreateInstance(&CLSID_XMLParser30, NULL, CLSCTX_INPROC_SERVER, &IID_IXMLParser, (void**)&parser);
|
||||
|
@ -50,6 +126,26 @@ static void create_test(void)
|
|||
flags = IXMLParser_GetFlags(parser);
|
||||
ok(flags == XMLFLAG_SAX, "Expected 0 got %d\n", flags);
|
||||
|
||||
hr = IXMLParser_GetFactory(parser, NULL);
|
||||
ok(hr == E_INVALIDARG, "Expected S_OK got 0x%08x\n", hr);
|
||||
|
||||
hr = IXMLParser_GetFactory(parser, &nodefactory);
|
||||
ok(hr == S_OK, "Expected S_OK got 0x%08x\n", hr);
|
||||
ok(nodefactory == NULL, "expected NULL\n");
|
||||
|
||||
hr = IXMLParser_SetFactory(parser, &thenodefactory);
|
||||
ok(hr == S_OK, "Expected S_OK got 0x%08x\n", hr);
|
||||
|
||||
hr = IXMLParser_GetFactory(parser, &nodefactory);
|
||||
ok(hr == S_OK, "Expected S_OK got 0x%08x\n", hr);
|
||||
ok(nodefactory == &thenodefactory, "expected NULL\n");
|
||||
|
||||
hr = IXMLParser_SetInput(parser, NULL);
|
||||
ok(hr == E_INVALIDARG, "Expected S_OK got 0x%08x\n", hr);
|
||||
|
||||
hr = IXMLParser_SetFactory(parser, NULL);
|
||||
ok(hr == S_OK, "Expected S_OK got 0x%08x\n", hr);
|
||||
|
||||
hr = IXMLParser_SetFlags(parser, 0);
|
||||
ok(hr == S_OK, "Expected S_OK got 0x%08x\n", hr);
|
||||
|
||||
|
|
|
@ -15,23 +15,30 @@
|
|||
* 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 WIN32_NO_STATUS
|
||||
#define _INC_WINDOWS
|
||||
#define COM_NO_WINDOWS_H
|
||||
|
||||
#define COBJMACROS
|
||||
#define CONST_VTABLE
|
||||
|
||||
#include <stdio.h>
|
||||
#include <assert.h>
|
||||
//#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>
|
||||
|
||||
#include "wine/test.h"
|
||||
//#include "windows.h"
|
||||
#include <winnls.h>
|
||||
#include <wingdi.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>
|
||||
|
||||
HRESULT (WINAPI *pCreateURLMoniker)(IMoniker*, LPCWSTR, IMoniker**);
|
||||
|
||||
|
@ -123,9 +130,11 @@ static HRESULT WINAPI HTMLEvents_Invoke(IDispatch *iface, DISPID dispIdMember, R
|
|||
{
|
||||
if(dispIdMember == DISPID_HTMLDOCUMENTEVENTS2_ONREADYSTATECHANGE) {
|
||||
static const WCHAR completeW[] = {'c','o','m','p','l','e','t','e',0};
|
||||
HRESULT hr;
|
||||
BSTR state;
|
||||
|
||||
IHTMLDocument2_get_readyState(html_doc, &state);
|
||||
hr = IHTMLDocument2_get_readyState(html_doc, &state);
|
||||
ok(hr == S_OK, "got 0x%08x\n", hr);
|
||||
if(!memcmp(state, completeW, sizeof(completeW)))
|
||||
loaded = TRUE;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue