39DEFINE_GUID(IID_IXmlWriterOutput, 0xc1131708, 0x0f59, 0x477f, 0x93, 0x59, 0x7d, 0x33, 0x24, 0x51, 0xbc, 0x1a);
43#define EXPECT_REF(obj, ref) _expect_ref((IUnknown *)obj, ref, __LINE__)
48 refcount = IUnknown_Release(
obj);
49 ok_(__FILE__,
line)(refcount ==
ref,
"expected refcount %d, got %d\n",
ref, refcount);
60 ok_(__FILE__,
line)(
hr ==
S_OK,
"Failed to get the stream handle, hr %#x.\n",
hr);
63 ok_(__FILE__,
line)(
size == content_size,
"Unexpected test output size %ld.\n", content_size);
65 if (
size <= content_size)
67 if (
size != content_size && *
ptr == 0xfeff)
89 ok_(__FILE__,
line)(0,
"data size mismatch, expected %u, got %u\n",
len,
size);
97#define CHECK_OUTPUT(stream, expected) check_output(stream, expected, FALSE, __LINE__)
98#define CHECK_OUTPUT_TODO(stream, expected) check_output(stream, expected, TRUE, __LINE__)
99#define CHECK_OUTPUT_RAW(stream, expected, size) check_output_raw(stream, expected, size, __LINE__)
119 ok(
hr ==
S_OK,
"Failed to set writer property, hr %#x.\n",
hr);
125 static const WCHAR aW[] = {
'a',0};
131 ok(
hr == exp_hr,
"got 0x%08x, expected 0x%08x\n",
hr, exp_hr);
133 hr = IXmlWriter_WriteCData(writer,
aW);
134 ok(
hr == exp_hr,
"got 0x%08x, expected 0x%08x\n",
hr, exp_hr);
136 hr = IXmlWriter_WriteCharEntity(writer,
aW[0]);
137 ok(
hr == exp_hr,
"got 0x%08x, expected 0x%08x\n",
hr, exp_hr);
139 hr = IXmlWriter_WriteChars(writer,
aW, 1);
140 ok(
hr == exp_hr,
"got 0x%08x, expected 0x%08x\n",
hr, exp_hr);
142 hr = IXmlWriter_WriteComment(writer,
aW);
143 ok(
hr == exp_hr,
"got 0x%08x, expected 0x%08x\n",
hr, exp_hr);
146 ok(
hr == exp_hr,
"got 0x%08x, expected 0x%08x\n",
hr, exp_hr);
149 ok(
hr == exp_hr,
"got 0x%08x, expected 0x%08x\n",
hr, exp_hr);
151 hr = IXmlWriter_WriteEndDocument(writer);
152 ok(
hr == exp_hr,
"got 0x%08x, expected 0x%08x\n",
hr, exp_hr);
154 hr = IXmlWriter_WriteEndElement(writer);
155 ok(
hr == exp_hr,
"got 0x%08x, expected 0x%08x\n",
hr, exp_hr);
157 hr = IXmlWriter_WriteEntityRef(writer,
aW);
158 ok(
hr == exp_hr,
"got 0x%08x, expected 0x%08x\n",
hr, exp_hr);
160 hr = IXmlWriter_WriteFullEndElement(writer);
161 ok(
hr == exp_hr,
"got 0x%08x, expected 0x%08x\n",
hr, exp_hr);
163 hr = IXmlWriter_WriteName(writer,
aW);
164 ok(
hr == exp_hr,
"got 0x%08x, expected 0x%08x\n",
hr, exp_hr);
166 hr = IXmlWriter_WriteNmToken(writer,
aW);
167 ok(
hr == exp_hr,
"got 0x%08x, expected 0x%08x\n",
hr, exp_hr);
172 hr = IXmlWriter_WriteProcessingInstruction(writer,
aW,
aW);
173 ok(
hr == exp_hr,
"got 0x%08x, expected 0x%08x\n",
hr, exp_hr);
175 hr = IXmlWriter_WriteQualifiedName(writer,
aW,
NULL);
176 ok(
hr == exp_hr,
"got 0x%08x, expected 0x%08x\n",
hr, exp_hr);
178 hr = IXmlWriter_WriteRaw(writer,
aW);
179 ok(
hr == exp_hr,
"got 0x%08x, expected 0x%08x\n",
hr, exp_hr);
181 hr = IXmlWriter_WriteRawChars(writer,
aW, 1);
182 ok(
hr == exp_hr,
"got 0x%08x, expected 0x%08x\n",
hr, exp_hr);
185 ok(
hr == exp_hr,
"got 0x%08x, expected 0x%08x\n",
hr, exp_hr);
187 hr = IXmlWriter_WriteStartElement(writer,
NULL,
aW,
NULL);
188 ok(
hr == exp_hr,
"got 0x%08x, expected 0x%08x\n",
hr, exp_hr);
190 hr = IXmlWriter_WriteString(writer,
aW);
191 ok(
hr == exp_hr,
"got 0x%08x, expected 0x%08x\n",
hr, exp_hr);
265 ok(0,
"unexpected call\n");
306 ok(
hr ==
S_OK,
"Expected S_OK, got %08x\n",
hr);
307 hr = IUnknown_QueryInterface(unk, &IID_IXmlWriter, (
void **)&writer);
308 ok(
hr ==
S_OK,
"Expected S_OK, got %08x\n",
hr);
309 ok(unk == (
IUnknown *)writer,
"unexpected interface pointer\n");
310 IUnknown_Release(unk);
311 IXmlWriter_Release(writer);
314 ok(
hr ==
S_OK,
"Expected S_OK, got %08x\n",
hr);
319 ok(
hr ==
S_OK,
"Expected S_OK, got %08x\n",
hr);
324 ok(
hr ==
S_OK,
"Expected S_OK, got %08x\n",
hr);
329 ok(
hr ==
S_OK,
"Expected S_OK, got %08x\n",
hr);
334 ok(
hr ==
S_OK,
"Expected S_OK, got %08x\n",
hr);
337 IXmlWriter_Release(writer);
344 hr = IXmlWriter_SetOutput(writer, output);
345 ok(
hr ==
S_OK,
"Failed to set output, hr %#x.\n",
hr);
352 hr = IXmlWriter_WriteCData(writer,
aW);
355 hr = IXmlWriter_WriteCharEntity(writer, 0x100);
358 hr = IXmlWriter_WriteChars(writer,
aW, 1);
361 hr = IXmlWriter_WriteComment(writer,
aW);
370 hr = IXmlWriter_WriteEndDocument(writer);
373 hr = IXmlWriter_WriteEndElement(writer);
376 hr = IXmlWriter_WriteEntityRef(writer,
aW);
379 hr = IXmlWriter_WriteFullEndElement(writer);
382 hr = IXmlWriter_WriteName(writer,
aW);
385 hr = IXmlWriter_WriteNmToken(writer,
aW);
391 hr = IXmlWriter_WriteProcessingInstruction(writer,
aW,
aW);
394 hr = IXmlWriter_WriteQualifiedName(writer,
aW,
NULL);
397 hr = IXmlWriter_WriteRaw(writer,
aW);
400 hr = IXmlWriter_WriteRawChars(writer,
aW, 1);
406 hr = IXmlWriter_WriteStartElement(writer,
NULL,
aW,
NULL);
409 hr = IXmlWriter_WriteString(writer,
aW);
415 hr = IXmlWriter_Flush(writer);
416 ok(
hr ==
S_OK,
"Failed to flush, hr %#x.\n",
hr);
421 static const WCHAR utf16W[] = {
'u',
't',
'f',
'-',
'1',
'6',0};
422 static const WCHAR usasciiW[] = {
'u',
's',
'-',
'a',
's',
'c',
'i',
'i',0};
423 static const WCHAR dummyW[] = {
'd',
'u',
'm',
'm',
'y',0};
424 static const WCHAR utf16_outputW[] = {0xfeff,
'<',
'a'};
435 IUnknown_Release(output);
440 hr = IUnknown_QueryInterface(output, &IID_IXmlWriterOutput, (
void**)&unk);
443 ok(unk !=
NULL && unk != output,
"got %p, output %p\n", unk, output);
446 IUnknown_Release(output);
448 IUnknown_Release(output);
453 IUnknown_Release(output);
458 hr = IUnknown_QueryInterface(output, &IID_IXmlWriterOutput, (
void**)&unk);
460 ok(unk !=
NULL,
"got %p\n", unk);
462 IUnknown_Release(output);
463 IUnknown_Release(output);
469 IUnknown_Release(output);
473 ok(
hr ==
S_OK,
"Failed to create writer, hr %#x.\n",
hr);
476 ok(
hr ==
S_OK,
"Failed to create stream, hr %#x.\n",
hr);
479 ok(
hr ==
S_OK,
"Failed to create writer output, hr %#x.\n",
hr);
481 hr = IXmlWriter_SetOutput(writer, output);
482 ok(
hr ==
S_OK,
"Failed to set writer output, hr %#x.\n",
hr);
484 hr = IXmlWriter_WriteStartElement(writer,
NULL,
aW,
NULL);
485 ok(
hr ==
S_OK,
"Write failed, hr %#x.\n",
hr);
487 hr = IXmlWriter_Flush(writer);
488 ok(
hr ==
S_OK,
"Failed to flush, hr %#x.\n",
hr);
493 IUnknown_Release(output);
497 ok(
hr ==
S_OK,
"Failed to create stream, hr %#x.\n",
hr);
501 ok(
hr ==
S_OK,
"Failed to create writer output, hr %#x.\n",
hr);
507 IUnknown_Release(output);
521 IUnknown_Release(output);
523 IXmlWriter_Release(writer);
528 static const char fullprolog[] =
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>";
529 static const char *prologversion2 =
"<?xml version=\"1.0\" encoding=\"uS-asCii\"?>";
530 static const char prologversion[] =
"<?xml version=\"1.0\"?>";
531 static const WCHAR versionW[] = {
'v',
'e',
'r',
's',
'i',
'o',
'n',
'=',
'"',
'1',
'.',
'0',
'"',0};
532 static const WCHAR usasciiW[] = {
'u',
'S',
'-',
'a',
's',
'C',
'i',
'i',0};
533 static const WCHAR xmlW[] = {
'x',
'm',
'l',0};
540 ok(
hr ==
S_OK,
"Expected S_OK, got %08x\n",
hr);
546 hr = IXmlWriter_WriteProcessingInstruction(writer,
xmlW,
versionW);
549 hr = IXmlWriter_Flush(writer);
555 hr = IXmlWriter_Flush(writer);
561 hr = IXmlWriter_Flush(writer);
574 hr = IXmlWriter_WriteProcessingInstruction(writer,
xmlW,
versionW);
584 hr = IXmlWriter_WriteProcessingInstruction(writer,
xmlW,
versionW);
587 hr = IXmlWriter_Flush(writer);
593 IXmlWriter_Release(writer);
604 ok(
hr ==
S_OK,
"Expected S_OK, got %08x\n",
hr);
606 hr = IXmlWriter_SetOutput(writer, output);
612 hr = IXmlWriter_Flush(writer);
618 IXmlWriter_Release(writer);
619 IUnknown_Release(output);
628 ok(
hr ==
S_OK,
"Expected S_OK, got %08x\n",
hr);
637 hr = IXmlWriter_Flush(writer);
642 hr = IXmlWriter_Flush(writer);
648 IXmlWriter_Release(writer);
654 static const char prologversion[] =
"<?xml version=\"1.0\"?>";
655 static const WCHAR versionW[] = {
'v',
'e',
'r',
's',
'i',
'o',
'n',
'=',
'"',
'1',
'.',
'0',
'"',0};
656 static const WCHAR xmlW[] = {
'x',
'm',
'l',0};
664 ok(
hr ==
S_OK,
"Expected S_OK, got %08x\n",
hr);
673 hr = IXmlWriter_Flush(writer);
692 hr = IXmlWriter_WriteProcessingInstruction(writer,
xmlW,
versionW);
695 hr = IXmlWriter_Flush(writer);
703 hr = IXmlWriter_Flush(writer);
711 hr = IXmlWriter_Flush(writer);
717 hr = IXmlWriter_WriteProcessingInstruction(writer,
xmlW,
versionW);
720 hr = IXmlWriter_Flush(writer);
724 IXmlWriter_Release(writer);
729 static const WCHAR piW[] = {0xfeff,
'<',
'?',
'x',
'm',
'l',
' ',
'v',
'e',
'r',
's',
'i',
'o',
'n',
'=',
'"',
'1',
'.',
'0',
'"',
'?',
'>'};
730 static const WCHAR aopenW[] = {0xfeff,
'<',
'a'};
731 static const WCHAR afullW[] = {0xfeff,
'<',
'a',
' ',
'/',
'>'};
732 static const WCHAR versionW[] = {
'v',
'e',
'r',
's',
'i',
'o',
'n',
'=',
'"',
'1',
'.',
'0',
'"',0};
733 static const WCHAR utf16W[] = {
'u',
't',
'f',
'-',
'1',
'6',0};
734 static const WCHAR xmlW[] = {
'x',
'm',
'l',0};
735 static const WCHAR bomW[] = {0xfeff};
749 ok(
hr ==
S_OK,
"Expected S_OK, got %08x\n",
hr);
753 hr = IXmlWriter_SetOutput(writer, output);
760 hr = IXmlWriter_Flush(writer);
766 IUnknown_Release(output);
775 hr = IXmlWriter_SetOutput(writer, output);
778 hr = IXmlWriter_WriteProcessingInstruction(writer,
xmlW,
versionW);
781 hr = IXmlWriter_Flush(writer);
786 IUnknown_Release(output);
796 hr = IXmlWriter_SetOutput(writer, output);
799 hr = IXmlWriter_WriteStartElement(writer,
NULL,
aW,
NULL);
802 hr = IXmlWriter_Flush(writer);
807 IUnknown_Release(output);
817 hr = IXmlWriter_SetOutput(writer, output);
825 hr = IXmlWriter_Flush(writer);
833 IUnknown_Release(output);
836 IXmlWriter_Release(writer);
842 WCHAR *prefixW, *localW, *uriW;
849 hr = IXmlWriter_WriteStartElement(writer, prefixW, localW, uriW);
869 hr = IXmlWriter_WriteElementString(writer, prefixW, localW, uriW,
valueW);
886 hr = IXmlWriter_WriteString(writer,
strW);
901 const char *output_partial;
906 start_element_tests[] =
908 {
"prefix",
"local",
"uri",
"<prefix:local xmlns:prefix=\"uri\" />",
"<prefix:local" },
909 {
NULL,
"local",
"uri",
"<local xmlns=\"uri\" />",
"<local" },
910 {
"",
"local",
"uri",
"<local xmlns=\"uri\" />",
"<local" },
911 {
"",
"local",
"uri",
"<local xmlns=\"uri\" />",
"<local" },
923 static const WCHAR aW[] = {
'a',0};
930 ok(
hr ==
S_OK,
"Expected S_OK, got %08x\n",
hr);
943 hr = IXmlWriter_Flush(writer);
954 hr = IXmlWriter_WriteProcessingInstruction(writer,
aW,
aW);
958 IXmlWriter_Release(writer);
962 ok(
hr ==
S_OK,
"Expected S_OK, got %08x\n",
hr);
970 ok(
hr ==
S_OK,
"Failed to start element, hr %#x.\n",
hr);
973 ok(
hr ==
S_OK,
"Failed to write element string, hr %#x.\n",
hr);
976 ok(
hr ==
S_OK,
"Failed to write element string, hr %#x.\n",
hr);
979 ok(
hr ==
S_OK,
"Failed to start element, hr %#x.\n",
hr);
982 ok(
hr ==
S_OK,
"Failed to start element, hr %#x.\n",
hr);
985 ok(
hr ==
S_OK,
"Failed to start element, hr %#x.\n",
hr);
987 hr = IXmlWriter_Flush(writer);
991 "<prefix:a xmlns:prefix=\"uri\">"
1008 ok(
hr ==
S_OK,
"Failed to start document, hr %#x.\n",
hr);
1011 start_element_tests[
i].
uri);
1012 ok(
hr == start_element_tests[
i].
hr,
"%u: unexpected hr %#x.\n",
i,
hr);
1016 hr = IXmlWriter_Flush(writer);
1017 ok(
hr ==
S_OK,
"Failed to flush, hr %#x.\n",
hr);
1019 check_output(
stream, start_element_tests[
i].output_partial, start_element_tests[
i].todo_partial, __LINE__);
1021 hr = IXmlWriter_WriteEndDocument(writer);
1022 ok(
hr ==
S_OK,
"Failed to end document, hr %#x.\n",
hr);
1024 hr = IXmlWriter_Flush(writer);
1025 ok(
hr ==
S_OK,
"Failed to flush, hr %#x.\n",
hr);
1033 IXmlWriter_Release(writer);
1048 element_string_tests[] =
1050 {
"prefix",
"local",
"uri",
"value",
"<prefix:local xmlns:prefix=\"uri\">value</prefix:local>" },
1051 {
NULL,
"local",
"uri",
"value",
"<local xmlns=\"uri\">value</local>" },
1052 {
"",
"local",
"uri",
"value",
"<local xmlns=\"uri\">value</local>" },
1053 {
"prefix",
"local",
"uri",
NULL,
"<prefix:local xmlns:prefix=\"uri\" />" },
1054 {
NULL,
"local",
"uri",
NULL,
"<local xmlns=\"uri\" />" },
1055 {
"",
"local",
"uri",
NULL,
"<local xmlns=\"uri\" />" },
1057 {
"prefix",
"local",
"uri",
"",
"<prefix:local xmlns:prefix=\"uri\"></prefix:local>" },
1058 {
NULL,
"local",
"uri",
"",
"<local xmlns=\"uri\"></local>" },
1059 {
"",
"local",
"uri",
"",
"<local xmlns=\"uri\"></local>" },
1060 {
NULL,
"local",
NULL,
"",
"<local></local>" },
1061 {
"",
"local",
"http://www.w3.org/2000/xmlns/",
NULL,
"<local xmlns=\"http://www.w3.org/2000/xmlns/\" />" },
1080 ok(
hr ==
S_OK,
"Expected S_OK, got %08x\n",
hr);
1100 ok(
hr ==
S_OK,
"Failed to start element, hr %#x.\n",
hr);
1103 ok(
hr ==
S_OK,
"Failed to write element, hr %#x.\n",
hr);
1106 ok(
hr ==
S_OK,
"Failed to write element, hr %#x.\n",
hr);
1109 ok(
hr ==
S_OK,
"Failed to write element, hr %#x.\n",
hr);
1112 ok(
hr ==
S_OK,
"Failed to write element, hr %#x.\n",
hr);
1115 ok(
hr ==
S_OK,
"Failed to write element, hr %#x.\n",
hr);
1118 ok(
hr ==
S_OK,
"Failed to write element, hr %#x.\n",
hr);
1124 ok(
hr ==
S_OK,
"Failed to write element, hr %#x.\n",
hr);
1126 hr = IXmlWriter_Flush(writer);
1130 "<a><b>value</b><b />"
1131 "<prefix:b xmlns:prefix=\"uri\" />"
1132 "<prefix:c xmlns:prefix=\"uri\">"
1134 "<prefix2:d xmlns:prefix2=\"uri\" />"
1136 "<prefix:f xmlns:prefix=\"uri2\" />"
1137 "<g xmlns=\"uri3\" />"
1139 "<j xmlns=\"uri\" />");
1150 ok(
hr ==
S_OK,
"Failed to start document, hr %#x.\n",
hr);
1153 element_string_tests[
i].
uri, element_string_tests[
i].
value);
1154 ok(
hr == element_string_tests[
i].
hr,
"%u: unexpected hr %#x.\n",
i,
hr);
1158 hr = IXmlWriter_Flush(writer);
1159 ok(
hr ==
S_OK,
"Failed to flush, hr %#x.\n",
hr);
1163 hr = IXmlWriter_WriteEndDocument(writer);
1164 ok(
hr ==
S_OK,
"Failed to end document, hr %#x.\n",
hr);
1166 hr = IXmlWriter_Flush(writer);
1167 ok(
hr ==
S_OK,
"Failed to flush, hr %#x.\n",
hr);
1175 IXmlWriter_Release(writer);
1185 ok(
hr ==
S_OK,
"Expected S_OK, got %08x\n",
hr);
1195 hr = IXmlWriter_WriteEndElement(writer);
1198 hr = IXmlWriter_WriteEndElement(writer);
1201 hr = IXmlWriter_Flush(writer);
1206 IXmlWriter_Release(writer);
1212 static const WCHAR aW[] = {
'a',0};
1213 static const WCHAR bW[] = {
'b',0};
1221 ok(
hr ==
S_OK,
"Expected S_OK, got %08x\n",
hr);
1223 hr = IXmlWriter_WriteEndDocument(writer);
1229 hr = IXmlWriter_WriteEndDocument(writer);
1232 hr = IXmlWriter_WriteEndDocument(writer);
1238 hr = IXmlWriter_WriteStartElement(writer,
NULL,
aW,
NULL);
1244 hr = IXmlWriter_WriteStartElement(writer,
NULL,
aW,
NULL);
1247 hr = IXmlWriter_WriteStartElement(writer,
NULL, bW,
NULL);
1250 hr = IXmlWriter_WriteEndDocument(writer);
1260 hr = IXmlWriter_Flush(writer);
1265 IXmlWriter_Release(writer);
1271 static const WCHAR closeW[] = {
'-',
'-',
'>',0};
1272 static const WCHAR aW[] = {
'a',0};
1273 static const WCHAR bW[] = {
'b',0};
1279 ok(
hr ==
S_OK,
"Expected S_OK, got %08x\n",
hr);
1283 hr = IXmlWriter_WriteComment(writer,
aW);
1291 hr = IXmlWriter_WriteComment(writer,
aW);
1294 hr = IXmlWriter_WriteStartElement(writer,
NULL, bW,
NULL);
1297 hr = IXmlWriter_WriteComment(writer,
aW);
1300 hr = IXmlWriter_WriteComment(writer,
NULL);
1303 hr = IXmlWriter_WriteComment(writer, closeW);
1306 hr = IXmlWriter_Flush(writer);
1311 IXmlWriter_Release(writer);
1317 static const WCHAR closeW[] = {
']',
']',
'>',0};
1318 static const WCHAR close2W[] = {
'a',
']',
']',
'>',
'b',0};
1319 static const WCHAR aW[] = {
'a',0};
1320 static const WCHAR bW[] = {
'b',0};
1326 ok(
hr ==
S_OK,
"Expected S_OK, got %08x\n",
hr);
1330 hr = IXmlWriter_WriteCData(writer,
aW);
1335 hr = IXmlWriter_WriteStartElement(writer,
NULL, bW,
NULL);
1338 hr = IXmlWriter_WriteCData(writer,
aW);
1341 hr = IXmlWriter_WriteCData(writer,
NULL);
1344 hr = IXmlWriter_WriteCData(writer, closeW);
1347 hr = IXmlWriter_WriteCData(writer, close2W);
1350 hr = IXmlWriter_Flush(writer);
1362 IXmlWriter_Release(writer);
1368 static const WCHAR rawW[] = {
'a',
'<',
':',0};
1369 static const WCHAR aW[] = {
'a',0};
1375 ok(
hr ==
S_OK,
"Expected S_OK, got %08x\n",
hr);
1377 hr = IXmlWriter_WriteRaw(writer,
NULL);
1380 hr = IXmlWriter_WriteRaw(writer, rawW);
1385 hr = IXmlWriter_WriteRaw(writer,
NULL);
1388 hr = IXmlWriter_WriteRaw(writer, rawW);
1391 hr = IXmlWriter_WriteRaw(writer, rawW);
1394 hr = IXmlWriter_WriteComment(writer, rawW);
1397 hr = IXmlWriter_WriteRaw(writer, rawW);
1406 hr = IXmlWriter_WriteComment(writer, rawW);
1409 hr = IXmlWriter_WriteEndDocument(writer);
1412 hr = IXmlWriter_WriteRaw(writer, rawW);
1415 hr = IXmlWriter_Flush(writer);
1418 CHECK_OUTPUT(
stream,
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>a<:a<:<!--a<:-->a<:<a>a</a>");
1420 IXmlWriter_Release(writer);
1426 static const WCHAR aW[] = {
'a',0};
1432 ok(
hr ==
S_OK,
"Expected S_OK, got %08x\n",
hr);
1440 hr = IXmlWriter_WriteEndElement(writer);
1449 hr = IXmlWriter_WriteAttributeString(writer,
NULL,
aW,
NULL,
aW);
1458 hr = IXmlWriter_WriteEndDocument(writer);
1467 hr = IXmlWriter_WriteFullEndElement(writer);
1476 hr = IXmlWriter_WriteCData(writer,
aW);
1485 hr = IXmlWriter_WriteName(writer,
aW);
1494 hr = IXmlWriter_WriteNmToken(writer,
aW);
1503 hr = IXmlWriter_WriteString(writer,
aW);
1509 IXmlWriter_Release(writer);
1514 static const WCHAR commentW[] = {
'c',
'o',
'm',
'm',
'e',
'n',
't',0};
1515 static const WCHAR aW[] = {
'a',0};
1516 static const WCHAR bW[] = {
'b',0};
1522 ok(
hr ==
S_OK,
"Expected S_OK, got %08x\n",
hr);
1532 hr = IXmlWriter_WriteStartElement(writer,
NULL,
aW,
NULL);
1535 hr = IXmlWriter_WriteComment(writer,
commentW);
1538 hr = IXmlWriter_WriteStartElement(writer,
NULL, bW,
NULL);
1541 hr = IXmlWriter_WriteEndDocument(writer);
1544 hr = IXmlWriter_Flush(writer);
1549 " <!--comment-->\r\n"
1558 hr = IXmlWriter_WriteStartElement(writer,
NULL,
aW,
NULL);
1561 hr = IXmlWriter_WriteElementString(writer,
NULL, bW,
NULL,
NULL);
1564 hr = IXmlWriter_WriteElementString(writer,
NULL, bW,
NULL,
NULL);
1567 hr = IXmlWriter_WriteEndElement(writer);
1570 hr = IXmlWriter_Flush(writer);
1581 IXmlWriter_Release(writer);
1585 const char *
uri,
const char *
value)
1595 hr = IXmlWriter_WriteAttributeString(writer, prefixW, localW, uriW,
valueW);
1614 const char *output_partial;
1622 {
NULL,
"a",
NULL,
"b",
"<e a=\"b\" />",
"<e a=\"b\"" },
1623 {
"",
"a",
NULL,
"b",
"<e a=\"b\" />",
"<e a=\"b\"" },
1624 {
NULL,
"a",
"",
"b",
"<e a=\"b\" />",
"<e a=\"b\"" },
1625 {
"",
"a",
"",
"b",
"<e a=\"b\" />",
"<e a=\"b\"" },
1626 {
"prefix",
"local",
"uri",
"b",
"<e prefix:local=\"b\" xmlns:prefix=\"uri\" />",
"<e prefix:local=\"b\"" },
1627 {
NULL,
"a",
"http://www.w3.org/2000/xmlns/",
"defuri",
"<e xmlns:a=\"defuri\" />",
"<e xmlns:a=\"defuri\"" },
1628 {
"xmlns",
"a",
NULL,
"uri",
"<e xmlns:a=\"uri\" />",
"<e xmlns:a=\"uri\"" },
1629 {
"xmlns",
"a",
"",
"uri",
"<e xmlns:a=\"uri\" />",
"<e xmlns:a=\"uri\"" },
1630 {
"prefix",
"xmlns",
"uri",
"value",
"<e prefix:xmlns=\"value\" xmlns:prefix=\"uri\" />",
"<e prefix:xmlns=\"value\"" },
1631 {
"prefix",
"xmlns",
"uri",
NULL,
"<e prefix:xmlns=\"\" xmlns:prefix=\"uri\" />",
"<e prefix:xmlns=\"\"" },
1632 {
"prefix",
"xmlns",
"uri",
"",
"<e prefix:xmlns=\"\" xmlns:prefix=\"uri\" />",
"<e prefix:xmlns=\"\"" },
1633 {
"prefix",
"xmlns",
NULL,
"uri",
"<e xmlns=\"uri\" />",
"<e xmlns=\"uri\"" },
1634 {
"prefix",
"xmlns",
"",
"uri",
"<e xmlns=\"uri\" />",
"<e xmlns=\"uri\"" },
1635 {
"xml",
"space",
NULL,
"preserve",
"<e xml:space=\"preserve\" />",
"<e xml:space=\"preserve\"" },
1636 {
"xml",
"space",
"",
"preserve",
"<e xml:space=\"preserve\" />",
"<e xml:space=\"preserve\"" },
1637 {
"xml",
"space",
NULL,
"default",
"<e xml:space=\"default\" />",
"<e xml:space=\"default\"" },
1638 {
"xml",
"space",
"",
"default",
"<e xml:space=\"default\" />",
"<e xml:space=\"default\"" },
1639 {
"xml",
"a",
NULL,
"value",
"<e xml:a=\"value\" />",
"<e xml:a=\"value\"" },
1640 {
"xml",
"a",
"",
"value",
"<e xml:a=\"value\" />",
"<e xml:a=\"value\"" },
1643 {
NULL,
"a",
"defuri",
NULL,
"<e p1:a=\"\" xmlns:p1=\"defuri\" />",
"<e p1:a=\"\"",
S_OK, 1, 1, 1 },
1644 {
NULL,
"a",
"defuri",
"b",
"<e p1:a=\"b\" xmlns:p1=\"defuri\" />",
"<e p1:a=\"b\"",
S_OK, 1, 1, 1 },
1645 {
"",
"a",
"defuri",
NULL,
"<e p1:a=\"\" xmlns:p1=\"defuri\" />",
"<e p1:a=\"\"",
S_OK, 1, 1, 1 },
1646 {
NULL,
"a",
"defuri",
"",
"<e p1:a=\"\" xmlns:p1=\"defuri\" />",
"<e p1:a=\"\"",
S_OK, 1, 1, 1 },
1647 {
"",
"a",
"defuri",
"b",
"<e p1:a=\"b\" xmlns:p1=\"defuri\" />",
"<e p1:a=\"b\"",
S_OK, 1, 1, 1 },
1651 {
"",
"a",
"http://www.w3.org/2000/xmlns/",
"defuri",
"<e />",
"<e",
WR_E_XMLNSPREFIXDECLARATION, 1, 1, 1 },
1652 {
"",
NULL,
"http://www.w3.org/2000/xmlns/",
"defuri",
"<e />",
"<e",
E_INVALIDARG },
1653 {
"",
"",
"http://www.w3.org/2000/xmlns/",
"defuri",
"<e />",
"<e",
E_INVALIDARG, 1, 1, 1 },
1654 {
NULL,
"",
"http://www.w3.org/2000/xmlns/",
"defuri",
"<e />",
"<e",
E_INVALIDARG, 1, 1, 1 },
1655 {
"prefix",
"a",
"http://www.w3.org/2000/xmlns/",
"defuri",
"<e />",
"<e",
WR_E_XMLNSURIDECLARATION, 1, 1, 1 },
1656 {
"prefix",
NULL,
"http://www.w3.org/2000/xmlns/",
"defuri",
"<e />",
"<e",
E_INVALIDARG },
1662 {
NULL,
"xmlns",
"uri",
NULL,
"<e />",
"<e",
WR_E_XMLNSPREFIXDECLARATION, 0, 0, 1 },
1663 {
"xmlns",
NULL,
"uri",
NULL,
"<e />",
"<e",
WR_E_XMLNSPREFIXDECLARATION, 0, 0, 1 },
1686 ok(
hr ==
S_OK,
"Expected S_OK, got %08x\n",
hr);
1695 ok(
hr ==
S_OK,
"Failed to start document, hr %#x.\n",
hr);
1698 ok(
hr ==
S_OK,
"Failed to start element, hr %#x.\n",
hr);
1701 attribute_tests[
i].
uri, attribute_tests[
i].
value);
1703 ok(
hr == attribute_tests[
i].
hr,
"%u: unexpected hr %#x, expected %#x.\n",
i,
hr, attribute_tests[
i].
hr);
1705 hr = IXmlWriter_Flush(writer);
1706 ok(
hr ==
S_OK,
"Failed to flush, hr %#x.\n",
hr);
1708 check_output(
stream, attribute_tests[
i].output_partial, attribute_tests[
i].todo_partial, __LINE__);
1710 hr = IXmlWriter_WriteEndDocument(writer);
1711 ok(
hr ==
S_OK,
"Failed to end document, hr %#x.\n",
hr);
1713 hr = IXmlWriter_Flush(writer);
1714 ok(
hr ==
S_OK,
"Failed to flush, hr %#x.\n",
hr);
1739 ok(
hr ==
S_OK,
"Failed to write attribute string, hr %#x.\n",
hr);
1749 ok(
hr ==
S_OK,
"Failed to write attribute string, hr %#x.\n",
hr);
1752 ok(
hr ==
S_OK,
"Failed to write attribute string, hr %#x.\n",
hr);
1754 hr = IXmlWriter_WriteEndDocument(writer);
1757 hr = IXmlWriter_Flush(writer);
1761 "<p:a prefix:local=\"b\" a=\"b\" xmlns:prefix=\"uri\" p:attr=\"value\" xmlns:p=\"outeruri\">"
1762 "<b p:attr2=\"value\" pr:attr3=\"value\" xmlns:pr=\"outeruri\" />"
1782 hr = IXmlWriter_WriteEndDocument(writer);
1785 hr = IXmlWriter_Flush(writer);
1789 "<e xmlns:prefix=\"uri\" prefix:attr=\"value\" />");
1793 IXmlWriter_Release(writer);
1798 static const WCHAR aW[] = {
'a',0};
1804 ok(
hr ==
S_OK,
"Expected S_OK, got %08x\n",
hr);
1815 hr = IXmlWriter_WriteStartElement(writer,
NULL,
aW,
NULL);
1818 hr = IXmlWriter_WriteFullEndElement(writer);
1821 hr = IXmlWriter_WriteEndDocument(writer);
1824 hr = IXmlWriter_Flush(writer);
1840 hr = IXmlWriter_WriteStartElement(writer,
NULL,
aW,
NULL);
1843 hr = IXmlWriter_WriteStartElement(writer,
NULL,
aW,
NULL);
1846 hr = IXmlWriter_WriteFullEndElement(writer);
1849 hr = IXmlWriter_WriteEndDocument(writer);
1852 hr = IXmlWriter_Flush(writer);
1860 IXmlWriter_Release(writer);
1866 static const WCHAR aW[] = {
'a',0};
1872 ok(
hr ==
S_OK,
"Expected S_OK, got %08x\n",
hr);
1882 hr = IXmlWriter_WriteStartElement(writer,
NULL,
aW,
NULL);
1885 hr = IXmlWriter_WriteCharEntity(writer, 0x100);
1888 hr = IXmlWriter_WriteStartElement(writer,
NULL,
aW,
NULL);
1891 hr = IXmlWriter_WriteEndDocument(writer);
1894 hr = IXmlWriter_Flush(writer);
1898 "<a>Ā<a /></a>");
1900 IXmlWriter_Release(writer);
1911 ok(
hr ==
S_OK,
"Expected S_OK, got %08x\n",
hr);
1942 hr = IXmlWriter_Flush(writer);
1946 "<b>a<&\">=");
1957 hr = IXmlWriter_Flush(writer);
1966 hr = IXmlWriter_Flush(writer);
1973 IXmlWriter_Release(writer);
1977 ok(
hr ==
S_OK,
"Failed to create a writer, hr %#x.\n",
hr);
1984 ok(
hr ==
S_OK,
"Failed to start element, hr %#x.\n",
hr);
1987 ok(
hr ==
S_OK,
"Failed to start element, hr %#x.\n",
hr);
1990 ok(
hr ==
S_OK,
"Failed to write a string, hr %#x.\n",
hr);
1992 hr = IXmlWriter_Flush(writer);
1993 ok(
hr ==
S_OK,
"Failed to flush, hr %#x.\n",
hr);
1999 hr = IXmlWriter_WriteFullEndElement(writer);
2000 ok(
hr ==
S_OK,
"Failed to end element, hr %#x.\n",
hr);
2002 hr = IXmlWriter_Flush(writer);
2003 ok(
hr ==
S_OK,
"Failed to flush, hr %#x.\n",
hr);
2009 hr = IXmlWriter_WriteFullEndElement(writer);
2010 ok(
hr ==
S_OK,
"Failed to end element, hr %#x.\n",
hr);
2012 hr = IXmlWriter_Flush(writer);
2013 ok(
hr ==
S_OK,
"Failed to flush, hr %#x.\n",
hr);
2025 ok(
hr ==
S_OK,
"Failed to start element, hr %#x.\n",
hr);
2028 ok(
hr ==
S_OK,
"Failed to start element, hr %#x.\n",
hr);
2030 hr = IXmlWriter_WriteEndElement(writer);
2031 ok(
hr ==
S_OK,
"Failed to end element, hr %#x.\n",
hr);
2033 hr = IXmlWriter_Flush(writer);
2034 ok(
hr ==
S_OK,
"Failed to flush, hr %#x.\n",
hr);
2041 ok(
hr ==
S_OK,
"Failed to start element, hr %#x.\n",
hr);
2044 ok(
hr ==
S_OK,
"Failed to write attribute string, hr %#x.\n",
hr);
2046 hr = IXmlWriter_Flush(writer);
2047 ok(
hr ==
S_OK,
"Failed to flush, hr %#x.\n",
hr);
2052 " <c attr=\"value\"");
2055 ok(
hr ==
S_OK,
"Failed to write a string, hr %#x.\n",
hr);
2057 hr = IXmlWriter_Flush(writer);
2058 ok(
hr ==
S_OK,
"Failed to flush, hr %#x.\n",
hr);
2063 " <c attr=\"value\">text");
2065 hr = IXmlWriter_WriteEndElement(writer);
2066 ok(
hr ==
S_OK,
"Failed to end element, hr %#x.\n",
hr);
2068 hr = IXmlWriter_Flush(writer);
2069 ok(
hr ==
S_OK,
"Failed to flush, hr %#x.\n",
hr);
2074 " <c attr=\"value\">text</c>");
2077 ok(
hr ==
S_OK,
"Failed to start element, hr %#x.\n",
hr);
2080 ok(
hr ==
S_OK,
"Failed to write a string, hr %#x.\n",
hr);
2082 hr = IXmlWriter_WriteEndElement(writer);
2083 ok(
hr ==
S_OK,
"Failed to end element, hr %#x.\n",
hr);
2085 hr = IXmlWriter_Flush(writer);
2086 ok(
hr ==
S_OK,
"Failed to flush, hr %#x.\n",
hr);
2091 " <c attr=\"value\">text</c>\r\n"
2094 hr = IXmlWriter_WriteEndElement(writer);
2095 ok(
hr ==
S_OK,
"Failed to end element, hr %#x.\n",
hr);
2097 hr = IXmlWriter_Flush(writer);
2098 ok(
hr ==
S_OK,
"Failed to flush, hr %#x.\n",
hr);
2103 " <c attr=\"value\">text</c>\r\n"
2107 IXmlWriter_Release(writer);
2122 hr = IXmlWriter_WriteDocType(writer,
nameW, pubidW, sysidW, subsetW);
2144 {
"a",
"",
NULL,
NULL,
"<!DOCTYPE a PUBLIC \"\" \"\">" },
2146 {
"a",
NULL,
"",
NULL,
"<!DOCTYPE a SYSTEM \"\">" },
2147 {
"a",
"",
"",
NULL,
"<!DOCTYPE a PUBLIC \"\" \"\">" },
2148 {
"a",
"pubid",
"",
NULL,
"<!DOCTYPE a PUBLIC \"pubid\" \"\">" },
2149 {
"a",
"pubid",
NULL,
NULL,
"<!DOCTYPE a PUBLIC \"pubid\" \"\">" },
2150 {
"a",
"",
"sysid",
NULL,
"<!DOCTYPE a PUBLIC \"\" \"sysid\">" },
2151 {
"a",
NULL,
NULL,
"",
"<!DOCTYPE a []>" },
2152 {
"a",
NULL,
NULL,
"subset",
"<!DOCTYPE a [subset]>" },
2153 {
"a",
"",
NULL,
"subset",
"<!DOCTYPE a PUBLIC \"\" \"\" [subset]>" },
2154 {
"a",
NULL,
"",
"subset",
"<!DOCTYPE a SYSTEM \"\" [subset]>" },
2155 {
"a",
"",
"",
"subset",
"<!DOCTYPE a PUBLIC \"\" \"\" [subset]>" },
2156 {
"a",
"pubid",
NULL,
"subset",
"<!DOCTYPE a PUBLIC \"pubid\" \"\" [subset]>" },
2157 {
"a",
"pubid",
"",
"subset",
"<!DOCTYPE a PUBLIC \"pubid\" \"\" [subset]>" },
2158 {
"a",
NULL,
"sysid",
"subset",
"<!DOCTYPE a SYSTEM \"sysid\" [subset]>" },
2159 {
"a",
"",
"sysid",
"subset",
"<!DOCTYPE a PUBLIC \"\" \"sysid\" [subset]>" },
2160 {
"a",
"pubid",
"sysid",
"subset",
"<!DOCTYPE a PUBLIC \"pubid\" \"sysid\" [subset]>" },
2162 static const WCHAR pubidW[] = {
'p',0x100,
'i',
'd',0};
2171 ok(
hr ==
S_OK,
"Failed to create writer instance, hr %#x.\n",
hr);
2186 hr = IXmlWriter_WriteDocType(writer,
aW, pubidW,
NULL,
NULL);
2196 doctype_tests[
i].subset);
2197 ok(
hr ==
S_OK,
"%u: failed to write doctype, hr %#x.\n",
i,
hr);
2199 hr = IXmlWriter_Flush(writer);
2200 ok(
hr ==
S_OK,
"Failed to flush, hr %#x.\n",
hr);
2205 doctype_tests[
i].subset);
2211 IXmlWriter_Release(writer);
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
ACPI_SIZE strlen(const char *String)
int strncmp(const char *String1, const char *String2, ACPI_SIZE Count)
static void * heap_alloc(size_t len)
static BOOL heap_free(void *mem)
static const WCHAR nameW[]
#define MultiByteToWideChar
static const WCHAR valueW[]
HRESULT WINAPI GetHGlobalFromStream(IStream *pstm, HGLOBAL *phglobal)
HRESULT WINAPI CreateStreamOnHGlobal(HGLOBAL hGlobal, BOOL fDeleteOnRelease, LPSTREAM *ppstm)
static const WCHAR versionW[]
static const WCHAR commentW[]
static const WCHAR usasciiW[]
HRESULT WINAPI CreateXmlWriter(REFIID riid, void **obj, IMalloc *imalloc)
HRESULT WINAPI CreateXmlWriterOutputWithEncodingCodePage(IUnknown *stream, IMalloc *imalloc, UINT codepage, IXmlWriterOutput **out)
HRESULT WINAPI CreateXmlWriterOutputWithEncodingName(IUnknown *stream, IMalloc *imalloc, const WCHAR *encoding, IXmlWriterOutput **out)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u
LPVOID NTAPI GlobalLock(HGLOBAL hMem)
BOOL NTAPI GlobalUnlock(HGLOBAL hMem)
SIZE_T NTAPI GlobalSize(HGLOBAL hMem)
static const WCHAR emptyW[]
static HMODULE MODULEINFO DWORD cb
#define todo_wine_if(is_todo)
static const WCHAR dummyW[]
ssize_t pread(int fd, void *buf, size_t count, off_t offset)
static HRESULT write_element_string(IXmlWriter *writer, const char *prefix, const char *local, const char *uri, const char *value)
static void test_writer_state(void)
static void test_writeroutput(void)
static HRESULT WINAPI teststream_QueryInterface(ISequentialStream *iface, REFIID riid, void **obj)
static void test_WriteStartElement(void)
static HRESULT write_start_element(IXmlWriter *writer, const char *prefix, const char *local, const char *uri)
static void check_output_raw(IStream *stream, const void *expected, SIZE_T size, int line)
static void test_indentation(void)
static HRESULT WINAPI teststream_Write(ISequentialStream *iface, const void *pv, ULONG cb, ULONG *written)
static void test_writestartdocument(void)
static void test_writeenddocument(void)
static ISequentialStream teststream
static HRESULT write_doctype(IXmlWriter *writer, const char *name, const char *pubid, const char *sysid, const char *subset)
static ULONG WINAPI teststream_AddRef(ISequentialStream *iface)
static const IUnknownVtbl testoutputvtbl
static IUnknown testoutput
static void _expect_ref(IUnknown *obj, ULONG ref, int line)
static HRESULT write_attribute_string(IXmlWriter *writer, const char *prefix, const char *local, const char *uri, const char *value)
static HRESULT write_string(IXmlWriter *writer, const char *str)
static void check_output(IStream *stream, const char *expected, BOOL todo, int line)
static void test_WriteComment(void)
static void test_omitxmldeclaration(void)
static void test_invalid_output_encoding(IXmlWriter *writer, IUnknown *output)
#define CHECK_OUTPUT_TODO(stream, expected)
static void test_WriteRaw(void)
static ULONG WINAPI testoutput_Release(IUnknown *iface)
static const ISequentialStreamVtbl teststreamvtbl
static void test_bom(void)
static IStream * writer_set_output(IXmlWriter *writer)
static void test_flush(void)
static void test_WriteDocType(void)
static void test_WriteString(void)
#define CHECK_OUTPUT_RAW(stream, expected, size)
static ULONG WINAPI teststream_Release(ISequentialStream *iface)
static void test_WriteElementString(void)
static HRESULT WINAPI teststream_Read(ISequentialStream *iface, void *pv, ULONG cb, ULONG *pread)
#define EXPECT_REF(obj, ref)
#define CHECK_OUTPUT(stream, expected)
static void test_WriteCData(void)
static ULONG WINAPI testoutput_AddRef(IUnknown *iface)
static void test_WriteFullEndElement(void)
static WCHAR * strdupAtoW(const char *str)
static void check_writer_state(IXmlWriter *writer, HRESULT exp_hr)
static void test_WriteAttributeString(void)
static void writer_set_property(IXmlWriter *writer, XmlWriterProperty property)
static void test_WriteCharEntity(void)
static HRESULT WINAPI testoutput_QueryInterface(IUnknown *iface, REFIID riid, void **obj)
static void test_WriteEndElement(void)
static void test_writer_create(void)
static const WCHAR xmlW[]
static const WCHAR utf16W[]
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8)
#define IsEqualGUID(rguid1, rguid2)
#define IsEqualIID(riid1, riid2)
static __inline const char * wine_dbgstr_guid(const GUID *id)
Character const *const prefix
@ WR_E_XMLPREFIXDECLARATION
@ WR_E_DUPLICATEATTRIBUTE
@ WR_E_XMLNSURIDECLARATION
@ WR_E_XMLNSPREFIXDECLARATION
@ WR_E_NSPREFIXWITHEMPTYNSURI
@ XmlWriterProperty_ConformanceLevel
@ XmlWriterProperty_OmitXmlDeclaration
@ XmlWriterProperty_ByteOrderMark
@ XmlWriterProperty_Indent
@ XmlConformanceLevel_Document
@ XmlConformanceLevel_Auto