30#undef CLSID_DOMDocument
37#define EXPECT_HR(hr,hr_exp) \
38 ok(hr == hr_exp, "got 0x%08x, expected 0x%08x\n", hr, hr_exp)
42"<?xml version='1.0'?>"
43"<Schema xmlns='urn:schemas-microsoft-com:xml-data'"
44" xmlns:dt='urn:schemas-microsoft-com:datatypes'"
46" <ElementType name='x' dt:type='boolean'/>"
47" <ElementType name='y'>"
48" <datatype dt:type='int'/>"
50" <ElementType name='z'/>"
51" <ElementType name='root' content='eltOnly' model='open' order='seq'>"
60"<?xml version='1.0'?>"
61"<Schema xmlns='urn:schemas-microsoft-com:xml-data'"
62" xmlns:dt='urn:schemas-microsoft-com:datatypes'"
64" <ElementType name='x' dt:type='bin.base64'/>"
65" <ElementType name='y' dt:type='uuid'/>"
66" <ElementType name='z'/>"
67" <ElementType name='root' content='eltOnly' model='closed' order='one'>"
76"<?xml version='1.0'?>"
77"<Schema xmlns='urn:schemas-microsoft-com:xml-data'"
78" xmlns:dt='urn:schemas-microsoft-com:datatypes'"
80" <ElementType name='root' content='textOnly' model='open'>"
81" <AttributeType name='x' dt:type='int'/>"
82" <AttributeType name='y' dt:type='enumeration' dt:values='a b c'/>"
83" <AttributeType name='z' dt:type='uuid'/>"
84" <attribute type='x'/>"
85" <attribute type='y'/>"
86" <attribute type='z'/>"
92"<?xml version='1.0'?>"
93"<schema xmlns='http://www.w3.org/2001/XMLSchema'"
94" targetNamespace='x-schema:test1.xsd'>"
95" <element name='root'>"
97" <sequence maxOccurs='unbounded'>"
106"<?xml version='1.0'?>"
107"<schema xmlns='http://www.w3.org/2001/XMLSchema'"
108" targetNamespace='x-schema:test2.xsd'>"
109" <element name='root'>"
111" <sequence maxOccurs='unbounded'>"
120"<?xml version='1.0'?>"
121"<schema xmlns='http://www.w3.org/2001/XMLSchema'"
122" targetNamespace='x-schema:test3.xsd'>"
123" <element name='root'>"
125" <sequence maxOccurs='unbounded'>"
133"<Schema xmlns='urn:schemas-microsoft-com:xml-data'\n"
134" xmlns:dt='urn:schemas-microsoft-com:datatypes'>\n"
135" <ElementType name='base64Data' content='textOnly' dt:type='bin.base64'/>\n"
136" <ElementType name='hexData' content='textOnly' dt:type='bin.hex'/>\n"
137" <ElementType name='boolData' content='textOnly' dt:type='boolean'/>\n"
138" <ElementType name='charData' content='textOnly' dt:type='char'/>\n"
139" <ElementType name='dateData' content='textOnly' dt:type='date'/>\n"
140" <ElementType name='dateTimeData' content='textOnly' dt:type='dateTime'/>\n"
141" <ElementType name='dateTimeTzData' content='textOnly' dt:type='dateTime.tz'/>\n"
142" <ElementType name='entityData' content='textOnly' dt:type='entity'/>\n"
143" <ElementType name='entitiesData' content='textOnly' dt:type='entities'/>\n"
144" <ElementType name='fixedData' content='textOnly' dt:type='fixed.14.4'/>\n"
145" <ElementType name='floatData' content='textOnly' dt:type='float'/>\n"
146" <ElementType name='i1Data' content='textOnly' dt:type='i1'/>\n"
147" <ElementType name='i2Data' content='textOnly' dt:type='i2'/>\n"
148" <ElementType name='i4Data' content='textOnly' dt:type='i4'/>\n"
149" <ElementType name='i8Data' content='textOnly' dt:type='i8'/>\n"
150" <ElementType name='intData' content='textOnly' dt:type='int'/>\n"
151" <ElementType name='nmtokData' content='textOnly' dt:type='nmtoken'/>\n"
152" <ElementType name='nmtoksData' content='textOnly' dt:type='nmtokens'/>\n"
153" <ElementType name='numData' content='textOnly' dt:type='number'/>\n"
154" <ElementType name='r4Data' content='textOnly' dt:type='r4'/>\n"
155" <ElementType name='r8Data' content='textOnly' dt:type='r8'/>\n"
156" <ElementType name='stringData' content='textOnly' dt:type='string'/>\n"
157" <ElementType name='timeData' content='textOnly' dt:type='time'/>\n"
158" <ElementType name='timeTzData' content='textOnly' dt:type='time.tz'/>\n"
159" <ElementType name='u1Data' content='textOnly' dt:type='ui1'/>\n"
160" <ElementType name='u2Data' content='textOnly' dt:type='ui2'/>\n"
161" <ElementType name='u4Data' content='textOnly' dt:type='ui4'/>\n"
162" <ElementType name='u8Data' content='textOnly' dt:type='ui8'/>\n"
163" <ElementType name='uriData' content='textOnly' dt:type='uri'/>\n"
164" <ElementType name='uuidData' content='textOnly' dt:type='uuid'/>\n"
166" <ElementType name='Name' content='textOnly' dt:type='nmtoken'/>\n"
167" <ElementType name='Value' content='eltOnly' order='many'>\n"
168" <element type='base64Data'/>\n"
169" <element type='hexData'/>\n"
170" <element type='boolData'/>\n"
171" <element type='charData'/>\n"
172" <element type='dateData'/>\n"
173" <element type='dateTimeData'/>\n"
174" <element type='dateTimeTzData'/>\n"
175" <element type='entityData'/>\n"
176" <element type='entitiesData'/>\n"
177" <element type='fixedData'/>\n"
178" <element type='floatData'/>\n"
179" <element type='i1Data'/>\n"
180" <element type='i2Data'/>\n"
181" <element type='i4Data'/>\n"
182" <element type='i8Data'/>\n"
183" <element type='intData'/>\n"
184" <element type='nmtokData'/>\n"
185" <element type='nmtoksData'/>\n"
186" <element type='numData'/>\n"
187" <element type='r4Data'/>\n"
188" <element type='r8Data'/>\n"
189" <element type='stringData'/>\n"
190" <element type='timeData'/>\n"
191" <element type='timeTzData'/>\n"
192" <element type='u1Data'/>\n"
193" <element type='u2Data'/>\n"
194" <element type='u4Data'/>\n"
195" <element type='u8Data'/>\n"
196" <element type='uriData'/>\n"
197" <element type='uuidData'/>\n"
199" <ElementType name='Property' content='eltOnly' order='seq'>\n"
200" <element type='Name'/>\n"
201" <element type='Value'/>\n"
203" <ElementType name='Properties' content='eltOnly'>\n"
204" <element type='Property' minOccurs='0' maxOccurs='*'/>\n"
209"<?xml version='1.0'?>\n"
210"<Properties xmlns='urn:x-schema:datatype-test-xdr'>\n"
212" <Name>testBase64</Name>\n"
214" <base64Data>+HugeNumber+</base64Data>\n"
218" <Name>testHex</Name>\n"
220" <hexData>deadbeef</hexData>\n"
224" <Name>testBool</Name>\n"
226" <boolData>1</boolData>\n"
230" <Name>testChar</Name>\n"
232" <charData>u</charData>\n"
236" <Name>testDate</Name>\n"
238" <dateData>1998-02-01</dateData>\n"
242" <Name>testDateTime</Name>\n"
244" <dateTimeData>1998-02-01T12:34:56</dateTimeData>\n"
248" <Name>testDateTimeTz</Name>\n"
250" <dateTimeTzData>1998-02-01T12:34:56-06:00</dateTimeTzData>\n"
254" <Name>testFixed</Name>\n"
256" <fixedData>3.1416</fixedData>\n"
260" <Name>testFloat</Name>\n"
262" <floatData>3.14159</floatData>\n"
266" <Name>testI1</Name>\n"
268" <i1Data>42</i1Data>\n"
272" <Name>testI2</Name>\n"
274" <i2Data>420</i2Data>\n"
278" <Name>testI4</Name>\n"
280" <i4Data>-420000000</i4Data>\n"
284" <Name>testI8</Name>\n"
286" <i8Data>-4200000000</i8Data>\n"
290" <Name>testInt</Name>\n"
292" <intData>42</intData>\n"
296" <Name>testNmtoken</Name>\n"
298" <nmtokData>tok1</nmtokData>\n"
302" <Name>testNmtokens</Name>\n"
304" <nmtoksData>tok1 tok2 tok3</nmtoksData>\n"
308" <Name>testNumber</Name>\n"
310" <numData>3.14159</numData>\n"
314" <Name>testR4</Name>\n"
316" <r4Data>3.14159265</r4Data>\n"
320" <Name>testR8</Name>\n"
322" <r8Data>3.14159265358979323846</r8Data>\n"
326" <Name>testString</Name>\n"
328" <stringData>foo bar</stringData>\n"
332" <Name>testTime</Name>\n"
334" <timeData>12:34:56</timeData>\n"
338" <Name>testTimeTz</Name>\n"
340" <timeTzData>12:34:56-06:00</timeTzData>\n"
344" <Name>testU1</Name>\n"
346" <u1Data>255</u1Data>\n"
350" <Name>testU2</Name>\n"
352" <u2Data>65535</u2Data>\n"
356" <Name>testU4</Name>\n"
358" <u4Data>4294967295</u4Data>\n"
362" <Name>testU8</Name>\n"
364" <u8Data>18446744073709551615</u8Data>\n"
368" <Name>testURI</Name>\n"
370" <uriData>urn:schemas-microsoft-com:datatypes</uriData>\n"
374" <Name>testUUID</Name>\n"
376" <uuidData>2933BF81-7B36-11D2-B20E-00C04F983E60</uuidData>\n"
382"<Schema xmlns='urn:schemas-microsoft-com:xml-data'>\n"
383" <ElementType name='w' content='empty' model='closed'/>\n"
384" <ElementType name='x' content='empty' model='closed'/>\n"
385" <ElementType name='y' content='empty' model='closed'/>\n"
386" <ElementType name='z' content='empty' model='closed'/>\n"
387" <ElementType name='test' content='eltOnly' model='open' order='seq'>\n"
388" <element type='x'/>\n"
389" <group order='seq'>\n"
390" <element type='x'/>\n"
391" <element type='y'/>\n"
392" <element type='z'/>\n"
394" <element type='z'/>\n"
403#define check_ref_expr(expr, n) { \
405 ok(ref == n, "expected %i refs, got %i\n", n, ref); \
408#define check_refs(iface, obj, n) { \
409 LONG ref = iface ## _AddRef(obj); \
410 ok(ref == n+1, "expected %i refs, got %i\n", n+1, ref); \
411 ref = iface ## _Release(obj); \
412 ok(ref == n, "expected %i refs, got %i\n", n, ref); \
415#define ole_check(expr) { \
417 ok(r == S_OK, #expr " returned %x\n", r); \
420#define ole_expect(expr, expect) { \
422 ok(r == (expect), #expr " returned %x, expected %x\n", r, expect); \
425#define _expect64(expr, str, base, TYPE, CONV) { \
427 TYPE v2 = CONV(str, NULL, base); \
428 ok(v1 == v2, #expr "returned %s, expected %s\n", \
429 wine_dbgstr_longlong(v1), wine_dbgstr_longlong(v2)); \
433#define expect_int64(expr, x, base) _expect64(expr, #x, base, LONG64, _strtoi64)
434#define expect_uint64(expr, x, base) _expect64(expr, #x, base, ULONG64, _strtoui64)
436#define expect_int64(expr, x, base) _expect64(expr, #x, base, LONG64, strtoll)
437#define expect_uint64(expr, x, base) _expect64(expr, #x, base, ULONG64, strtoull)
486#define _create(cls) cls, #cls
488#define create_document(iid) _create_object(&_create(CLSID_DOMDocument), iid, __LINE__)
490#define create_document_version(v, iid) _create_object(&_create(CLSID_DOMDocument ## v), iid, __LINE__)
492#define create_cache(iid) _create_object(&_create(CLSID_XMLSchemaCache), iid, __LINE__)
494#define create_cache_version(v, iid) _create_object(&_create(CLSID_XMLSchemaCache ## v), iid, __LINE__)
498 static const WCHAR xdr_schema_xml[] =
499 L"<Schema xmlns=\"urn:schemas-microsoft-com:xml-data\"\nxmlns:dt=\"urn:schemas-microsoft-com:datatypes\">\n</Schema>\n";
500 IXMLDOMDocument2 *doc;
502 IXMLDOMSchemaCollection *
cache;
516 IXMLDOMDocument2_Release(doc);
523 ok(
b == VARIANT_TRUE,
"b %04x\n",
b);
526 node = (
void*)0xdeadbeef;
547 IXMLDOMNode_Release(
node);
556 IXMLDOMNode_Release(
node);
572 hr = IXMLDOMSchemaCollection_get_length(
cache, &
len);
579 hr = IXMLDOMSchemaCollection_get_length(
cache, &
len);
600 ole_check(IXMLDOMDocument2_putref_schemas(doc,
v));
607 ole_check(IXMLDOMDocument2_get_schemas(doc, &
v));
612 ole_check(IXMLDOMDocument2_get_schemas(doc, &
v));
632 ole_check(IXMLDOMDocument2_putref_schemas(doc,
v));
639 ole_check(IXMLDOMDocument2_putref_schemas(doc,
v));
646 ole_check(IXMLDOMDocument2_putref_schemas(doc,
v));
654 ole_check(IXMLDOMDocument2_putref_schemas(doc,
v));
668 IXMLDOMDocument2 *schema1, *schema2, *schema3;
669 IXMLDOMSchemaCollection *cache1, *cache2, *cache3;
674 ok(schema1 !=
NULL,
"Failed to create a document.\n");
677 ok(cache1 !=
NULL,
"Failed to create schema collection.\n");
679 if (!schema1 || !cache1)
682 IXMLDOMDocument2_Release(schema1);
684 IXMLDOMSchemaCollection_Release(cache1);
695 ok(
b == VARIANT_TRUE,
"failed to load XML\n");
698 ok(
b == VARIANT_TRUE,
"failed to load XML\n");
701 ok(
b == VARIANT_TRUE,
"failed to load XML\n");
720 if (schema1)
check_refs(IXMLDOMDocument2, schema1, 1);
721 if (schema2)
check_refs(IXMLDOMDocument2, schema2, 1);
722 if (schema3)
check_refs(IXMLDOMDocument2, schema3, 1);
725 ole_check(IXMLDOMSchemaCollection_addCollection(cache2, cache1));
726 ole_check(IXMLDOMSchemaCollection_addCollection(cache3, cache2));
742 check_refs(IXMLDOMSchemaCollection, cache1, 1);
743 check_refs(IXMLDOMSchemaCollection, cache2, 1);
744 check_refs(IXMLDOMSchemaCollection, cache3, 1);
747 if (schema1)
check_refs(IXMLDOMDocument2, schema1, 1);
748 if (schema2)
check_refs(IXMLDOMDocument2, schema2, 1);
749 if (schema3)
check_refs(IXMLDOMDocument2, schema3, 1);
751 if (schema1)
check_ref_expr(IXMLDOMDocument2_Release(schema1), 0);
752 if (schema2)
check_ref_expr(IXMLDOMDocument2_Release(schema2), 0);
753 if (schema3)
check_ref_expr(IXMLDOMDocument2_Release(schema3), 0);
764 if (schema1)
check_refs(IXMLDOMDocument2, schema1, 1);
765 if (schema2)
check_refs(IXMLDOMDocument2, schema2, 1);
766 if (schema3)
check_refs(IXMLDOMDocument2, schema3, 1);
774 if (schema1)
check_refs(IXMLDOMDocument2, schema1, 1);
775 if (schema2)
check_refs(IXMLDOMDocument2, schema2, 1);
776 if (schema3)
check_refs(IXMLDOMDocument2, schema3, 1);
778 if (schema1)
check_ref_expr(IXMLDOMDocument2_Release(schema1), 0);
779 if (schema2)
check_ref_expr(IXMLDOMDocument2_Release(schema2), 0);
780 if (schema3)
check_ref_expr(IXMLDOMDocument2_Release(schema3), 0);
787 IXMLDOMDocument2 *schema1, *schema2, *schema3;
788 IXMLDOMSchemaCollection *
cache;
799 if (!schema1 || !schema2 || !schema3 || !
cache)
801 if (schema1) IXMLDOMDocument2_Release(schema1);
802 if (schema2) IXMLDOMDocument2_Release(schema2);
803 if (schema3) IXMLDOMDocument2_Release(schema3);
805 if (
cache) IXMLDOMSchemaCollection_Release(
cache);
813 ok(
b == VARIANT_TRUE,
"failed to load XML\n");
816 ok(
b == VARIANT_TRUE,
"failed to load XML\n");
819 ok(
b == VARIANT_TRUE,
"failed to load XML\n");
869 IXMLDOMDocument2_Release(schema1);
870 IXMLDOMDocument2_Release(schema2);
871 IXMLDOMDocument2_Release(schema3);
872 IXMLDOMSchemaCollection_Release(
cache);
879 IXMLDOMDocument2 *schema1, *schema2, *schema3, *schema4, *schema5;
881 IXMLDOMSchemaCollection *cache1, *cache2;
895 if (!schema1 || !schema2 || !schema3 || !cache1)
897 if (schema1) IXMLDOMDocument2_Release(schema1);
898 if (schema2) IXMLDOMDocument2_Release(schema2);
899 if (schema3) IXMLDOMDocument2_Release(schema3);
901 if (cache1) IXMLDOMSchemaCollection_Release(cache1);
907 ok(
b == VARIANT_TRUE,
"failed to load XML\n");
910 ok(
b == VARIANT_TRUE,
"failed to load XML\n");
913 ok(
b == VARIANT_TRUE,
"failed to load XML\n");
923 IXMLDOMDocument2_Release(schema1);
924 IXMLDOMDocument2_Release(schema2);
925 IXMLDOMDocument2_Release(schema3);
935 ok(
b == VARIANT_TRUE,
"failed to load XML\n");
937 ok(
b == VARIANT_TRUE,
"failed to load XML\n");
939 ok(
b == VARIANT_TRUE,
"failed to load XML\n");
941 ok(
b == VARIANT_TRUE,
"failed to load XML\n");
943 ok(
b == VARIANT_TRUE,
"failed to load XML\n");
956 IXMLDOMDocument2_Release(schema1);
957 IXMLDOMDocument2_Release(schema2);
958 IXMLDOMDocument2_Release(schema3);
959 IXMLDOMDocument2_Release(schema4);
960 IXMLDOMDocument2_Release(schema5);
963 bstr = (
void*)0xdeadbeef;
965 hr = IXMLDOMSchemaCollection_get_namespaceURI(cache1, 3, &bstr);
967 ok(bstr == (
void*)0xdeadbeef,
"got %p\n", bstr);
976 ok(!schema1,
"expected NULL\n");
979 ok(!schema1,
"expected NULL\n");
983 for (
i = 0;
i < 3; ++
i)
986 ole_check(IXMLDOMSchemaCollection_get_namespaceURI(cache1,
i, &bstr));
987 ok(bstr !=
NULL && *bstr,
"expected non-empty string\n");
989 if (bstr !=
NULL && *bstr)
992 for (
j = 0;
j <
i; ++
j)
998 for (
j = 0;
j <
i; ++
j)
1004 for (
i = 0;
i < 3; ++
i)
1012 for (
i = 0;
i < 5; ++
i)
1015 ole_check(IXMLDOMSchemaCollection_get_namespaceURI(cache2,
i, &bstr));
1016 ok(bstr !=
NULL && *bstr,
"expected non-empty string\n");
1019 if (bstr !=
NULL && *bstr)
1021 for (
j = 0;
j <
i; ++
j)
1025 for (
j = 0;
j <
i; ++
j)
1031 for (
i = 0;
i < 5; ++
i)
1038 IXMLDOMSchemaCollection_Release(cache1);
1039 if (cache2) IXMLDOMSchemaCollection_Release(cache2);
1047 static const WCHAR regex_doc[] =
1049"<?xml version='1.0'?>"
1050"<root xmlns='urn:test'>%s</root>";
1052 static const WCHAR regex_schema[] =
1053L"<?xml version='1.0'?>"
1054"<schema xmlns='http://www.w3.org/2001/XMLSchema'"
1055" targetNamespace='urn:test'>"
1056" <element name='root'>"
1058" <restriction base='string'>"
1059" <pattern value='%s'/>"
1081 ole_check(IXMLDOMDocument2_loadXML(doc, bstr, &
b));
1082 ok(
b == VARIANT_TRUE,
"failed to load XML\n");
1092 ok(
b == VARIANT_TRUE,
"failed to load XML\n");
1101 hr = IXMLDOMSchemaCollection_add(
cache,
namespace,
v);
1112 ole_check(IXMLDOMDocument2_putref_schemas(doc,
v));
1120 hr = IXMLDOMDocument2_validate(doc, &
err);
1121 ok(
err !=
NULL,
"domdoc_validate() should always set err\n");
1122 if (IXMLDOMParseError_get_reason(
err, &bstr) !=
S_FALSE)
1125 IXMLDOMParseError_Release(
err);
1137 struct regex_test
tests[] = {
1152 {
L"\\uCAFE",
L"\xCAFE" },
1154 {
L"\\uD83D\\uDE00",
L"\xD83D\xDE00" },
1163 IXMLDOMDocument2 *doc40, *doc60;
1164 IXMLDOMDocument2 *schema40, *schema60;
1165 IXMLDOMSchemaCollection *cache40, *cache60;
1174 if (doc60 && schema60 && cache60)
1177 ok(
hr ==
S_OK,
"got 0x%08x for for version 60 regex %s input %s\n",
1179 if (doc40 && schema40 && cache40)
1182 ok(
hr ==
S_OK,
"got 0x%08x version 40 regex %s input %s\n",
1187 ok(0,
"out of memory\n");
1190 IXMLDOMDocument2_Release(doc40);
1192 IXMLDOMDocument2_Release(doc60);
1194 IXMLDOMDocument2_Release(schema40);
1196 IXMLDOMDocument2_Release(schema60);
1198 IXMLDOMSchemaCollection_Release(cache40);
1200 IXMLDOMSchemaCollection_Release(cache60);
1206 IXMLDOMDocument2 *doc, *
schema;
1207 IXMLDOMSchemaCollection*
cache;
1219 if (doc) IXMLDOMDocument2_Release(doc);
1221 if (
cache) IXMLDOMSchemaCollection_Release(
cache);
1229 ok(
b == VARIANT_TRUE,
"failed to load XML string\n");
1232 ok(
b == VARIANT_TRUE,
"failed to load XML string\n");
1247 ole_check(IXMLDOMDocument2_putref_schemas(doc,
v));
1256 ok(
err !=
NULL,
"domdoc_validate() should always set err\n");
1260 IXMLDOMParseError_Release(
err);
1263 IXMLDOMDocument2_Release(doc);
1266 ok(
b == VARIANT_TRUE,
"failed to load XML string\n");
1273 ole_check(IXMLDOMDocument2_putref_schemas(doc,
v));
1282 ok(
err !=
NULL,
"domdoc_validate() should always set err\n");
1286 IXMLDOMParseError_Release(
err);
1289 IXMLDOMDocument2_Release(doc);
1292 ok(
b == VARIANT_TRUE,
"failed to load XML string\n");
1299 ole_check(IXMLDOMDocument2_putref_schemas(doc,
v));
1307 ok(
err !=
NULL,
"domdoc_validate() should always set err\n");
1310 IXMLDOMParseError_Release(
err);
1313 IXMLDOMDocument2_Release(doc);
1316 ok(
b == VARIANT_TRUE,
"failed to load XML string\n");
1323 ole_check(IXMLDOMDocument2_putref_schemas(doc,
v));
1331 ok(
err !=
NULL,
"domdoc_validate() should always set err\n");
1334 IXMLDOMParseError_Release(
err);
1336 IXMLDOMDocument2_Release(doc);
1337 IXMLDOMDocument2_Release(
schema);
1338 IXMLDOMSchemaCollection_Release(
cache);
1346 const char *
typename;
1351 {
"//Property[Name!text()='testBase64']/Value/base64Data",
VT_ARRAY|
VT_UI1,
"bin.base64" },
1352 {
"//Property[Name!text()='testHex']/Value/hexData",
VT_ARRAY|
VT_UI1,
"bin.hex" },
1353 {
"//Property[Name!text()='testBool']/Value/boolData",
VT_BOOL,
"boolean" },
1354 {
"//Property[Name!text()='testChar']/Value/charData",
VT_I4,
"char",
TRUE },
1355 {
"//Property[Name!text()='testDate']/Value/dateData",
VT_DATE,
"date" },
1356 {
"//Property[Name!text()='testDateTime']/Value/dateTimeData",
VT_DATE,
"dateTime" },
1357 {
"//Property[Name!text()='testDateTimeTz']/Value/dateTimeTzData",
VT_DATE,
"dateTime.tz" },
1358 {
"//Property[Name!text()='testFixed']/Value/fixedData",
VT_CY,
"fixed.14.4" },
1359 {
"//Property[Name!text()='testFloat']/Value/floatData",
VT_R8,
"float" },
1360 {
"//Property[Name!text()='testI1']/Value/i1Data",
VT_I1,
"i1" },
1361 {
"//Property[Name!text()='testI2']/Value/i2Data",
VT_I2,
"i2" },
1362 {
"//Property[Name!text()='testI4']/Value/i4Data",
VT_I4,
"i4" },
1363 {
"//Property[Name!text()='testI8']/Value/i8Data",
VT_NULL,
"i8",
TRUE },
1364 {
"//Property[Name!text()='testInt']/Value/intData",
VT_I4,
"int" },
1365 {
"//Property[Name!text()='testNmtoken']/Value/nmtokData",
VT_BSTR,
NULL },
1366 {
"//Property[Name!text()='testNmtokens']/Value/nmtoksData",
VT_BSTR,
NULL },
1367 {
"//Property[Name!text()='testNumber']/Value/numData",
VT_BSTR,
"number" },
1368 {
"//Property[Name!text()='testR4']/Value/r4Data",
VT_R4,
"r4" },
1369 {
"//Property[Name!text()='testR8']/Value/r8Data",
VT_R8,
"r8" },
1370 {
"//Property[Name!text()='testString']/Value/stringData",
VT_BSTR,
NULL },
1371 {
"//Property[Name!text()='testTime']/Value/timeData",
VT_DATE,
"time" },
1372 {
"//Property[Name!text()='testTimeTz']/Value/timeTzData",
VT_DATE,
"time.tz" },
1373 {
"//Property[Name!text()='testU1']/Value/u1Data",
VT_UI1,
"ui1" },
1374 {
"//Property[Name!text()='testU2']/Value/u2Data",
VT_UI2,
"ui2" },
1375 {
"//Property[Name!text()='testU4']/Value/u4Data",
VT_UI4,
"ui4" },
1376 {
"//Property[Name!text()='testU8']/Value/u8Data",
VT_NULL,
"ui8",
TRUE },
1377 {
"//Property[Name!text()='testURI']/Value/uriData",
VT_BSTR,
"uri" },
1378 {
"//Property[Name!text()='testUUID']/Value/uuidData",
VT_BSTR,
"uuid" },
1384 IXMLDOMDocument2 *doc, *
schema, *doc2;
1385 IXMLDOMSchemaCollection*
cache;
1403 if (doc) IXMLDOMDocument2_Release(doc);
1404 if (doc2) IXMLDOMDocument2_Release(doc2);
1406 if (
cache) IXMLDOMSchemaCollection_Release(
cache);
1412 ok(
b == VARIANT_TRUE,
"failed to load XML string\n");
1416 ok(
b == VARIANT_TRUE,
"failed to load XML string\n");
1420 ok(
b == VARIANT_TRUE,
"failed to load XML string\n");
1423 hr = IXMLDOMDocument2_validate(doc, &
err);
1425 ok(
err !=
NULL,
"domdoc_validate() should always set err\n");
1426 hr = IXMLDOMParseError_get_errorCode(
err, &
l);
1428 ok(
l == E_XML_NODTD,
"got %08x\n",
l);
1429 IXMLDOMParseError_Release(
err);
1432 hr = IXMLDOMDocument2_validate(doc2, &
err);
1434 ok(
err !=
NULL,
"domdoc_validate() should always set err\n");
1435 hr = IXMLDOMParseError_get_errorCode(
err, &
l);
1437 ok(
l == E_XML_NODTD,
"got %08x\n",
l);
1438 IXMLDOMParseError_Release(
err);
1446 hr = IXMLDOMSchemaCollection_add(
cache,
_bstr_(
"urn:x-schema:datatype-test-xdr"),
v);
1456 hr = IXMLDOMDocument2_putref_schemas(doc2,
v);
1464 hr = IXMLDOMDocument2_validate(doc2, &
err);
1466 ok(
err !=
NULL,
"domdoc_validate() should always set err\n");
1467 hr = IXMLDOMParseError_get_errorCode(
err, &
l);
1469 hr = IXMLDOMParseError_get_reason(
err, &bstr);
1473 IXMLDOMParseError_Release(
err);
1482 hr = IXMLDOMDocument2_selectSingleNode(doc,
_bstr_(
ptr->query), &
node);
1495 hr = IXMLDOMNode_get_nodeTypedValue(
node, &
type);
1499 IXMLDOMNode_Release(
node);
1503 hr = IXMLDOMDocument2_selectSingleNode(doc2,
_bstr_(
ptr->query), &
node);
1523 hr = IXMLDOMNode_get_nodeTypedValue(
node, &
v);
1529 switch (
ptr->type_schema)
1543 else if (!
strcmp(
ptr->typename,
"char"))
1553 ok(
V_R4(&
v) == (
float)3.14159265,
"got %f\n",
V_R4(&
v));
1560 ok(
V_R8(&
v) == 3.14159265358979323846,
"got %.20f\n",
V_R8(&
v));
1580 IXMLDOMNode_Release(
node);
1585 IXMLDOMDocument2_Release(
schema);
1586 IXMLDOMDocument2_Release(doc);
1587 IXMLDOMDocument2_Release(doc2);
1588 IXMLDOMSchemaCollection_Release(
cache);
1595 IXMLDOMSchemaCollection2 *
cache;
1602 hr = IXMLDOMSchemaCollection2_get_validateOnLoad(
cache,
NULL);
1606 hr = IXMLDOMSchemaCollection2_get_validateOnLoad(
cache, &
b);
1608 ok(
b == VARIANT_TRUE,
"got %d\n",
b);
1610 IXMLDOMSchemaCollection2_Release(
cache);
1623 hr = IUnknown_QueryInterface(
obj, &IID_IDispatchEx, (
void**)&dispex);
1628 hr = IDispatchEx_GetTypeInfoCount(dispex, &ticnt);
1630 ok(ticnt == 1,
"ticnt=%u\n", ticnt);
1633 hr = IDispatchEx_DeleteMemberByName(dispex,
name, fdexNameCaseSensitive);
1637 hr = IDispatchEx_DeleteMemberByDispID(dispex, dispid);
1641 hr = IDispatchEx_GetMemberProperties(dispex, dispid, grfdexPropCanAll, &
props);
1645 hr = IDispatchEx_GetMemberName(dispex, dispid, &
name);
1653 hr = IDispatchEx_GetNameSpaceParent(dispex, &unk);
1655 ok(unk == (
IUnknown*)0xdeadbeef,
"got %p\n", unk);
1658 hr = IDispatchEx_GetDispID(dispex,
name, fdexNameEnsure, &dispid);
1662 IDispatchEx_Release(dispex);
1667 IXMLDOMSchemaCollection *
cache;
1671 DISPPARAMS dispparams;
1680 IUnknown_Release(unk);
1682 hr = IXMLDOMSchemaCollection_QueryInterface(
cache, &IID_IDispatchEx, (
void**)&dispex);
1687 dispparams.cArgs = 1;
1688 dispparams.cNamedArgs = 0;
1689 dispparams.rgdispidNamedArgs =
NULL;
1690 dispparams.rgvarg = &
arg;
1699 IDispatchEx_Release(dispex);
1700 IXMLDOMSchemaCollection_Release(
cache);
1706 IXMLDOMSchemaCollection_Release(
cache);
1712 IXMLDOMSchemaCollection2 *
cache;
1725 IXMLDOMSchemaCollection2_Release(
cache);
1736 IXMLDOMSchemaCollection2_Release(
cache);
1742 IXMLDOMSchemaCollection2 *
cache;
1753 ok(doc !=
NULL,
"got %p\n", doc);
1764 hr = IXMLDOMSchemaCollection2_get_length(
cache, &
len);
1769 hr = IXMLDOMSchemaCollection2_remove(
cache,
NULL);
1772 hr = IXMLDOMSchemaCollection2_remove(
cache,
_bstr_(
"invaliduri"));
1779 hr = IXMLDOMSchemaCollection2_get_length(
cache, &
len);
1783 IXMLDOMDocument_Release(doc);
1784 IXMLDOMSchemaCollection2_Release(
cache);
1792 ok(doc !=
NULL,
"got %p\n", doc);
1803 hr = IXMLDOMSchemaCollection2_get_length(
cache, &
len);
1807 hr = IXMLDOMSchemaCollection2_remove(
cache,
NULL);
1810 hr = IXMLDOMSchemaCollection2_remove(
cache,
_bstr_(
"invaliduri"));
1814 hr = IXMLDOMSchemaCollection2_get_length(
cache, &
len);
1822 hr = IXMLDOMSchemaCollection2_get_length(
cache, &
len);
1826 IXMLDOMDocument_Release(doc);
1827 IXMLDOMSchemaCollection2_Release(
cache);
1834 IXMLDOMSchemaCollection2 *
cache;
1842 hr = IXMLDOMSchemaCollection2_QueryInterface(
cache, &CLSID_XMLSchemaCache60, (
void**)&unk);
1843 ok (
hr ==
S_OK,
"Could not get CLSID_XMLSchemaCache60 iface: %08x\n",
hr);
1846 IUnknown_Release(unk);
1847 IXMLDOMSchemaCollection2_Release(
cache);
1855 ok(
r ==
S_OK,
"failed to init com\n");
int strcmp(const char *String1, const char *String2)
#define MultiByteToWideChar
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
GLenum GLenum GLenum input
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
static struct test_info tests[]
#define todo_wine_if(is_todo)
static void test_ifaces(void)
static HRESULT validate_regex_document(IXMLDOMDocument2 *doc, IXMLDOMDocument2 *schema, IXMLDOMSchemaCollection *cache, const WCHAR *regex, const WCHAR *input)
#define create_cache(iid)
static const CHAR szOpenSeqXML3[]
static BSTR _bstr_(const char *str)
static BSTR alloced_bstrs[256]
static const CHAR szOpenSeqXML2[]
static const CHAR xdr_schema3_xml[]
static void test_XDR_schemas(void)
#define EXPECT_HR(hr, hr_exp)
#define check_ref_expr(expr, n)
#define create_document_version(v, iid)
static BSTR alloc_str_from_narrow(const char *str)
static const xdr_datatypes xdr_datatypes_data[]
static void test_collection_refs(void)
static const CHAR xsd_schema3_uri[]
static void test_XDR_datatypes(void)
static const CHAR szOpenSeqXDR[]
static const CHAR xsd_schema1_uri[]
static void test_length(void)
static int alloced_bstrs_count
static void free_bstrs(void)
static const CHAR xdr_schema1_uri[]
static void test_regex(void)
#define expect_int64(expr, x, base)
static const CHAR xdr_schema2_uri[]
static void test_remove(void)
static const CHAR szDatatypeXDR[]
#define expect_uint64(expr, x, base)
static const CHAR xdr_schema1_xml[]
static void * _create_object(const GUID *clsid, const char *name, const IID *iid, int line)
static void test_get(void)
static void test_schema_refs(void)
#define check_refs(iface, obj, n)
static const CHAR xsd_schema2_uri[]
static const CHAR xsd_schema1_xml[]
#define create_cache_version(v, iid)
#define create_document(iid)
static void test_validate_on_load(void)
static VARIANT _variantdoc_(void *doc)
static const CHAR szOpenSeqXML1[]
static const CHAR xsd_schema3_xml[]
#define ole_expect(expr, expect)
static void test_obj_dispex(IUnknown *obj)
static void test_collection_content(void)
static const CHAR xdr_schema3_uri[]
static const CHAR xdr_schema2_xml[]
static void test_dispex(void)
static const CHAR szOpenSeqXML4[]
static const CHAR szDatatypeXML[]
static const CHAR xsd_schema2_xml[]
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)
BSTR WINAPI SysAllocStringLen(const OLECHAR *str, unsigned int len)
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
static int winetest_strcmpW(const WCHAR *str1, const WCHAR *str2)
#define win_skip_(file, line)
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
void WINAPI VariantInit(VARIANTARG *pVarg)
static const WCHAR props[]
#define DISP_E_MEMBERNOTFOUND
#define DISP_E_UNKNOWNNAME