30#undef CLSID_DOMDocument
39L"<?xml version='1.0'?>"
40"<Schema xmlns='urn:schemas-microsoft-com:xml-data'"
41" xmlns:dt='urn:schemas-microsoft-com:datatypes'"
43" <ElementType name='x' dt:type='boolean'/>"
44" <ElementType name='y'>"
45" <datatype dt:type='int'/>"
47" <ElementType name='z'/>"
48" <ElementType name='root' content='eltOnly' model='open' order='seq'>"
57L"<?xml version='1.0'?>"
58"<Schema xmlns='urn:schemas-microsoft-com:xml-data'"
59" xmlns:dt='urn:schemas-microsoft-com:datatypes'"
61" <ElementType name='x' dt:type='bin.base64'/>"
62" <ElementType name='y' dt:type='uuid'/>"
63" <ElementType name='z'/>"
64" <ElementType name='root' content='eltOnly' model='closed' order='one'>"
73L"<?xml version='1.0'?>"
74"<Schema xmlns='urn:schemas-microsoft-com:xml-data'"
75" xmlns:dt='urn:schemas-microsoft-com:datatypes'"
77" <ElementType name='root' content='textOnly' model='open'>"
78" <AttributeType name='x' dt:type='int'/>"
79" <AttributeType name='y' dt:type='enumeration' dt:values='a b c'/>"
80" <AttributeType name='z' dt:type='uuid'/>"
81" <attribute type='x'/>"
82" <attribute type='y'/>"
83" <attribute type='z'/>"
90L"<Schema xmlns='urn:schemas-microsoft-com:xml-data'\n"
91" xmlns:dt='urn:schemas-microsoft-com:datatypes'>\n"
92" <ElementType name='base64Data' content='textOnly' dt:type='bin.base64'/>\n"
93" <ElementType name='hexData' content='textOnly' dt:type='bin.hex'/>\n"
94" <ElementType name='boolData' content='textOnly' dt:type='boolean'/>\n"
95" <ElementType name='charData' content='textOnly' dt:type='char'/>\n"
96" <ElementType name='dateData' content='textOnly' dt:type='date'/>\n"
97" <ElementType name='dateTimeData' content='textOnly' dt:type='dateTime'/>\n"
98" <ElementType name='dateTimeTzData' content='textOnly' dt:type='dateTime.tz'/>\n"
99" <ElementType name='entityData' content='textOnly' dt:type='entity'/>\n"
100" <ElementType name='entitiesData' content='textOnly' dt:type='entities'/>\n"
101" <ElementType name='fixedData' content='textOnly' dt:type='fixed.14.4'/>\n"
102" <ElementType name='floatData' content='textOnly' dt:type='float'/>\n"
103" <ElementType name='i1Data' content='textOnly' dt:type='i1'/>\n"
104" <ElementType name='i2Data' content='textOnly' dt:type='i2'/>\n"
105" <ElementType name='i4Data' content='textOnly' dt:type='i4'/>\n"
106" <ElementType name='i8Data' content='textOnly' dt:type='i8'/>\n"
107" <ElementType name='intData' content='textOnly' dt:type='int'/>\n"
108" <ElementType name='nmtokData' content='textOnly' dt:type='nmtoken'/>\n"
109" <ElementType name='nmtoksData' content='textOnly' dt:type='nmtokens'/>\n"
110" <ElementType name='numData' content='textOnly' dt:type='number'/>\n"
111" <ElementType name='r4Data' content='textOnly' dt:type='r4'/>\n"
112" <ElementType name='r8Data' content='textOnly' dt:type='r8'/>\n"
113" <ElementType name='stringData' content='textOnly' dt:type='string'/>\n"
114" <ElementType name='timeData' content='textOnly' dt:type='time'/>\n"
115" <ElementType name='timeTzData' content='textOnly' dt:type='time.tz'/>\n"
116" <ElementType name='u1Data' content='textOnly' dt:type='ui1'/>\n"
117" <ElementType name='u2Data' content='textOnly' dt:type='ui2'/>\n"
118" <ElementType name='u4Data' content='textOnly' dt:type='ui4'/>\n"
119" <ElementType name='u8Data' content='textOnly' dt:type='ui8'/>\n"
120" <ElementType name='uriData' content='textOnly' dt:type='uri'/>\n"
121" <ElementType name='uuidData' content='textOnly' dt:type='uuid'/>\n"
123" <ElementType name='Name' content='textOnly' dt:type='nmtoken'/>\n"
124" <ElementType name='Value' content='eltOnly' order='many'>\n"
125" <element type='base64Data'/>\n"
126" <element type='hexData'/>\n"
127" <element type='boolData'/>\n"
128" <element type='charData'/>\n"
129" <element type='dateData'/>\n"
130" <element type='dateTimeData'/>\n"
131" <element type='dateTimeTzData'/>\n"
132" <element type='entityData'/>\n"
133" <element type='entitiesData'/>\n"
134" <element type='fixedData'/>\n"
135" <element type='floatData'/>\n"
136" <element type='i1Data'/>\n"
137" <element type='i2Data'/>\n"
138" <element type='i4Data'/>\n"
139" <element type='i8Data'/>\n"
140" <element type='intData'/>\n"
141" <element type='nmtokData'/>\n"
142" <element type='nmtoksData'/>\n"
143" <element type='numData'/>\n"
144" <element type='r4Data'/>\n"
145" <element type='r8Data'/>\n"
146" <element type='stringData'/>\n"
147" <element type='timeData'/>\n"
148" <element type='timeTzData'/>\n"
149" <element type='u1Data'/>\n"
150" <element type='u2Data'/>\n"
151" <element type='u4Data'/>\n"
152" <element type='u8Data'/>\n"
153" <element type='uriData'/>\n"
154" <element type='uuidData'/>\n"
156" <ElementType name='Property' content='eltOnly' order='seq'>\n"
157" <element type='Name'/>\n"
158" <element type='Value'/>\n"
160" <ElementType name='Properties' content='eltOnly'>\n"
161" <element type='Property' minOccurs='0' maxOccurs='*'/>\n"
166L"<?xml version='1.0'?>\n"
167"<Properties xmlns='urn:x-schema:datatype-test-xdr'>\n"
169" <Name>testBase64</Name>\n"
171" <base64Data>+HugeNumber+</base64Data>\n"
175" <Name>testHex</Name>\n"
177" <hexData>deadbeef</hexData>\n"
181" <Name>testBool</Name>\n"
183" <boolData>1</boolData>\n"
187" <Name>testChar</Name>\n"
189" <charData>u</charData>\n"
193" <Name>testDate</Name>\n"
195" <dateData>1998-02-01</dateData>\n"
199" <Name>testDateTime</Name>\n"
201" <dateTimeData>1998-02-01T12:34:56</dateTimeData>\n"
205" <Name>testDateTimeTz</Name>\n"
207" <dateTimeTzData>1998-02-01T12:34:56-06:00</dateTimeTzData>\n"
211" <Name>testFixed</Name>\n"
213" <fixedData>3.1416</fixedData>\n"
217" <Name>testFloat</Name>\n"
219" <floatData>3.14159</floatData>\n"
223" <Name>testI1</Name>\n"
225" <i1Data>42</i1Data>\n"
229" <Name>testI2</Name>\n"
231" <i2Data>420</i2Data>\n"
235" <Name>testI4</Name>\n"
237" <i4Data>-420000000</i4Data>\n"
241" <Name>testI8</Name>\n"
243" <i8Data>-4200000000</i8Data>\n"
247" <Name>testInt</Name>\n"
249" <intData>42</intData>\n"
253" <Name>testNmtoken</Name>\n"
255" <nmtokData>tok1</nmtokData>\n"
259" <Name>testNmtokens</Name>\n"
261" <nmtoksData>tok1 tok2 tok3</nmtoksData>\n"
265" <Name>testNumber</Name>\n"
267" <numData>3.14159</numData>\n"
271" <Name>testR4</Name>\n"
273" <r4Data>3.14159265</r4Data>\n"
277" <Name>testR8</Name>\n"
279" <r8Data>3.14159265358979323846</r8Data>\n"
283" <Name>testString</Name>\n"
285" <stringData>foo bar</stringData>\n"
289" <Name>testTime</Name>\n"
291" <timeData>12:34:56</timeData>\n"
295" <Name>testTimeTz</Name>\n"
297" <timeTzData>12:34:56-06:00</timeTzData>\n"
301" <Name>testU1</Name>\n"
303" <u1Data>255</u1Data>\n"
307" <Name>testU2</Name>\n"
309" <u2Data>65535</u2Data>\n"
313" <Name>testU4</Name>\n"
315" <u4Data>4294967295</u4Data>\n"
319" <Name>testU8</Name>\n"
321" <u8Data>18446744073709551615</u8Data>\n"
325" <Name>testURI</Name>\n"
327" <uriData>urn:schemas-microsoft-com:datatypes</uriData>\n"
331" <Name>testUUID</Name>\n"
333" <uuidData>2933BF81-7B36-11D2-B20E-00C04F983E60</uuidData>\n"
339L"<Schema xmlns='urn:schemas-microsoft-com:xml-data'>\n"
340" <ElementType name='w' content='empty' model='closed'/>\n"
341" <ElementType name='x' content='empty' model='closed'/>\n"
342" <ElementType name='y' content='empty' model='closed'/>\n"
343" <ElementType name='z' content='empty' model='closed'/>\n"
344" <ElementType name='test' content='eltOnly' model='open' order='seq'>\n"
345" <element type='x'/>\n"
346" <group order='seq'>\n"
347" <element type='x'/>\n"
348" <element type='y'/>\n"
349" <element type='z'/>\n"
351" <element type='z'/>\n"
363 return IUnknown_Release((
IUnknown *)iface);
366#define _expect64(expr, str, base, TYPE, CONV) { \
368 TYPE v2 = CONV(str, NULL, base); \
369 ok(v1 == v2, #expr "returned %s, expected %s\n", \
370 wine_dbgstr_longlong(v1), wine_dbgstr_longlong(v2)); \
373#define expect_int64(expr, x, base) _expect64(expr, #x, base, LONG64, strtoll)
374#define expect_uint64(expr, x, base) _expect64(expr, #x, base, ULONG64, strtoull)
414#define _create(cls) cls, #cls
416#define create_document(iid) _create_object(&_create(CLSID_DOMDocument), iid, __LINE__)
418#define create_document_version(v, iid) _create_object(&_create(CLSID_DOMDocument ## v), iid, __LINE__)
420#define create_cache(iid) _create_object(&_create(CLSID_XMLSchemaCache), iid, __LINE__)
422#define create_cache_version(v, iid) _create_object(&_create(CLSID_XMLSchemaCache ## v), iid, __LINE__)
426 static const WCHAR xdr_schema_xml[] =
427 L"<Schema xmlns=\"urn:schemas-microsoft-com:xml-data\"\nxmlns:dt=\"urn:schemas-microsoft-com:datatypes\">\n</Schema>\n";
428 IXMLDOMDocument2 *doc;
430 IXMLDOMSchemaCollection *
cache;
444 IXMLDOMDocument2_Release(doc);
450 hr = IXMLDOMDocument2_loadXML(doc,
str, &
b);
452 ok(
b == VARIANT_TRUE,
"b %04x\n",
b);
455 node = (
void*)0xdeadbeef;
464 hr = IXMLDOMSchemaCollection_get_length(
cache, &
len);
466 ok(
len == 1,
"Unexpected length %ld.\n",
len);
469 hr = IXMLDOMSchemaCollection_get_namespaceURI(
cache, 0, &
str);
481 IXMLDOMNode_Release(
node);
491 IXMLDOMNode_Release(
node);
498 hr = IXMLDOMSchemaCollection_get_length(
cache, &
len);
500 ok(
len == 0,
"Unexpected length %ld.\n",
len);
509 hr = IXMLDOMSchemaCollection_get_length(
cache, &
len);
511 ok(
len == 1,
"Unexpected length %ld.\n",
len);
516 hr = IXMLDOMSchemaCollection_get_length(
cache, &
len);
518 ok(
len == 0,
"Unexpected length %ld.\n",
len);
526 ok(refcount == 1,
"Unexpected refcount %ld.\n", refcount);
531 hr = IXMLDOMDocument2_get_schemas(doc, &
v);
535 refcount = IXMLDOMSchemaCollection_AddRef(
cache);
536 ok(refcount == 2,
"Unexpected refcount %ld.\n", refcount);
541 hr = IXMLDOMDocument2_putref_schemas(doc,
v);
544 ok(refcount == 3,
"Unexpected refcount %ld.\n", refcount);
550 hr = IXMLDOMDocument2_get_schemas(doc, &
v);
554 ok(refcount == 3,
"Unexpected refcount %ld.\n", refcount);
557 hr = IXMLDOMDocument2_get_schemas(doc, &
v);
561 ok(refcount == 4,
"Unexpected refcount %ld.\n", refcount);
564 refcount = IXMLDOMSchemaCollection_Release(
cache);
565 ok(refcount == 3,
"Unexpected refcount %ld.\n", refcount);
566 refcount = IXMLDOMSchemaCollection_Release(
cache);
567 ok(refcount == 2,
"Unexpected refcount %ld.\n", refcount);
570 refcount = IXMLDOMDocument2_AddRef(doc);
571 ok(refcount == 2,
"Unexpected refcount %ld.\n", refcount);
573 ok(refcount == 2,
"Unexpected refcount %ld.\n", refcount);
574 refcount = IXMLDOMDocument2_Release(doc);
575 ok(refcount == 1,
"Unexpected refcount %ld.\n", refcount);
579 hr = IXMLDOMDocument2_putref_schemas(doc,
v);
582 ok(refcount == 2,
"Unexpected refcount %ld.\n", refcount);
586 hr = IXMLDOMDocument2_putref_schemas(doc,
v);
589 ok(refcount == 1,
"Unexpected refcount %ld.\n", refcount);
592 refcount = IXMLDOMSchemaCollection_AddRef(
cache);
593 ok(refcount == 2,
"Unexpected refcount %ld.\n", refcount);
596 hr = IXMLDOMDocument2_putref_schemas(doc,
v);
599 ok(refcount == 3,
"Unexpected refcount %ld.\n", refcount);
605 hr = IXMLDOMDocument2_putref_schemas(doc,
v);
608 ok(refcount == 1,
"Unexpected refcount %ld.\n", refcount);
612 refcount = IXMLDOMSchemaCollection_AddRef(
cache);
613 ok(refcount == 2,
"Unexpected refcount %ld.\n", refcount);
616 hr = IXMLDOMDocument2_putref_schemas(doc,
v);
619 ok(refcount == 3,
"Unexpected refcount %ld.\n", refcount);
624 refcount = IXMLDOMDocument2_Release(doc);
625 ok(!refcount,
"Unexpected refcount %ld.\n", refcount);
628 ok(refcount == 1,
"Unexpected refcount %ld.\n", refcount);
629 refcount = IXMLDOMSchemaCollection_Release(
cache);
630 ok(!refcount,
"Unexpected refcount %ld.\n", refcount);
635 IXMLDOMDocument2 *schema1, *schema2, *schema3;
636 IXMLDOMSchemaCollection *cache1, *cache2, *cache3;
642 ok(schema1 !=
NULL,
"Failed to create a document.\n");
645 ok(cache1 !=
NULL,
"Failed to create schema collection.\n");
647 if (!schema1 || !cache1)
650 IXMLDOMDocument2_Release(schema1);
652 IXMLDOMSchemaCollection_Release(cache1);
664 ok(
b == VARIANT_TRUE,
"failed to load XML\n");
668 ok(
b == VARIANT_TRUE,
"failed to load XML\n");
672 ok(
b == VARIANT_TRUE,
"failed to load XML\n");
681 refcount = IXMLDOMDocument2_Release(schema1);
682 ok(!refcount,
"Unexpected refcount %ld.\n", refcount);
683 refcount = IXMLDOMDocument2_Release(schema2);
684 ok(!refcount,
"Unexpected refcount %ld.\n", refcount);
685 refcount = IXMLDOMDocument2_Release(schema3);
686 ok(!refcount,
"Unexpected refcount %ld.\n", refcount);
703 ok(refcount == 1,
"Unexpected refcount %ld.\n", refcount);
709 ok(refcount == 1,
"Unexpected refcount %ld.\n", refcount);
715 ok(refcount == 1,
"Unexpected refcount %ld.\n", refcount);
718 hr = IXMLDOMSchemaCollection_addCollection(cache1,
NULL);
720 hr = IXMLDOMSchemaCollection_addCollection(cache2, cache1);
722 hr = IXMLDOMSchemaCollection_addCollection(cache3, cache2);
726 hr = IXMLDOMSchemaCollection_get_length(cache1, &
length);
731 hr = IXMLDOMSchemaCollection_get_length(cache2, &
length);
736 hr = IXMLDOMSchemaCollection_get_length(cache3, &
length);
742 ok(refcount == 1,
"Unexpected refcount %ld.\n", refcount);
744 ok(refcount == 1,
"Unexpected refcount %ld.\n", refcount);
746 ok(refcount == 1,
"Unexpected refcount %ld.\n", refcount);
751 refcount = IXMLDOMDocument2_Release(schema1);
752 ok(!refcount,
"Unexpected refcount %ld.\n", refcount);
757 refcount = IXMLDOMDocument2_Release(schema2);
758 ok(!refcount,
"Unexpected refcount %ld.\n", refcount);
763 refcount = IXMLDOMDocument2_Release(schema3);
764 ok(!refcount,
"Unexpected refcount %ld.\n", refcount);
783 ok(refcount == 1,
"Unexpected refcount %ld.\n", refcount);
789 ok(refcount == 1,
"Unexpected refcount %ld.\n", refcount);
795 ok(refcount == 1,
"Unexpected refcount %ld.\n", refcount);
799 refcount = IXMLDOMSchemaCollection_Release(cache1);
800 ok(!refcount,
"Unexpected refcount %ld.\n", refcount);
801 refcount = IXMLDOMSchemaCollection_Release(cache2);
802 ok(!refcount,
"Unexpected refcount %ld.\n", refcount);
803 refcount = IXMLDOMSchemaCollection_Release(cache3);
804 ok(!refcount,
"Unexpected refcount %ld.\n", refcount);
809 refcount = IXMLDOMDocument2_Release(schema1);
810 ok(!refcount,
"Unexpected refcount %ld.\n", refcount);
814 refcount = IXMLDOMDocument2_Release(schema2);
815 ok(!refcount,
"Unexpected refcount %ld.\n", refcount);
819 refcount = IXMLDOMDocument2_Release(schema3);
820 ok(!refcount,
"Unexpected refcount %ld.\n", refcount);
828 IXMLDOMDocument2 *schema1, *schema2, *schema3;
829 IXMLDOMSchemaCollection *
cache;
841 if (!schema1 || !schema2 || !schema3 || !
cache)
843 if (schema1) IXMLDOMDocument2_Release(schema1);
844 if (schema2) IXMLDOMDocument2_Release(schema2);
845 if (schema3) IXMLDOMDocument2_Release(schema3);
847 if (
cache) IXMLDOMSchemaCollection_Release(
cache);
856 ok(
b == VARIANT_TRUE,
"failed to load XML\n");
860 ok(
b == VARIANT_TRUE,
"failed to load XML\n");
864 ok(
b == VARIANT_TRUE,
"failed to load XML\n");
866 hr = IXMLDOMSchemaCollection_get_length(
cache,
NULL);
930 IXMLDOMDocument2_Release(schema1);
931 IXMLDOMDocument2_Release(schema2);
932 IXMLDOMDocument2_Release(schema3);
933 IXMLDOMSchemaCollection_Release(
cache);
940 IXMLDOMDocument2 *schema1, *schema2, *schema3;
942 IXMLDOMSchemaCollection *cache1;
955 if (!schema1 || !schema2 || !schema3 || !cache1)
957 if (schema1) IXMLDOMDocument2_Release(schema1);
958 if (schema2) IXMLDOMDocument2_Release(schema2);
959 if (schema3) IXMLDOMDocument2_Release(schema3);
961 if (cache1) IXMLDOMSchemaCollection_Release(cache1);
968 ok(
b == VARIANT_TRUE,
"failed to load XML\n");
972 ok(
b == VARIANT_TRUE,
"failed to load XML\n");
976 ok(
b == VARIANT_TRUE,
"failed to load XML\n");
986 hr = IXMLDOMSchemaCollection_get_length(cache1, &
length);
990 IXMLDOMDocument2_Release(schema1);
991 IXMLDOMDocument2_Release(schema2);
992 IXMLDOMDocument2_Release(schema3);
994 bstr = (
void*)0xdeadbeef;
996 hr = IXMLDOMSchemaCollection_get_namespaceURI(cache1, 3, &bstr);
998 ok(bstr == (
void*)0xdeadbeef,
"got %p\n", bstr);
1000 hr = IXMLDOMSchemaCollection_get_namespaceURI(cache1, 0,
NULL);
1003 hr = IXMLDOMSchemaCollection_get_namespaceURI(cache1, 3,
NULL);
1010 ok(!schema1,
"expected NULL\n");
1014 ok(!schema1,
"expected NULL\n");
1019 for (
i = 0;
i < 3; ++
i)
1022 hr = IXMLDOMSchemaCollection_get_namespaceURI(cache1,
i, &bstr);
1024 ok(bstr !=
NULL && *bstr,
"expected non-empty string\n");
1028 if (bstr ==
NULL)
continue;
1030 for (
j = 0;
j <
i; ++
j)
1034 for (
i = 0;
i < 3; ++
i)
1040 IXMLDOMSchemaCollection_Release(cache1);
1046 IXMLDOMDocument2 *doc, *
schema;
1047 IXMLDOMSchemaCollection*
cache;
1060 if (doc) IXMLDOMDocument2_Release(doc);
1062 if (
cache) IXMLDOMSchemaCollection_Release(
cache);
1071 ok(
b == VARIANT_TRUE,
"failed to load XML string\n");
1075 ok(
b == VARIANT_TRUE,
"failed to load XML string\n");
1093 hr = IXMLDOMDocument2_putref_schemas(doc,
v);
1102 hr = IXMLDOMDocument2_validate(doc, &
err);
1104 ok(
err !=
NULL,
"domdoc_validate() should always set err\n");
1105 hr = IXMLDOMParseError_get_reason(
err, &bstr);
1109 IXMLDOMParseError_Release(
err);
1112 IXMLDOMDocument2_Release(doc);
1116 ok(
b == VARIANT_TRUE,
"failed to load XML string\n");
1124 hr = IXMLDOMDocument2_putref_schemas(doc,
v);
1133 hr = IXMLDOMDocument2_validate(doc, &
err);
1135 ok(
err !=
NULL,
"domdoc_validate() should always set err\n");
1136 hr = IXMLDOMParseError_get_reason(
err, &bstr);
1140 IXMLDOMParseError_Release(
err);
1143 IXMLDOMDocument2_Release(doc);
1147 ok(
b == VARIANT_TRUE,
"failed to load XML string\n");
1155 hr = IXMLDOMDocument2_putref_schemas(doc,
v);
1163 hr = IXMLDOMDocument2_validate(doc, &
err);
1165 ok(
err !=
NULL,
"domdoc_validate() should always set err\n");
1168 IXMLDOMParseError_Release(
err);
1171 IXMLDOMDocument2_Release(doc);
1175 ok(
b == VARIANT_TRUE,
"failed to load XML string\n");
1183 hr = IXMLDOMDocument2_putref_schemas(doc,
v);
1191 hr = IXMLDOMDocument2_validate(doc, &
err);
1193 ok(
err !=
NULL,
"domdoc_validate() should always set err\n");
1196 IXMLDOMParseError_Release(
err);
1198 IXMLDOMDocument2_Release(doc);
1199 IXMLDOMDocument2_Release(
schema);
1200 IXMLDOMSchemaCollection_Release(
cache);
1213 {
L"//Property[Name!text()='testBase64']/Value/base64Data",
VT_ARRAY|
VT_UI1,
L"bin.base64" },
1214 {
L"//Property[Name!text()='testHex']/Value/hexData",
VT_ARRAY|
VT_UI1,
L"bin.hex" },
1215 {
L"//Property[Name!text()='testBool']/Value/boolData",
VT_BOOL,
L"boolean" },
1216 {
L"//Property[Name!text()='testChar']/Value/charData",
VT_I4,
L"char",
TRUE },
1217 {
L"//Property[Name!text()='testDate']/Value/dateData",
VT_DATE,
L"date" },
1218 {
L"//Property[Name!text()='testDateTime']/Value/dateTimeData",
VT_DATE,
L"dateTime" },
1219 {
L"//Property[Name!text()='testDateTimeTz']/Value/dateTimeTzData",
VT_DATE,
L"dateTime.tz" },
1220 {
L"//Property[Name!text()='testFixed']/Value/fixedData",
VT_CY,
L"fixed.14.4" },
1221 {
L"//Property[Name!text()='testFloat']/Value/floatData",
VT_R8,
L"float" },
1222 {
L"//Property[Name!text()='testI1']/Value/i1Data",
VT_I1,
L"i1" },
1223 {
L"//Property[Name!text()='testI2']/Value/i2Data",
VT_I2,
L"i2" },
1224 {
L"//Property[Name!text()='testI4']/Value/i4Data",
VT_I4,
L"i4" },
1225 {
L"//Property[Name!text()='testI8']/Value/i8Data",
VT_NULL,
L"i8",
TRUE },
1226 {
L"//Property[Name!text()='testInt']/Value/intData",
VT_I4,
L"int" },
1227 {
L"//Property[Name!text()='testNmtoken']/Value/nmtokData",
VT_BSTR,
NULL },
1228 {
L"//Property[Name!text()='testNmtokens']/Value/nmtoksData",
VT_BSTR,
NULL },
1229 {
L"//Property[Name!text()='testNumber']/Value/numData",
VT_BSTR,
L"number" },
1230 {
L"//Property[Name!text()='testR4']/Value/r4Data",
VT_R4,
L"r4" },
1231 {
L"//Property[Name!text()='testR8']/Value/r8Data",
VT_R8,
L"r8" },
1232 {
L"//Property[Name!text()='testString']/Value/stringData",
VT_BSTR,
NULL },
1233 {
L"//Property[Name!text()='testTime']/Value/timeData",
VT_DATE,
L"time" },
1234 {
L"//Property[Name!text()='testTimeTz']/Value/timeTzData",
VT_DATE,
L"time.tz" },
1235 {
L"//Property[Name!text()='testU1']/Value/u1Data",
VT_UI1,
L"ui1" },
1236 {
L"//Property[Name!text()='testU2']/Value/u2Data",
VT_UI2,
L"ui2" },
1237 {
L"//Property[Name!text()='testU4']/Value/u4Data",
VT_UI4,
L"ui4" },
1238 {
L"//Property[Name!text()='testU8']/Value/u8Data",
VT_NULL,
L"ui8",
TRUE },
1239 {
L"//Property[Name!text()='testURI']/Value/uriData",
VT_BSTR,
L"uri" },
1240 {
L"//Property[Name!text()='testUUID']/Value/uuidData",
VT_BSTR,
L"uuid" },
1246 IXMLDOMDocument2 *doc, *
schema, *doc2;
1247 IXMLDOMSchemaCollection*
cache;
1265 if (doc) IXMLDOMDocument2_Release(doc);
1266 if (doc2) IXMLDOMDocument2_Release(doc2);
1268 if (
cache) IXMLDOMSchemaCollection_Release(
cache);
1274 ok(
b == VARIANT_TRUE,
"failed to load XML string\n");
1278 ok(
b == VARIANT_TRUE,
"failed to load XML string\n");
1282 ok(
b == VARIANT_TRUE,
"failed to load XML string\n");
1285 hr = IXMLDOMDocument2_validate(doc, &
err);
1287 ok(
err !=
NULL,
"domdoc_validate() should always set err\n");
1288 hr = IXMLDOMParseError_get_errorCode(
err, &
l);
1290 ok(
l == E_XML_NODTD,
"Unexpected error code %#lx.\n",
l);
1291 IXMLDOMParseError_Release(
err);
1294 hr = IXMLDOMDocument2_validate(doc2, &
err);
1296 ok(
err !=
NULL,
"domdoc_validate() should always set err\n");
1297 hr = IXMLDOMParseError_get_errorCode(
err, &
l);
1299 ok(
l == E_XML_NODTD,
"Unexpected error code %#lx.\n",
l);
1300 IXMLDOMParseError_Release(
err);
1308 hr = IXMLDOMSchemaCollection_add(
cache,
_bstr_(
L"urn:x-schema:datatype-test-xdr"),
v);
1318 hr = IXMLDOMDocument2_putref_schemas(doc2,
v);
1326 hr = IXMLDOMDocument2_validate(doc2, &
err);
1328 ok(
err !=
NULL,
"domdoc_validate() should always set err\n");
1329 hr = IXMLDOMParseError_get_errorCode(
err, &
l);
1331 hr = IXMLDOMParseError_get_reason(
err, &bstr);
1335 IXMLDOMParseError_Release(
err);
1344 hr = IXMLDOMDocument2_selectSingleNode(doc,
_bstr_(
ptr->query), &
node);
1357 hr = IXMLDOMNode_get_nodeTypedValue(
node, &
type);
1361 IXMLDOMNode_Release(
node);
1365 hr = IXMLDOMDocument2_selectSingleNode(doc2,
_bstr_(
ptr->query), &
node);
1385 hr = IXMLDOMNode_get_nodeTypedValue(
node, &
v);
1391 switch (
ptr->type_schema)
1415 ok(
V_R4(&
v) == (
float)3.14159265,
"got %f\n",
V_R4(&
v));
1420 ok(
V_R8(&
v) == 3.14159,
"got 0x%llx\n", *(
unsigned long long*)&
V_R8(&
v));
1427 ok(
V_R8(&
v) == 3.14159265358979323846,
"got 0x%llx\n", *(
unsigned long long*)&
V_R8(&
v));
1429 ok(
V_R8(&
v) == 3.14159265358979323846,
"got %.20f\n",
V_R8(&
v));
1450 IXMLDOMNode_Release(
node);
1455 IXMLDOMDocument2_Release(
schema);
1456 IXMLDOMDocument2_Release(doc);
1457 IXMLDOMDocument2_Release(doc2);
1458 IXMLDOMSchemaCollection_Release(
cache);
1473 hr = IUnknown_QueryInterface(
obj, &IID_IDispatchEx, (
void**)&dispex);
1478 hr = IDispatchEx_GetTypeInfoCount(dispex, &ticnt);
1480 ok(ticnt == 1,
"ticnt=%u\n", ticnt);
1483 hr = IDispatchEx_DeleteMemberByName(dispex,
name, fdexNameCaseSensitive);
1487 hr = IDispatchEx_DeleteMemberByDispID(dispex, dispid);
1491 hr = IDispatchEx_GetMemberProperties(dispex, dispid, grfdexPropCanAll, &
props);
1495 hr = IDispatchEx_GetMemberName(dispex, dispid, &
name);
1503 hr = IDispatchEx_GetNameSpaceParent(dispex, &unk);
1505 ok(unk == (
IUnknown*)0xdeadbeef,
"got %p\n", unk);
1508 hr = IDispatchEx_GetDispID(dispex,
name, fdexNameEnsure, &dispid);
1512 IDispatchEx_Release(dispex);
1517 IXMLDOMSchemaCollection *
cache;
1521 DISPPARAMS dispparams;
1530 IUnknown_Release(unk);
1532 hr = IXMLDOMSchemaCollection_QueryInterface(
cache, &IID_IDispatchEx, (
void**)&dispex);
1537 dispparams.cArgs = 1;
1538 dispparams.cNamedArgs = 0;
1539 dispparams.rgdispidNamedArgs =
NULL;
1540 dispparams.rgvarg = &
arg;
1549 IDispatchEx_Release(dispex);
1550 IXMLDOMSchemaCollection_Release(
cache);
1558 ok(
r ==
S_OK,
"failed to init com\n");
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
GLuint GLuint GLsizei GLenum type
GLdouble GLdouble GLdouble r
GLboolean GLboolean GLboolean b
GLuint GLsizei GLsizei * length
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 const GLfloat const GLdouble const GLfloat GLint GLint GLint j
#define todo_wine_if(is_todo)
#define win_skip_(file, line)
#define create_cache(iid)
static const WCHAR xdr_schema1_xml[]
static const WCHAR szOpenSeqXDR[]
static const WCHAR szOpenSeqXML1[]
static const WCHAR xdr_schema2_uri[]
static BSTR alloced_bstrs[256]
static const WCHAR szDatatypeXML[]
static void test_XDR_schemas(void)
#define create_document_version(v, iid)
static const WCHAR szDatatypeXDR[]
static const xdr_datatypes xdr_datatypes_data[]
static void test_collection_refs(void)
static void test_XDR_datatypes(void)
static ULONG get_refcount(void *iface)
static const WCHAR xdr_schema2_xml[]
static const WCHAR xdr_schema3_xml[]
static void test_length(void)
static int alloced_bstrs_count
static void free_bstrs(void)
static const WCHAR xdr_schema3_uri[]
#define expect_int64(expr, x, base)
static const WCHAR szOpenSeqXML4[]
#define expect_uint64(expr, x, base)
static void * _create_object(const GUID *clsid, const char *name, const IID *iid, int line)
static BSTR _bstr_(const WCHAR *str)
static void test_schema_refs(void)
static const WCHAR szOpenSeqXML2[]
#define create_cache_version(v, iid)
#define create_document(iid)
static const WCHAR xdr_schema1_uri[]
static const WCHAR szOpenSeqXML3[]
static VARIANT _variantdoc_(void *doc)
static void test_obj_dispex(IUnknown *obj)
static void test_collection_content(void)
static void test_dispex(void)
static const WCHAR xsd_schema1_uri[]
static VARIANTARG static DISPID
#define DISPID_XMLDOM_SCHEMACOLLECTION_ADD
#define DISPID_SAX_XMLREADER_GETFEATURE
BSTR WINAPI SysAllocString(LPCOLESTR str)
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
void WINAPI VariantInit(VARIANTARG *pVarg)
static const WCHAR props[]
#define DISP_E_MEMBERNOTFOUND
#define DISP_E_UNKNOWNNAME