mirror of
https://github.com/reactos/reactos.git
synced 2025-06-05 01:10:26 +00:00
[MSXML3_WINETEST] Sync with Wine Staging 4.18. CORE-16441
This commit is contained in:
parent
eb44c20c47
commit
753e05959c
2 changed files with 95 additions and 3 deletions
|
@ -1162,6 +1162,9 @@ static HRESULT WINAPI contentHandler_startPrefixMapping(
|
||||||
{
|
{
|
||||||
struct call_entry call;
|
struct call_entry call;
|
||||||
|
|
||||||
|
ok(prefix != NULL, "prefix == NULL\n");
|
||||||
|
ok(uri != NULL, "uri == NULL\n");
|
||||||
|
|
||||||
init_call_entry(locator, &call);
|
init_call_entry(locator, &call);
|
||||||
call.id = CH_STARTPREFIXMAPPING;
|
call.id = CH_STARTPREFIXMAPPING;
|
||||||
call.arg1W = SysAllocStringLen(prefix, prefix_len);
|
call.arg1W = SysAllocStringLen(prefix, prefix_len);
|
||||||
|
@ -1177,6 +1180,8 @@ static HRESULT WINAPI contentHandler_endPrefixMapping(
|
||||||
{
|
{
|
||||||
struct call_entry call;
|
struct call_entry call;
|
||||||
|
|
||||||
|
ok(prefix != NULL, "prefix == NULL\n");
|
||||||
|
|
||||||
init_call_entry(locator, &call);
|
init_call_entry(locator, &call);
|
||||||
call.id = CH_ENDPREFIXMAPPING;
|
call.id = CH_ENDPREFIXMAPPING;
|
||||||
call.arg1W = SysAllocStringLen(prefix, len);
|
call.arg1W = SysAllocStringLen(prefix, len);
|
||||||
|
@ -1197,6 +1202,10 @@ static HRESULT WINAPI contentHandler_startElement(
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
int len;
|
int len;
|
||||||
|
|
||||||
|
ok(uri != NULL, "uri == NULL\n");
|
||||||
|
ok(localname != NULL, "localname == NULL\n");
|
||||||
|
ok(qname != NULL, "qname == NULL\n");
|
||||||
|
|
||||||
hr = ISAXAttributes_QueryInterface(saxattr, &IID_IMXAttributes, (void**)&mxattr);
|
hr = ISAXAttributes_QueryInterface(saxattr, &IID_IMXAttributes, (void**)&mxattr);
|
||||||
EXPECT_HR(hr, E_NOINTERFACE);
|
EXPECT_HR(hr, E_NOINTERFACE);
|
||||||
|
|
||||||
|
@ -1272,6 +1281,10 @@ static HRESULT WINAPI contentHandler_endElement(
|
||||||
{
|
{
|
||||||
struct call_entry call;
|
struct call_entry call;
|
||||||
|
|
||||||
|
ok(uri != NULL, "uri == NULL\n");
|
||||||
|
ok(localname != NULL, "localname == NULL\n");
|
||||||
|
ok(qname != NULL, "qname == NULL\n");
|
||||||
|
|
||||||
init_call_entry(locator, &call);
|
init_call_entry(locator, &call);
|
||||||
call.id = CH_ENDELEMENT;
|
call.id = CH_ENDELEMENT;
|
||||||
call.arg1W = SysAllocStringLen(uri, uri_len);
|
call.arg1W = SysAllocStringLen(uri, uri_len);
|
||||||
|
@ -1289,6 +1302,8 @@ static HRESULT WINAPI contentHandler_characters(
|
||||||
{
|
{
|
||||||
struct call_entry call;
|
struct call_entry call;
|
||||||
|
|
||||||
|
ok(chars != NULL, "chars == NULL\n");
|
||||||
|
|
||||||
init_call_entry(locator, &call);
|
init_call_entry(locator, &call);
|
||||||
call.id = CH_CHARACTERS;
|
call.id = CH_CHARACTERS;
|
||||||
call.arg1W = SysAllocStringLen(chars, len);
|
call.arg1W = SysAllocStringLen(chars, len);
|
||||||
|
@ -1303,6 +1318,8 @@ static HRESULT WINAPI contentHandler_ignorableWhitespace(
|
||||||
{
|
{
|
||||||
struct call_entry call;
|
struct call_entry call;
|
||||||
|
|
||||||
|
ok(chars != NULL, "chars == NULL\n");
|
||||||
|
|
||||||
init_call_entry(locator, &call);
|
init_call_entry(locator, &call);
|
||||||
call.id = CH_IGNORABLEWHITESPACE;
|
call.id = CH_IGNORABLEWHITESPACE;
|
||||||
call.arg1W = SysAllocStringLen(chars, len);
|
call.arg1W = SysAllocStringLen(chars, len);
|
||||||
|
@ -1318,6 +1335,9 @@ static HRESULT WINAPI contentHandler_processingInstruction(
|
||||||
{
|
{
|
||||||
struct call_entry call;
|
struct call_entry call;
|
||||||
|
|
||||||
|
ok(target != NULL, "target == NULL\n");
|
||||||
|
ok(data != NULL, "data == NULL\n");
|
||||||
|
|
||||||
init_call_entry(locator, &call);
|
init_call_entry(locator, &call);
|
||||||
call.id = CH_PROCESSINGINSTRUCTION;
|
call.id = CH_PROCESSINGINSTRUCTION;
|
||||||
call.arg1W = SysAllocStringLen(target, target_len);
|
call.arg1W = SysAllocStringLen(target, target_len);
|
||||||
|
@ -1333,6 +1353,8 @@ static HRESULT WINAPI contentHandler_skippedEntity(
|
||||||
{
|
{
|
||||||
struct call_entry call;
|
struct call_entry call;
|
||||||
|
|
||||||
|
ok(name != NULL, "name == NULL\n");
|
||||||
|
|
||||||
init_call_entry(locator, &call);
|
init_call_entry(locator, &call);
|
||||||
call.id = CH_SKIPPEDENTITY;
|
call.id = CH_SKIPPEDENTITY;
|
||||||
call.arg1W = SysAllocStringLen(name, len);
|
call.arg1W = SysAllocStringLen(name, len);
|
||||||
|
@ -3950,10 +3972,13 @@ static const struct writer_characters_t writer_characters[] = {
|
||||||
static void test_mxwriter_characters(void)
|
static void test_mxwriter_characters(void)
|
||||||
{
|
{
|
||||||
static const WCHAR chardataW[] = {'T','E','S','T','C','H','A','R','D','A','T','A',' ','.',0};
|
static const WCHAR chardataW[] = {'T','E','S','T','C','H','A','R','D','A','T','A',' ','.',0};
|
||||||
|
static const WCHAR embedded_nullbytes[] = {'a',0,'b',0,0,0,'c',0};
|
||||||
const struct writer_characters_t *table = writer_characters;
|
const struct writer_characters_t *table = writer_characters;
|
||||||
|
IVBSAXContentHandler *vb_content;
|
||||||
ISAXContentHandler *content;
|
ISAXContentHandler *content;
|
||||||
IMXWriter *writer;
|
IMXWriter *writer;
|
||||||
VARIANT dest;
|
VARIANT dest;
|
||||||
|
BSTR str;
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
||||||
|
@ -3964,6 +3989,9 @@ static void test_mxwriter_characters(void)
|
||||||
hr = IMXWriter_QueryInterface(writer, &IID_ISAXContentHandler, (void**)&content);
|
hr = IMXWriter_QueryInterface(writer, &IID_ISAXContentHandler, (void**)&content);
|
||||||
EXPECT_HR(hr, S_OK);
|
EXPECT_HR(hr, S_OK);
|
||||||
|
|
||||||
|
hr = IMXWriter_QueryInterface(writer, &IID_IVBSAXContentHandler, (void**)&vb_content);
|
||||||
|
EXPECT_HR(hr, S_OK);
|
||||||
|
|
||||||
hr = IMXWriter_put_omitXMLDeclaration(writer, VARIANT_TRUE);
|
hr = IMXWriter_put_omitXMLDeclaration(writer, VARIANT_TRUE);
|
||||||
EXPECT_HR(hr, S_OK);
|
EXPECT_HR(hr, S_OK);
|
||||||
|
|
||||||
|
@ -3976,6 +4004,10 @@ static void test_mxwriter_characters(void)
|
||||||
hr = ISAXContentHandler_characters(content, chardataW, 0);
|
hr = ISAXContentHandler_characters(content, chardataW, 0);
|
||||||
EXPECT_HR(hr, S_OK);
|
EXPECT_HR(hr, S_OK);
|
||||||
|
|
||||||
|
str = _bstr_("VbChars");
|
||||||
|
hr = IVBSAXContentHandler_characters(vb_content, &str);
|
||||||
|
EXPECT_HR(hr, S_OK);
|
||||||
|
|
||||||
hr = ISAXContentHandler_characters(content, chardataW, ARRAY_SIZE(chardataW) - 1);
|
hr = ISAXContentHandler_characters(content, chardataW, ARRAY_SIZE(chardataW) - 1);
|
||||||
EXPECT_HR(hr, S_OK);
|
EXPECT_HR(hr, S_OK);
|
||||||
|
|
||||||
|
@ -3983,13 +4015,14 @@ static void test_mxwriter_characters(void)
|
||||||
hr = IMXWriter_get_output(writer, &dest);
|
hr = IMXWriter_get_output(writer, &dest);
|
||||||
EXPECT_HR(hr, S_OK);
|
EXPECT_HR(hr, S_OK);
|
||||||
ok(V_VT(&dest) == VT_BSTR, "got %d\n", V_VT(&dest));
|
ok(V_VT(&dest) == VT_BSTR, "got %d\n", V_VT(&dest));
|
||||||
ok(!lstrcmpW(_bstr_("TESTCHARDATA ."), V_BSTR(&dest)), "got wrong content %s\n", wine_dbgstr_w(V_BSTR(&dest)));
|
ok(!lstrcmpW(_bstr_("VbCharsTESTCHARDATA ."), V_BSTR(&dest)), "got wrong content %s\n", wine_dbgstr_w(V_BSTR(&dest)));
|
||||||
VariantClear(&dest);
|
VariantClear(&dest);
|
||||||
|
|
||||||
hr = ISAXContentHandler_endDocument(content);
|
hr = ISAXContentHandler_endDocument(content);
|
||||||
EXPECT_HR(hr, S_OK);
|
EXPECT_HR(hr, S_OK);
|
||||||
|
|
||||||
ISAXContentHandler_Release(content);
|
ISAXContentHandler_Release(content);
|
||||||
|
IVBSAXContentHandler_Release(vb_content);
|
||||||
IMXWriter_Release(writer);
|
IMXWriter_Release(writer);
|
||||||
|
|
||||||
/* try empty characters data to see if element is closed */
|
/* try empty characters data to see if element is closed */
|
||||||
|
@ -4025,6 +4058,65 @@ static void test_mxwriter_characters(void)
|
||||||
ISAXContentHandler_Release(content);
|
ISAXContentHandler_Release(content);
|
||||||
IMXWriter_Release(writer);
|
IMXWriter_Release(writer);
|
||||||
|
|
||||||
|
/* test embedded null bytes */
|
||||||
|
hr = CoCreateInstance(&CLSID_MXXMLWriter, NULL, CLSCTX_INPROC_SERVER,
|
||||||
|
&IID_IMXWriter, (void**)&writer);
|
||||||
|
EXPECT_HR(hr, S_OK);
|
||||||
|
|
||||||
|
hr = IMXWriter_QueryInterface(writer, &IID_ISAXContentHandler, (void**)&content);
|
||||||
|
EXPECT_HR(hr, S_OK);
|
||||||
|
|
||||||
|
hr = IMXWriter_put_omitXMLDeclaration(writer, VARIANT_TRUE);
|
||||||
|
EXPECT_HR(hr, S_OK);
|
||||||
|
|
||||||
|
hr = ISAXContentHandler_startDocument(content);
|
||||||
|
EXPECT_HR(hr, S_OK);
|
||||||
|
|
||||||
|
hr = ISAXContentHandler_characters(content, embedded_nullbytes, ARRAY_SIZE(embedded_nullbytes));
|
||||||
|
EXPECT_HR(hr, S_OK);
|
||||||
|
|
||||||
|
V_VT(&dest) = VT_EMPTY;
|
||||||
|
hr = IMXWriter_get_output(writer, &dest);
|
||||||
|
EXPECT_HR(hr, S_OK);
|
||||||
|
ok(V_VT(&dest) == VT_BSTR, "got %d\n", V_VT(&dest));
|
||||||
|
ok(SysStringLen(V_BSTR(&dest)) == ARRAY_SIZE(embedded_nullbytes), "unexpected len %d\n", SysStringLen(V_BSTR(&dest)));
|
||||||
|
ok(!memcmp(V_BSTR(&dest), embedded_nullbytes, ARRAY_SIZE(embedded_nullbytes)),
|
||||||
|
"got wrong content %s\n", wine_dbgstr_w(V_BSTR(&dest)));
|
||||||
|
VariantClear(&dest);
|
||||||
|
|
||||||
|
ISAXContentHandler_Release(content);
|
||||||
|
IMXWriter_Release(writer);
|
||||||
|
|
||||||
|
hr = CoCreateInstance(&CLSID_MXXMLWriter, NULL, CLSCTX_INPROC_SERVER,
|
||||||
|
&IID_IMXWriter, (void**)&writer);
|
||||||
|
EXPECT_HR(hr, S_OK);
|
||||||
|
|
||||||
|
hr = IMXWriter_QueryInterface(writer, &IID_IVBSAXContentHandler, (void**)&vb_content);
|
||||||
|
EXPECT_HR(hr, S_OK);
|
||||||
|
|
||||||
|
hr = IMXWriter_put_omitXMLDeclaration(writer, VARIANT_TRUE);
|
||||||
|
EXPECT_HR(hr, S_OK);
|
||||||
|
|
||||||
|
hr = IVBSAXContentHandler_startDocument(vb_content);
|
||||||
|
EXPECT_HR(hr, S_OK);
|
||||||
|
|
||||||
|
str = SysAllocStringLen(embedded_nullbytes, ARRAY_SIZE(embedded_nullbytes));
|
||||||
|
hr = IVBSAXContentHandler_characters(vb_content, &str);
|
||||||
|
EXPECT_HR(hr, S_OK);
|
||||||
|
SysFreeString(str);
|
||||||
|
|
||||||
|
V_VT(&dest) = VT_EMPTY;
|
||||||
|
hr = IMXWriter_get_output(writer, &dest);
|
||||||
|
EXPECT_HR(hr, S_OK);
|
||||||
|
ok(V_VT(&dest) == VT_BSTR, "got %d\n", V_VT(&dest));
|
||||||
|
ok(SysStringLen(V_BSTR(&dest)) == ARRAY_SIZE(embedded_nullbytes), "unexpected len %d\n", SysStringLen(V_BSTR(&dest)));
|
||||||
|
ok(!memcmp(V_BSTR(&dest), embedded_nullbytes, ARRAY_SIZE(embedded_nullbytes)),
|
||||||
|
"got wrong content %s\n", wine_dbgstr_w(V_BSTR(&dest)));
|
||||||
|
VariantClear(&dest);
|
||||||
|
|
||||||
|
IVBSAXContentHandler_Release(vb_content);
|
||||||
|
IMXWriter_Release(writer);
|
||||||
|
|
||||||
/* batch tests */
|
/* batch tests */
|
||||||
while (table->clsid)
|
while (table->clsid)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1380,10 +1380,10 @@ static void test_XDR_datatypes(void)
|
||||||
break;
|
break;
|
||||||
case VT_R8:
|
case VT_R8:
|
||||||
if (!strcmp(ptr->typename, "float"))
|
if (!strcmp(ptr->typename, "float"))
|
||||||
ok(V_R8(&v) == (double)3.14159, "got %f\n", V_R8(&v));
|
ok(V_R8(&v) == 3.14159, "got %f\n", V_R8(&v));
|
||||||
else
|
else
|
||||||
todo_wine
|
todo_wine
|
||||||
ok(V_R8(&v) == (double)3.14159265358979323846, "got %.20f\n", V_R8(&v));
|
ok(V_R8(&v) == 3.14159265358979323846, "got %.20f\n", V_R8(&v));
|
||||||
break;
|
break;
|
||||||
case VT_UI1:
|
case VT_UI1:
|
||||||
ok(V_UI1(&v) == 0xFF, "got %02x\n", V_UI1(&v));
|
ok(V_UI1(&v) == 0xFF, "got %02x\n", V_UI1(&v));
|
||||||
|
|
Loading…
Reference in a new issue