41#define EXPECT_HR(hr,hr_exp) \
42 ok(hr == hr_exp, "got 0x%08x, expected 0x%08x\n", hr, hr_exp)
44#define EXPECT_REF(obj,ref) _expect_ref((IUnknown*)obj, ref, __LINE__)
49 rc = IUnknown_Release(
obj);
50 ok_(__FILE__,
line)(rc ==
ref,
"expected refcount %d, got %d\n",
ref, rc);
58 ref = IUnknown_AddRef(unk);
59 IUnknown_Release(unk);
145 if (lenexp !=
len)
return;
185 "putDocumentLocator",
188 "startPrefixMapping",
193 "ignorableWhitespace",
194 "processingInstruction",
242#define CONTENT_HANDLER_INDEX 0
243#define NUM_CALL_SEQUENCES 1
248 memset(call, 0,
sizeof(*call));
291 for (
i = 0;
i < call_seq->
count;
i++)
329 while (
ptr->uri) { lenexp++;
ptr++; };
365 add_call(seq, sequence_index, &end_of_sequence);
383 "%s: in event %s expecting line %d got %d\n",
390 "%s: in event %s expecting line %d got %d\n",
404 "%s: in event %s expecting column %d got %d\n",
411 "%s: in event %s expecting column %d got %d\n",
463 "%s: in event %s expecting ret 0x%08x got 0x%08x\n",
468 "%s: in event %s expecting ret 0x%08x got 0x%08x\n",
484 ok_(
file,
line) (
FALSE,
"%s: call %s was expected, but got call %s instead\n",
493 ok_(
file,
line) (
FALSE,
"%s: call %s was expected, but got call %s instead\n",
507 ok_(
file,
line) (
FALSE,
"%s: the call sequence is not complete: expected %s - actual %s\n",
514 ok_(
file,
line) (
FALSE,
"%s: the call sequence is not complete: expected %s - actual %s\n",
518 if (
todo && !failcount)
529#define ok_sequence(seq, index, exp, contx, todo) \
530 ok_sequence_(seq, index, (exp), (contx), (todo), __FILE__, __LINE__)
536 for (
i = 0;
i <
n;
i++)
541'<',
'?',
'x',
'm',
'l',
' ',
'v',
'e',
'r',
's',
'i',
'o',
'n',
'=',
'\"',
'1',
'.',
'0',
'\"',
' ',
'?',
'>',
'\n',
542'<',
'B',
'a',
'n',
'k',
'A',
'c',
'c',
'o',
'u',
'n',
't',
'>',
'\n',
543' ',
' ',
' ',
'<',
'N',
'u',
'm',
'b',
'e',
'r',
'>',
'1',
'2',
'3',
'4',
'<',
'/',
'N',
'u',
'm',
'b',
'e',
'r',
'>',
'\n',
544' ',
' ',
' ',
'<',
'N',
'a',
'm',
'e',
'>',
'C',
'a',
'p',
't',
'a',
'i',
'n',
' ',
'A',
'h',
'a',
'b',
'<',
'/',
'N',
'a',
'm',
'e',
'>',
'\n',
545'<',
'/',
'B',
'a',
'n',
'k',
'A',
'c',
'c',
'o',
'u',
'n',
't',
'>',
'\n',
'\0'
549'<',
'?',
'x',
'm',
'l',
' ',
'v',
'e',
'r',
's',
'i',
'o',
'n',
'=',
'"',
'1',
'.',
'0',
'"',
'?',
'>',
'\r',
'\n',
550'<',
'B',
'a',
'n',
'k',
'A',
'c',
'c',
'o',
'u',
'n',
't',
'>',
'\r',
'\n',
551'\t',
'<',
'N',
'u',
'm',
'b',
'e',
'r',
'>',
'1',
'2',
'3',
'4',
'<',
'/',
'N',
'u',
'm',
'b',
'e',
'r',
'>',
'\r',
'\n',
552'\t',
'<',
'N',
'a',
'm',
'e',
'>',
'C',
'a',
'p',
't',
'a',
'i',
'n',
' ',
'A',
'h',
'a',
'b',
'<',
'/',
'N',
'a',
'm',
'e',
'>',
'\r',
'\n',
553'<',
'/',
'B',
'a',
'n',
'k',
'A',
'c',
'c',
'o',
'u',
'n',
't',
'>',
'\r',
'\n',
'\0'
557'<',
'?',
'x',
'm',
'l',
' ',
'v',
'e',
'r',
's',
'i',
'o',
'n',
'=',
'"',
'1',
'.',
'0',
'"',
' ',
558'e',
'n',
'c',
'o',
'd',
'i',
'n',
'g',
'=',
'"',
'U',
'T',
'F',
'-',
'1',
'6',
'"',
' ',
559's',
't',
'a',
'n',
'd',
'a',
'l',
'o',
'n',
'e',
'=',
'"',
'n',
'o',
'"',
'?',
'>',
'\r',
'\n'
565"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n";
568"<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\r\n";
571"<?xml version=\"1.0\" ?>\n"
573" <Number>1234</Number>\n"
574" <Name>Captain Ahab</Name>\n"
578"<?xml version=\"1.0\" ?>\n"
579"<document xmlns:test=\"prefix_test\" xmlns=\"prefix\" test:arg1=\"arg1\" arg2=\"arg2\" test:ar3=\"arg3\">\n"
580"<node1 xmlns:p=\"test\" />"
584"<?xml version=\"1.0\" ?>"
585"<a><![CDATA[Some \r\ntext\n\r\ndata\n\n]]></a>";
588"<?xml version=\"1.0\" ?>"
589"<a><![CDATA[\n\r\nSome \r\ntext\n\r\ndata\n\n]]></a>";
592"<?xml version=\"1.0\" ?><a><![CDATA[Some text data]]></a>";
709 {
"",
"",
"xmlns:test",
"prefix_test" },
710 {
"",
"",
"xmlns",
"prefix" },
711 {
"prefix_test",
"arg1",
"test:arg1",
"arg1" },
712 {
"",
"arg2",
"arg2",
"arg2" },
713 {
"prefix_test",
"ar3",
"test:ar3",
"arg3" },
718 {
"",
"",
"xmlns:p",
"test" },
741 {
"prefix_test",
"arg1",
"test:arg1",
"arg1" },
742 {
"",
"arg2",
"arg2",
"arg2" },
743 {
"prefix_test",
"ar3",
"test:ar3",
"arg3" },
744 {
"",
"",
"xmlns:test",
"prefix_test" },
745 {
"",
"",
"xmlns",
"prefix" },
769 {
"",
"",
"xmlns:test",
"prefix_test" },
770 {
"",
"",
"xmlns",
"prefix" },
771 {
"",
"",
"test:arg1",
"arg1" },
772 {
"",
"",
"arg2",
"arg2" },
773 {
"",
"",
"test:ar3",
"arg3" },
790 {
"prefix_test",
"arg1",
"test:arg1",
"arg1" },
791 {
"",
"arg2",
"arg2",
"arg2" },
792 {
"prefix_test",
"ar3",
"test:ar3",
"arg3" },
793 {
"http://www.w3.org/2000/xmlns/",
"",
"xmlns:test",
"prefix_test" },
794 {
"http://www.w3.org/2000/xmlns/",
"",
"xmlns",
"prefix" },
799 {
"http://www.w3.org/2000/xmlns/",
"",
"xmlns:p",
"test" },
823 {
"prefix_test",
"arg1",
"test:arg1",
"arg1" },
824 {
"",
"arg2",
"arg2",
"arg2" },
825 {
"prefix_test",
"ar3",
"test:ar3",
"arg3" },
866 {
"http://www.w3.org/XML/1998/namespace",
"space",
"xml:space",
"preserve" },
892 "<?xml version=\"1.0\" ?>\n"
893 "<a attr1=\" \r \n \tattr_value A & &\t \r \n\r\n \n\"/>\n";
896 {
"",
"attr1",
"attr1",
" attr_value A & & " },
1007 {
"",
"attr",
"attr",
"val" },
1033 "<?xml version=\"1.0\" encoding=\"UTF-16\"?>"
1034 "<a xml:space=\"preserve\"> Some text data </a>";
1055 ISAXContentHandler* iface,
1074 ISAXContentHandler* iface)
1080 ISAXContentHandler* iface)
1086 ISAXContentHandler* iface,
1087 ISAXLocator *pLocator)
1099 hr = ISAXLocator_QueryInterface(pLocator, &IID_IVBSAXLocator, (
void**)&unk);
1103 ISAXAttributes *
attr, *attr1;
1104 IMXAttributes *mxattr;
1107 hr = ISAXLocator_QueryInterface(pLocator, &IID_ISAXAttributes, (
void**)&
attr);
1110 hr = ISAXLocator_QueryInterface(pLocator, &IID_ISAXAttributes, (
void**)&attr1);
1113 ok(
attr == attr1,
"got %p, %p\n",
attr, attr1);
1115 hr = ISAXAttributes_QueryInterface(
attr, &IID_IVBSAXAttributes, (
void**)&unk);
1118 hr = ISAXLocator_QueryInterface(pLocator, &IID_IVBSAXAttributes, (
void**)&unk);
1121 hr = ISAXAttributes_QueryInterface(
attr, &IID_IMXAttributes, (
void**)&mxattr);
1124 ISAXAttributes_Release(
attr);
1125 ISAXAttributes_Release(attr1);
1133 ISAXContentHandler* iface)
1147 ISAXContentHandler* iface)
1159 ISAXContentHandler* iface,
1160 const WCHAR *prefix,
int prefix_len,
1165 ok(prefix !=
NULL,
"prefix == NULL\n");
1178 ISAXContentHandler* iface,
1183 ok(prefix !=
NULL,
"prefix == NULL\n");
1194 ISAXContentHandler* iface,
1196 const WCHAR *localname,
int local_len,
1197 const WCHAR *qname,
int qname_len,
1198 ISAXAttributes *saxattr)
1201 IMXAttributes *mxattr;
1206 ok(localname !=
NULL,
"localname == NULL\n");
1207 ok(qname !=
NULL,
"qname == NULL\n");
1209 hr = ISAXAttributes_QueryInterface(saxattr, &IID_IMXAttributes, (
void**)&mxattr);
1224 hr = ISAXAttributes_getLength(saxattr, &
len);
1236 hr = ISAXXMLReader_getFeature(
g_reader,
_bstr_(
"http://xml.org/sax/features/namespaces"), &
v);
1239 for (
i = 0;
i <
len;
i++)
1244 hr = ISAXAttributes_getName(saxattr,
i, &
uri, &uri_len,
1245 &localname, &local_len, &
qname, &qname_len);
1248 hr = ISAXAttributes_getValue(saxattr,
i, &
value, &value_len);
1277 ISAXContentHandler* iface,
1279 const WCHAR *localname,
int local_len,
1285 ok(localname !=
NULL,
"localname == NULL\n");
1286 ok(qname !=
NULL,
"qname == NULL\n");
1299 ISAXContentHandler* iface,
1305 ok(chars !=
NULL,
"chars == NULL\n");
1316 ISAXContentHandler* iface,
1321 ok(chars !=
NULL,
"chars == NULL\n");
1332 ISAXContentHandler* iface,
1351 ISAXContentHandler* iface,
1387 ISAXErrorHandler* iface,
1406 ISAXErrorHandler* iface)
1412 ISAXErrorHandler* iface)
1418 ISAXErrorHandler* iface,
1419 ISAXLocator *pLocator,
1420 const WCHAR *pErrorMessage,
1423 ok(0,
"unexpected call\n");
1428 ISAXErrorHandler* iface,
1429 ISAXLocator *pLocator,
1446 ISAXErrorHandler* iface,
1447 ISAXLocator *pLocator,
1448 const WCHAR *pErrorMessage,
1451 ok(0,
"unexpected call\n");
1468 ISAXAttributes* iface,
1503 ISAXAttributes* iface,
1508 ok(0,
"unexpected call\n");
1513 ISAXAttributes* iface,
1515 const WCHAR **pLocalName,
1516 int *pLocalNameLength)
1518 ok(0,
"unexpected call\n");
1523 ISAXAttributes* iface,
1525 const WCHAR **QName,
1528 static const WCHAR attrqnamesW[][15] = {{
'a',
':',
'a',
't',
't',
'r',
'1',
'j',
'u',
'n',
'k',0},
1529 {
'a',
't',
't',
'r',
'2',
'j',
'u',
'n',
'k',0},
1530 {
'a',
't',
't',
'r',
'3',0}};
1531 static const int attrqnamelen[] = {7, 5, 5};
1536 *QName = attrqnamesW[
index];
1537 *QNameLength = attrqnamelen[
index];
1547 ISAXAttributes* iface,
1551 const WCHAR ** pLocalName,
1552 int * pLocalNameSize,
1553 const WCHAR ** pQName,
1556 ok(0,
"unexpected call\n");
1561 ISAXAttributes* iface,
1564 const WCHAR * pLocalName,
1565 int cocalNameLength,
1568 ok(0,
"unexpected call\n");
1573 ISAXAttributes* iface,
1574 const WCHAR * pQName,
1578 ok(0,
"unexpected call\n");
1583 ISAXAttributes* iface,
1585 const WCHAR ** pType,
1588 ok(0,
"unexpected call\n");
1593 ISAXAttributes* iface,
1596 const WCHAR * pLocalName,
1598 const WCHAR ** pType,
1601 ok(0,
"unexpected call\n");
1606 ISAXAttributes* iface,
1607 const WCHAR * pQName,
1609 const WCHAR ** pType,
1612 ok(0,
"unexpected call\n");
1619 static const WCHAR attrvaluesW[][10] = {{
'a',
'1',
'j',
'u',
'n',
'k',0},
1620 {
'a',
'2',
'j',
'u',
'n',
'k',0},
1621 {
'<',
'&',
'"',
'>',
'\'',0}};
1622 static const int attrvalueslen[] = {2, 2, 5};
1628 *nValue = attrvalueslen[
index];
1638 ISAXAttributes* iface,
1641 const WCHAR * pLocalName,
1646 ok(0,
"unexpected call\n");
1651 ISAXAttributes* iface,
1652 const WCHAR * pQName,
1657 ok(0,
"unexpected call\n");
1705 ok(0,
"got unexpected IID_IUnknown query\n");
1714 ISAXLexicalHandler_AddRef(iface);
1735 int nPublicId,
const WCHAR * pSystemId,
int nSystemId)
1737 ok(0,
"call not expected\n");
1743 ok(0,
"call not expected\n");
1750 ok(0,
"call not expected\n");
1757 ok(0,
"call not expected\n");
1784 const WCHAR * pChars,
int nChars)
1786 ok(0,
"call not expected\n");
1833 ok(0,
"got unexpected IID_IUnknown query\n");
1842 ISAXDeclHandler_AddRef(iface);
1864 ok(0,
"call not expected\n");
1869 const WCHAR * pElementName,
int nElementName,
const WCHAR * pAttributeName,
1870 int nAttributeName,
const WCHAR * pType,
int nType,
const WCHAR * pValueDefault,
1871 int nValueDefault,
const WCHAR *
pValue,
int nValue)
1873 ok(0,
"call not expected\n");
1880 ok(0,
"call not expected\n");
1885 const WCHAR *
pName,
int nName,
const WCHAR * pPublicId,
int nPublicId,
1886 const WCHAR * pSystemId,
int nSystemId)
1888 ok(0,
"call not expected\n");
1953 ok(0,
"unexpected call\n");
1959 ok(0,
"unexpected call\n");
1966 ok(0,
"unexpected call\n");
1972 ok(0,
"unexpected call\n");
1979 ok(0,
"unexpected call\n");
1985 ok(0,
"unexpected call\n");
1991 ok(0,
"unexpected call\n");
1998 ok(0,
"unexpected call\n");
2005 ok(0,
"unexpected call\n");
2016 ok(0,
"unexpected call\n");
2024 ok(pv !=
NULL,
"pv == NULL\n");
2072 static const char *ret_str;
2075 ret_str =
"<?xml version=\"1.0\" ?>\n<rootelem>";
2077 ret_str =
"<elem attr=\"val\">text</elem>";
2079 ret_str =
"</rootelem>\n";
2085 *pcbRead =
strlen(ret_str);
2110 { &CLSID_SAXXMLReader,
"SAXReader" },
2111 { &CLSID_SAXXMLReader30,
"SAXReader30" },
2112 { &CLSID_SAXXMLReader40,
"SAXReader40" },
2113 { &CLSID_SAXXMLReader60,
"SAXReader60" },
2145 ISAXErrorHandler *lpErrorHandler;
2152 static const CHAR testXmlA[] =
"test.xml";
2153 static const WCHAR testXmlW[] = {
't',
'e',
's',
't',
'.',
'x',
'm',
'l',0};
2158 while (
table->clsid)
2161 ISAXEntityResolver *resolver;
2196 hr = ISAXXMLReader_getErrorHandler(
reader, &lpErrorHandler);
2198 ok(lpErrorHandler ==
NULL,
"Expected %p, got %p\n",
NULL, lpErrorHandler);
2327 hr = ISAXXMLReader_parseURL(
reader, testXmlW);
2338 hr = ISAXXMLReader_parseURL(
reader, testXmlW);
2348 hr = ISAXXMLReader_parseURL(
reader, testXmlW);
2355 hr = ISAXXMLReader_parseURL(
reader, testXmlW);
2364 &IID_IXMLDOMDocument, (
void**)&doc);
2368 hr = IXMLDOMDocument_loadXML(doc,
str, &
v);
2385 IXMLDOMDocument_Release(doc);
2411 hr = ISAXXMLReader_putFeature(
reader,
_bstr_(
"http://xml.org/sax/features/namespaces"), VARIANT_FALSE);
2431 hr = ISAXXMLReader_putFeature(
reader,
_bstr_(
"http://xml.org/sax/features/namespaces"), VARIANT_TRUE);
2435 hr = ISAXXMLReader_putFeature(
reader,
_bstr_(
"http://xml.org/sax/features/namespace-prefixes"), VARIANT_FALSE);
2456 hr = ISAXXMLReader_putFeature(
reader,
_bstr_(
"http://xml.org/sax/features/namespace-prefixes"), VARIANT_TRUE);
2478 resolver = (
void*)0xdeadbeef;
2479 hr = ISAXXMLReader_getEntityResolver(
reader, &resolver);
2481 ok(resolver ==
NULL,
"got %p\n", resolver);
2491 hr = ISAXXMLReader_putProperty(
reader,
_bstr_(
"http://xml.org/sax/properties/lexical-handler"),
var);
2550 ISAXXMLReader_Release(
reader);
2564 {
"http://xml.org/sax/properties/lexical-handler", (
IUnknown*)&
lexicalhandler.ISAXLexicalHandler_iface },
2565 {
"http://xml.org/sax/properties/declaration-handler", (
IUnknown*)&
declhandler.ISAXDeclHandler_iface },
2578 &IID_ISAXXMLReader, (
void**)&
reader);
2581 hr = ISAXXMLReader_getProperty(
reader,
_bstr_(
"http://xml.org/sax/properties/lexical-handler"),
NULL);
2584 while (
ptr->prop_name)
2719 ISAXXMLReader_Release(
reader);
2725 &IID_ISAXXMLReader, (
void**)&
reader);
2730 V_BSTR(&
v) = (
void*)0xdeadbeef;
2731 hr = ISAXXMLReader_getProperty(
reader,
_bstr_(
"xmldecl-version"), &
v);
2743 V_BSTR(&
v) = (
void*)0xdeadbeef;
2744 hr = ISAXXMLReader_getProperty(
reader,
_bstr_(
"xmldecl-version"), &
v);
2751 V_BSTR(&
v) =
_bstr_(
"<?xml version=\"1.0\"?><element></element>");
2756 str =
_bstr_(
"<?xml version=\"1.0\"?><element></element>");
2763 V_BSTR(&
v) = (
void*)0xdeadbeef;
2764 hr = ISAXXMLReader_getProperty(
reader,
_bstr_(
"xmldecl-version"), &
v);
2770 ISAXXMLReader_Release(
reader);
2782 { &CLSID_SAXXMLReader,
"CLSID_SAXXMLReader", VARIANT_TRUE, VARIANT_FALSE },
2783 { &CLSID_SAXXMLReader30,
"CLSID_SAXXMLReader30", VARIANT_TRUE, VARIANT_FALSE },
2784 { &CLSID_SAXXMLReader40,
"CLSID_SAXXMLReader40", VARIANT_TRUE, VARIANT_TRUE },
2785 { &CLSID_SAXXMLReader60,
"CLSID_SAXXMLReader60", VARIANT_TRUE, VARIANT_TRUE },
2790 "http://xml.org/sax/features/namespaces",
2791 "http://xml.org/sax/features/namespace-prefixes",
2817 value = VARIANT_TRUE;
2819 ok(
hr ==
S_OK,
"Failed to get feature value, hr %#x.\n",
hr);
2820 ok(
value == VARIANT_FALSE,
"Unexpected default feature value.\n");
2821 hr = ISAXXMLReader_putFeature(
reader,
_bstr_(
"exhaustive-errors"), VARIANT_FALSE);
2822 ok(
hr ==
S_OK,
"Failed to put feature value, hr %#x.\n",
hr);
2824 value = VARIANT_TRUE;
2826 ok(
hr ==
S_OK,
"Failed to get feature value, hr %#x.\n",
hr);
2827 ok(
value == VARIANT_FALSE,
"Unexpected default feature value.\n");
2828 hr = ISAXXMLReader_putFeature(
reader,
_bstr_(
"exhaustive-errors"), VARIANT_FALSE);
2829 ok(
hr ==
S_OK,
"Failed to put feature value, hr %#x.\n",
hr);
2866 ok(
value == VARIANT_FALSE,
"%s: got wrong value %x, expected VARIANT_FALSE\n",
entry->clsid,
value);
2873 ok(
value == VARIANT_TRUE,
"%s: got wrong value %x, expected VARIANT_TRUE\n",
entry->clsid,
value);
2878 ISAXXMLReader_Release(
reader);
2886"\xEF\xBB\xBF<?xml version = \"1.0\" encoding = \"UTF-16\"?>\n"
2898 { &CLSID_SAXXMLReader,
"CLSID_SAXXMLReader",
UTF8BOMTest, 0xc00ce56f,
TRUE },
2899 { &CLSID_SAXXMLReader30,
"CLSID_SAXXMLReader30",
UTF8BOMTest, 0xc00ce56f,
TRUE },
2908 static const WCHAR testXmlW[] = {
't',
'e',
's',
't',
'.',
'x',
'm',
'l',0};
2909 static const CHAR testXmlA[] =
"test.xml";
2932 hr = ISAXXMLReader_parseURL(
reader, testXmlW);
2944 ISAXXMLReader_Release(
reader);
2959 &IID_ISAXContentHandler,
2960 &IID_ISAXLexicalHandler,
2961 &IID_ISAXDeclHandler,
2962 &IID_ISAXDTDHandler,
2963 &IID_ISAXErrorHandler,
2964 &IID_IVBSAXDeclHandler,
2965 &IID_IVBSAXLexicalHandler,
2966 &IID_IVBSAXContentHandler,
2967 &IID_IVBSAXDTDHandler,
2968 &IID_IVBSAXErrorHandler
2972 &IID_IMXWriter, (
void**)&writer);
2973 ok(
hr ==
S_OK,
"Expected S_OK, got %08x\n",
hr);
2983 hr = IMXWriter_QueryInterface(writer, riids[
i], (
void**)&
handler);
2989 hr = IUnknown_QueryInterface(
handler, &IID_IMXWriter, (
void**)&writer2);
2991 ok(writer2 == writer,
"got %p, expected %p\n", writer2, writer);
2993 IMXWriter_Release(writer2);
2997 IMXWriter_Release(writer);
3002 { &CLSID_MXXMLWriter,
"MXXMLWriter" },
3003 { &CLSID_MXXMLWriter30,
"MXXMLWriter30" },
3004 { &CLSID_MXXMLWriter40,
"MXXMLWriter40" },
3005 { &CLSID_MXXMLWriter60,
"MXXMLWriter60" },
3011 { &CLSID_SAXAttributes,
"SAXAttributes" },
3012 { &CLSID_SAXAttributes30,
"SAXAttributes30" },
3013 { &CLSID_SAXAttributes40,
"SAXAttributes40" },
3014 { &CLSID_SAXAttributes60,
"SAXAttributes60" },
3031 { &CLSID_MXXMLWriter, VARIANT_TRUE, VARIANT_FALSE, VARIANT_FALSE, VARIANT_FALSE, VARIANT_FALSE,
"UTF-16" },
3032 { &CLSID_MXXMLWriter30, VARIANT_TRUE, VARIANT_FALSE, VARIANT_FALSE, VARIANT_FALSE, VARIANT_FALSE,
"UTF-16" },
3033 { &CLSID_MXXMLWriter40, VARIANT_TRUE, VARIANT_FALSE, VARIANT_FALSE, VARIANT_FALSE, VARIANT_FALSE,
"UTF-16" },
3034 { &CLSID_MXXMLWriter60, VARIANT_TRUE, VARIANT_FALSE, VARIANT_FALSE, VARIANT_FALSE, VARIANT_FALSE,
"UTF-16" },
3042 while (
table->clsid)
3057 &IID_IMXWriter, (
void**)&writer);
3061 hr = IMXWriter_get_byteOrderMark(writer, &
b);
3063 ok(
table->bom ==
b,
"test %d: got BOM %d, expected %d\n",
i,
b,
table->bom);
3065 b = !
table->disable_escape;
3066 hr = IMXWriter_get_disableOutputEscaping(writer, &
b);
3068 ok(
table->disable_escape ==
b,
"test %d: got disable escape %d, expected %d\n",
i,
b,
3069 table->disable_escape);
3072 hr = IMXWriter_get_indent(writer, &
b);
3074 ok(
table->indent ==
b,
"test %d: got indent %d, expected %d\n",
i,
b,
table->indent);
3077 hr = IMXWriter_get_omitXMLDeclaration(writer, &
b);
3079 ok(
table->omitdecl ==
b,
"test %d: got omitdecl %d, expected %d\n",
i,
b,
table->omitdecl);
3082 hr = IMXWriter_get_standalone(writer, &
b);
3084 ok(
table->standalone ==
b,
"test %d: got standalone %d, expected %d\n",
i,
b,
table->standalone);
3086 hr = IMXWriter_get_encoding(writer, &
encoding);
3092 IMXWriter_Release(writer);
3101 static const WCHAR utf16W[] = {
'U',
'T',
'F',
'-',
'1',
'6',0};
3102 static const WCHAR testW[] = {
't',
'e',
's',
't',0};
3113 &IID_IMXWriter, (
void**)&writer);
3114 ok(
hr ==
S_OK,
"Expected S_OK, got %08x\n",
hr);
3116 hr = IMXWriter_get_disableOutputEscaping(writer,
NULL);
3119 hr = IMXWriter_get_byteOrderMark(writer,
NULL);
3122 hr = IMXWriter_get_indent(writer,
NULL);
3125 hr = IMXWriter_get_omitXMLDeclaration(writer,
NULL);
3128 hr = IMXWriter_get_standalone(writer,
NULL);
3132 hr = IMXWriter_put_standalone(writer, VARIANT_TRUE);
3136 hr = IMXWriter_get_standalone(writer, &
b);
3138 ok(
b == VARIANT_TRUE,
"got %d\n",
b);
3140 hr = IMXWriter_get_encoding(writer,
NULL);
3144 str = (
void*)0xdeadbeef;
3145 hr = IMXWriter_get_encoding(writer, &
str);
3149 str2 = (
void*)0xdeadbeef;
3150 hr = IMXWriter_get_encoding(writer, &str2);
3152 ok(
str != str2,
"expected newly allocated, got same %p\n",
str);
3159 hr = IMXWriter_put_encoding(writer,
str);
3163 str = (
void*)0xdeadbeef;
3164 hr = IMXWriter_get_encoding(writer, &
str);
3171 hr = IMXWriter_put_encoding(writer,
str);
3176 hr = IMXWriter_put_encoding(writer,
_bstr_(
"utf-8"));
3178 str = (
void*)0xdeadbeef;
3179 hr = IMXWriter_get_encoding(writer, &
str);
3184 hr = IMXWriter_put_encoding(writer,
_bstr_(
"uTf-16"));
3186 str = (
void*)0xdeadbeef;
3187 hr = IMXWriter_get_encoding(writer, &
str);
3193 hr = IMXWriter_QueryInterface(writer, &IID_ISAXContentHandler, (
void**)&
content);
3196 hr = ISAXContentHandler_startDocument(
content);
3198 hr = ISAXContentHandler_endDocument(
content);
3202 hr = IMXWriter_get_output(writer, &
dest);
3205 ok(!
lstrcmpW(
_bstr_(
"<?xml version=\"1.0\" encoding=\"UTF-16\" standalone=\"yes\"?>\r\n"),
3208 ISAXContentHandler_Release(
content);
3210 hr = IMXWriter_get_version(writer,
NULL);
3213 hr = IMXWriter_get_version(writer, &
str);
3219 hr = IMXWriter_put_version(writer,
NULL);
3222 hr = IMXWriter_put_version(writer,
_bstr_(
"1.0"));
3225 hr = IMXWriter_put_version(writer,
_bstr_(
""));
3227 hr = IMXWriter_get_version(writer, &
str);
3232 hr = IMXWriter_put_version(writer,
_bstr_(
"a.b"));
3234 hr = IMXWriter_get_version(writer, &
str);
3239 hr = IMXWriter_put_version(writer,
_bstr_(
"2.0"));
3241 hr = IMXWriter_get_version(writer, &
str);
3246 IMXWriter_Release(writer);
3264 &IID_IMXWriter, (
void**)&writer);
3265 ok(
hr ==
S_OK,
"Expected S_OK, got %08x\n",
hr);
3268 ok(
hr ==
S_OK,
"Expected S_OK, got %08x\n",
hr);
3273 hr = IMXWriter_put_output(writer,
dest);
3274 ok(
hr ==
S_OK,
"Expected S_OK, got %08x\n",
hr);
3279 hr = IMXWriter_put_output(writer,
dest);
3280 ok(
hr ==
S_OK,
"Expected S_OK, got %08x\n",
hr);
3285 hr = IMXWriter_put_output(writer,
dest);
3286 ok(
hr ==
S_OK,
"Expected S_OK, got %08x\n",
hr);
3291 hr = IMXWriter_put_output(writer,
dest);
3292 ok(
hr ==
S_OK,
"Expected S_OK, got %08x\n",
hr);