30 #undef CLSID_DOMDocument 40 #define EXPECT_HR(hr,hr_exp) \ 41 ok(hr == hr_exp, "got 0x%08x, expected 0x%08x\n", hr, hr_exp) 43 static const WCHAR xdr_schema_uri[] = {
'x',
'-',
's',
'c',
'h',
'e',
'm',
'a',
':',
't',
'e',
's',
't',
'.',
'x',
'm',
'l',0};
46 '<',
'S',
'c',
'h',
'e',
'm',
'a',
' ',
'x',
'm',
'l',
'n',
's',
'=',
'\"',
'u',
'r',
'n',
':',
's',
'c',
'h',
'e',
'm',
'a',
's',
'-',
'm',
'i',
'c',
'r',
'o',
's',
'o',
'f',
't',
'-',
'c',
'o',
'm',
':',
'x',
'm',
'l',
'-',
'd',
'a',
't',
'a',
'\"',
'\n',
47 'x',
'm',
'l',
'n',
's',
':',
'd',
't',
'=',
'\"',
'u',
'r',
'n',
':',
's',
'c',
'h',
'e',
'm',
'a',
's',
'-',
'm',
'i',
'c',
'r',
'o',
's',
'o',
'f',
't',
'-',
'c',
'o',
'm',
':',
'd',
'a',
't',
'a',
't',
'y',
'p',
'e',
's',
'\"',
'>',
'\n',
48 '<',
'/',
'S',
'c',
'h',
'e',
'm',
'a',
'>',
'\n',0
53 "<?xml version='1.0'?>" 54 "<Schema xmlns='urn:schemas-microsoft-com:xml-data'" 55 " xmlns:dt='urn:schemas-microsoft-com:datatypes'" 57 " <ElementType name='x' dt:type='boolean'/>" 58 " <ElementType name='y'>" 59 " <datatype dt:type='int'/>" 61 " <ElementType name='z'/>" 62 " <ElementType name='root' content='eltOnly' model='open' order='seq'>" 63 " <element type='x'/>" 64 " <element type='y'/>" 65 " <element type='z'/>" 71 "<?xml version='1.0'?>" 72 "<Schema xmlns='urn:schemas-microsoft-com:xml-data'" 73 " xmlns:dt='urn:schemas-microsoft-com:datatypes'" 75 " <ElementType name='x' dt:type='bin.base64'/>" 76 " <ElementType name='y' dt:type='uuid'/>" 77 " <ElementType name='z'/>" 78 " <ElementType name='root' content='eltOnly' model='closed' order='one'>" 79 " <element type='x'/>" 80 " <element type='y'/>" 81 " <element type='z'/>" 87 "<?xml version='1.0'?>" 88 "<Schema xmlns='urn:schemas-microsoft-com:xml-data'" 89 " xmlns:dt='urn:schemas-microsoft-com:datatypes'" 91 " <ElementType name='root' content='textOnly' model='open'>" 92 " <AttributeType name='x' dt:type='int'/>" 93 " <AttributeType name='y' dt:type='enumeration' dt:values='a b c'/>" 94 " <AttributeType name='z' dt:type='uuid'/>" 95 " <attribute type='x'/>" 96 " <attribute type='y'/>" 97 " <attribute type='z'/>" 103 "<?xml version='1.0'?>" 104 "<schema xmlns='http://www.w3.org/2001/XMLSchema'" 105 " targetNamespace='x-schema:test1.xsd'>" 106 " <element name='root'>" 108 " <sequence maxOccurs='unbounded'>" 117 "<?xml version='1.0'?>" 118 "<schema xmlns='http://www.w3.org/2001/XMLSchema'" 119 " targetNamespace='x-schema:test2.xsd'>" 120 " <element name='root'>" 122 " <sequence maxOccurs='unbounded'>" 131 "<?xml version='1.0'?>" 132 "<schema xmlns='http://www.w3.org/2001/XMLSchema'" 133 " targetNamespace='x-schema:test3.xsd'>" 134 " <element name='root'>" 136 " <sequence maxOccurs='unbounded'>" 144 "<Schema xmlns='urn:schemas-microsoft-com:xml-data'\n" 145 " xmlns:dt='urn:schemas-microsoft-com:datatypes'>\n" 146 " <ElementType name='base64Data' content='textOnly' dt:type='bin.base64'/>\n" 147 " <ElementType name='hexData' content='textOnly' dt:type='bin.hex'/>\n" 148 " <ElementType name='boolData' content='textOnly' dt:type='boolean'/>\n" 149 " <ElementType name='charData' content='textOnly' dt:type='char'/>\n" 150 " <ElementType name='dateData' content='textOnly' dt:type='date'/>\n" 151 " <ElementType name='dateTimeData' content='textOnly' dt:type='dateTime'/>\n" 152 " <ElementType name='dateTimeTzData' content='textOnly' dt:type='dateTime.tz'/>\n" 153 " <ElementType name='entityData' content='textOnly' dt:type='entity'/>\n" 154 " <ElementType name='entitiesData' content='textOnly' dt:type='entities'/>\n" 155 " <ElementType name='fixedData' content='textOnly' dt:type='fixed.14.4'/>\n" 156 " <ElementType name='floatData' content='textOnly' dt:type='float'/>\n" 157 " <ElementType name='i1Data' content='textOnly' dt:type='i1'/>\n" 158 " <ElementType name='i2Data' content='textOnly' dt:type='i2'/>\n" 159 " <ElementType name='i4Data' content='textOnly' dt:type='i4'/>\n" 160 " <ElementType name='i8Data' content='textOnly' dt:type='i8'/>\n" 161 " <ElementType name='intData' content='textOnly' dt:type='int'/>\n" 162 " <ElementType name='nmtokData' content='textOnly' dt:type='nmtoken'/>\n" 163 " <ElementType name='nmtoksData' content='textOnly' dt:type='nmtokens'/>\n" 164 " <ElementType name='numData' content='textOnly' dt:type='number'/>\n" 165 " <ElementType name='r4Data' content='textOnly' dt:type='r4'/>\n" 166 " <ElementType name='r8Data' content='textOnly' dt:type='r8'/>\n" 167 " <ElementType name='stringData' content='textOnly' dt:type='string'/>\n" 168 " <ElementType name='timeData' content='textOnly' dt:type='time'/>\n" 169 " <ElementType name='timeTzData' content='textOnly' dt:type='time.tz'/>\n" 170 " <ElementType name='u1Data' content='textOnly' dt:type='ui1'/>\n" 171 " <ElementType name='u2Data' content='textOnly' dt:type='ui2'/>\n" 172 " <ElementType name='u4Data' content='textOnly' dt:type='ui4'/>\n" 173 " <ElementType name='u8Data' content='textOnly' dt:type='ui8'/>\n" 174 " <ElementType name='uriData' content='textOnly' dt:type='uri'/>\n" 175 " <ElementType name='uuidData' content='textOnly' dt:type='uuid'/>\n" 177 " <ElementType name='Name' content='textOnly' dt:type='nmtoken'/>\n" 178 " <ElementType name='Value' content='eltOnly' order='many'>\n" 179 " <element type='base64Data'/>\n" 180 " <element type='hexData'/>\n" 181 " <element type='boolData'/>\n" 182 " <element type='charData'/>\n" 183 " <element type='dateData'/>\n" 184 " <element type='dateTimeData'/>\n" 185 " <element type='dateTimeTzData'/>\n" 186 " <element type='entityData'/>\n" 187 " <element type='entitiesData'/>\n" 188 " <element type='fixedData'/>\n" 189 " <element type='floatData'/>\n" 190 " <element type='i1Data'/>\n" 191 " <element type='i2Data'/>\n" 192 " <element type='i4Data'/>\n" 193 " <element type='i8Data'/>\n" 194 " <element type='intData'/>\n" 195 " <element type='nmtokData'/>\n" 196 " <element type='nmtoksData'/>\n" 197 " <element type='numData'/>\n" 198 " <element type='r4Data'/>\n" 199 " <element type='r8Data'/>\n" 200 " <element type='stringData'/>\n" 201 " <element type='timeData'/>\n" 202 " <element type='timeTzData'/>\n" 203 " <element type='u1Data'/>\n" 204 " <element type='u2Data'/>\n" 205 " <element type='u4Data'/>\n" 206 " <element type='u8Data'/>\n" 207 " <element type='uriData'/>\n" 208 " <element type='uuidData'/>\n" 210 " <ElementType name='Property' content='eltOnly' order='seq'>\n" 211 " <element type='Name'/>\n" 212 " <element type='Value'/>\n" 214 " <ElementType name='Properties' content='eltOnly'>\n" 215 " <element type='Property' minOccurs='0' maxOccurs='*'/>\n" 220 "<?xml version='1.0'?>\n" 221 "<Properties xmlns='urn:x-schema:datatype-test-xdr'>\n" 223 " <Name>testBase64</Name>\n" 225 " <base64Data>+HugeNumber+</base64Data>\n" 229 " <Name>testHex</Name>\n" 231 " <hexData>deadbeef</hexData>\n" 235 " <Name>testBool</Name>\n" 237 " <boolData>1</boolData>\n" 241 " <Name>testChar</Name>\n" 243 " <charData>u</charData>\n" 247 " <Name>testDate</Name>\n" 249 " <dateData>1998-02-01</dateData>\n" 253 " <Name>testDateTime</Name>\n" 255 " <dateTimeData>1998-02-01T12:34:56</dateTimeData>\n" 259 " <Name>testDateTimeTz</Name>\n" 261 " <dateTimeTzData>1998-02-01T12:34:56-06:00</dateTimeTzData>\n" 265 " <Name>testFixed</Name>\n" 267 " <fixedData>3.1416</fixedData>\n" 271 " <Name>testFloat</Name>\n" 273 " <floatData>3.14159</floatData>\n" 277 " <Name>testI1</Name>\n" 279 " <i1Data>42</i1Data>\n" 283 " <Name>testI2</Name>\n" 285 " <i2Data>420</i2Data>\n" 289 " <Name>testI4</Name>\n" 291 " <i4Data>-420000000</i4Data>\n" 295 " <Name>testI8</Name>\n" 297 " <i8Data>-4200000000</i8Data>\n" 301 " <Name>testInt</Name>\n" 303 " <intData>42</intData>\n" 307 " <Name>testNmtoken</Name>\n" 309 " <nmtokData>tok1</nmtokData>\n" 313 " <Name>testNmtokens</Name>\n" 315 " <nmtoksData>tok1 tok2 tok3</nmtoksData>\n" 319 " <Name>testNumber</Name>\n" 321 " <numData>3.14159</numData>\n" 325 " <Name>testR4</Name>\n" 327 " <r4Data>3.14159265</r4Data>\n" 331 " <Name>testR8</Name>\n" 333 " <r8Data>3.14159265358979323846</r8Data>\n" 337 " <Name>testString</Name>\n" 339 " <stringData>foo bar</stringData>\n" 343 " <Name>testTime</Name>\n" 345 " <timeData>12:34:56</timeData>\n" 349 " <Name>testTimeTz</Name>\n" 351 " <timeTzData>12:34:56-06:00</timeTzData>\n" 355 " <Name>testU1</Name>\n" 357 " <u1Data>255</u1Data>\n" 361 " <Name>testU2</Name>\n" 363 " <u2Data>65535</u2Data>\n" 367 " <Name>testU4</Name>\n" 369 " <u4Data>4294967295</u4Data>\n" 373 " <Name>testU8</Name>\n" 375 " <u8Data>18446744073709551615</u8Data>\n" 379 " <Name>testURI</Name>\n" 381 " <uriData>urn:schemas-microsoft-com:datatypes</uriData>\n" 385 " <Name>testUUID</Name>\n" 387 " <uuidData>2933BF81-7B36-11D2-B20E-00C04F983E60</uuidData>\n" 393 "<Schema xmlns='urn:schemas-microsoft-com:xml-data'>\n" 394 " <ElementType name='w' content='empty' model='closed'/>\n" 395 " <ElementType name='x' content='empty' model='closed'/>\n" 396 " <ElementType name='y' content='empty' model='closed'/>\n" 397 " <ElementType name='z' content='empty' model='closed'/>\n" 398 " <ElementType name='test' content='eltOnly' model='open' order='seq'>\n" 399 " <element type='x'/>\n" 400 " <group order='seq'>\n" 401 " <element type='x'/>\n" 402 " <element type='y'/>\n" 403 " <element type='z'/>\n" 405 " <element type='z'/>\n" 414 #define check_ref_expr(expr, n) { \ 416 ok(ref == n, "expected %i refs, got %i\n", n, ref); \ 419 #define check_refs(iface, obj, n) { \ 420 LONG ref = iface ## _AddRef(obj); \ 421 ok(ref == n+1, "expected %i refs, got %i\n", n+1, ref); \ 422 ref = iface ## _Release(obj); \ 423 ok(ref == n, "expected %i refs, got %i\n", n, ref); \ 426 #define ole_check(expr) { \ 428 ok(r == S_OK, #expr " returned %x\n", r); \ 431 #define ole_expect(expr, expect) { \ 433 ok(r == (expect), #expr " returned %x, expected %x\n", r, expect); \ 436 #define _expect64(expr, str, base, TYPE, CONV) { \ 438 TYPE v2 = CONV(str, NULL, base); \ 439 ok(v1 == v2, #expr "returned %s, expected %s\n", \ 440 wine_dbgstr_longlong(v1), wine_dbgstr_longlong(v2)); \ 444 #define expect_int64(expr, x, base) _expect64(expr, #x, base, LONG64, _strtoi64) 445 #define expect_uint64(expr, x, base) _expect64(expr, #x, base, ULONG64, _strtoui64) 447 #define expect_int64(expr, x, base) _expect64(expr, #x, base, LONG64, strtoll) 448 #define expect_uint64(expr, x, base) _expect64(expr, #x, base, ULONG64, strtoull) 497 #define _create(cls) cls, #cls 499 #define create_document(iid) _create_object(&_create(CLSID_DOMDocument), iid, __LINE__) 501 #define create_document_version(v, iid) _create_object(&_create(CLSID_DOMDocument ## v), iid, __LINE__) 503 #define create_cache(iid) _create_object(&_create(CLSID_XMLSchemaCache), iid, __LINE__) 505 #define create_cache_version(v, iid) _create_object(&_create(CLSID_XMLSchemaCache ## v), iid, __LINE__) 510 IXMLDOMDocument2 *doc;
512 IXMLDOMSchemaCollection *
cache;
526 IXMLDOMDocument2_Release(doc);
533 ok(
b == VARIANT_TRUE,
"b %04x\n",
b);
536 node = (
void*)0xdeadbeef;
554 IXMLDOMNode_Release(
node);
560 IXMLDOMNode_Release(
node);
576 hr = IXMLDOMSchemaCollection_get_length(
cache, &
len);
583 hr = IXMLDOMSchemaCollection_get_length(
cache, &
len);
604 ole_check(IXMLDOMDocument2_putref_schemas(doc,
v));
611 ole_check(IXMLDOMDocument2_get_schemas(doc, &
v));
616 ole_check(IXMLDOMDocument2_get_schemas(doc, &
v));
636 ole_check(IXMLDOMDocument2_putref_schemas(doc,
v));
643 ole_check(IXMLDOMDocument2_putref_schemas(doc,
v));
650 ole_check(IXMLDOMDocument2_putref_schemas(doc,
v));
658 ole_check(IXMLDOMDocument2_putref_schemas(doc,
v));
672 IXMLDOMDocument2 *schema1, *schema2, *schema3;
673 IXMLDOMSchemaCollection *cache1, *cache2, *cache3;
678 ok(schema1 !=
NULL,
"Failed to create a document.\n");
681 ok(cache1 !=
NULL,
"Failed to create schema collection.\n");
683 if (!schema1 || !cache1)
686 IXMLDOMDocument2_Release(schema1);
688 IXMLDOMSchemaCollection_Release(cache1);
699 ok(
b == VARIANT_TRUE,
"failed to load XML\n");
702 ok(
b == VARIANT_TRUE,
"failed to load XML\n");
705 ok(
b == VARIANT_TRUE,
"failed to load XML\n");
724 if (schema1)
check_refs(IXMLDOMDocument2, schema1, 1);
725 if (schema2)
check_refs(IXMLDOMDocument2, schema2, 1);
726 if (schema3)
check_refs(IXMLDOMDocument2, schema3, 1);
729 ole_check(IXMLDOMSchemaCollection_addCollection(cache2, cache1));
730 ole_check(IXMLDOMSchemaCollection_addCollection(cache3, cache2));
746 check_refs(IXMLDOMSchemaCollection, cache1, 1);
747 check_refs(IXMLDOMSchemaCollection, cache2, 1);
748 check_refs(IXMLDOMSchemaCollection, cache3, 1);
751 if (schema1)
check_refs(IXMLDOMDocument2, schema1, 1);
752 if (schema2)
check_refs(IXMLDOMDocument2, schema2, 1);
753 if (schema3)
check_refs(IXMLDOMDocument2, schema3, 1);
755 if (schema1)
check_ref_expr(IXMLDOMDocument2_Release(schema1), 0);
756 if (schema2)
check_ref_expr(IXMLDOMDocument2_Release(schema2), 0);
757 if (schema3)
check_ref_expr(IXMLDOMDocument2_Release(schema3), 0);
768 if (schema1)
check_refs(IXMLDOMDocument2, schema1, 1);
769 if (schema2)
check_refs(IXMLDOMDocument2, schema2, 1);
770 if (schema3)
check_refs(IXMLDOMDocument2, schema3, 1);
778 if (schema1)
check_refs(IXMLDOMDocument2, schema1, 1);
779 if (schema2)
check_refs(IXMLDOMDocument2, schema2, 1);
780 if (schema3)
check_refs(IXMLDOMDocument2, schema3, 1);
782 if (schema1)
check_ref_expr(IXMLDOMDocument2_Release(schema1), 0);
783 if (schema2)
check_ref_expr(IXMLDOMDocument2_Release(schema2), 0);
784 if (schema3)
check_ref_expr(IXMLDOMDocument2_Release(schema3), 0);
791 IXMLDOMDocument2 *schema1, *schema2, *schema3;
792 IXMLDOMSchemaCollection *
cache;
803 if (!schema1 || !schema2 || !schema3 || !
cache)
805 if (schema1) IXMLDOMDocument2_Release(schema1);
806 if (schema2) IXMLDOMDocument2_Release(schema2);
807 if (schema3) IXMLDOMDocument2_Release(schema3);
809 if (
cache) IXMLDOMSchemaCollection_Release(
cache);
817 ok(
b == VARIANT_TRUE,
"failed to load XML\n");
820 ok(
b == VARIANT_TRUE,
"failed to load XML\n");
823 ok(
b == VARIANT_TRUE,
"failed to load XML\n");
873 IXMLDOMDocument2_Release(schema1);
874 IXMLDOMDocument2_Release(schema2);
875 IXMLDOMDocument2_Release(schema3);
876 IXMLDOMSchemaCollection_Release(
cache);
883 IXMLDOMDocument2 *schema1, *schema2, *schema3, *schema4, *schema5;
885 IXMLDOMSchemaCollection *cache1, *cache2;
899 if (!schema1 || !schema2 || !schema3 || !cache1)
901 if (schema1) IXMLDOMDocument2_Release(schema1);
902 if (schema2) IXMLDOMDocument2_Release(schema2);
903 if (schema3) IXMLDOMDocument2_Release(schema3);
905 if (cache1) IXMLDOMSchemaCollection_Release(cache1);
911 ok(
b == VARIANT_TRUE,
"failed to load XML\n");
914 ok(
b == VARIANT_TRUE,
"failed to load XML\n");
917 ok(
b == VARIANT_TRUE,
"failed to load XML\n");
927 IXMLDOMDocument2_Release(schema1);
928 IXMLDOMDocument2_Release(schema2);
929 IXMLDOMDocument2_Release(schema3);
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");
945 ok(
b == VARIANT_TRUE,
"failed to load XML\n");
947 ok(
b == VARIANT_TRUE,
"failed to load XML\n");
960 IXMLDOMDocument2_Release(schema1);
961 IXMLDOMDocument2_Release(schema2);
962 IXMLDOMDocument2_Release(schema3);
963 IXMLDOMDocument2_Release(schema4);
964 IXMLDOMDocument2_Release(schema5);
967 bstr = (
void*)0xdeadbeef;
969 hr = IXMLDOMSchemaCollection_get_namespaceURI(cache1, 3, &bstr);
971 ok(bstr == (
void*)0xdeadbeef,
"got %p\n", bstr);
980 ok(!schema1,
"expected NULL\n");
983 ok(!schema1,
"expected NULL\n");
987 for (
i = 0;
i < 3; ++
i)
990 ole_check(IXMLDOMSchemaCollection_get_namespaceURI(cache1,
i, &bstr));
991 ok(bstr !=
NULL && *bstr,
"expected non-empty string\n");
994 for (
j = 0;
j <
i; ++
j)
998 for (
i = 0;
i < 3; ++
i)
1006 for (
i = 0;
i < 5; ++
i)
1009 ole_check(IXMLDOMSchemaCollection_get_namespaceURI(cache2,
i, &bstr));
1010 ok(bstr !=
NULL && *bstr,
"expected non-empty string\n");
1012 for (
j = 0;
j <
i; ++
j)
1017 for (
i = 0;
i < 5; ++
i)
1024 IXMLDOMSchemaCollection_Release(cache1);
1025 if (cache2) IXMLDOMSchemaCollection_Release(cache2);
1032 IXMLDOMDocument2 *doc, *
schema;
1033 IXMLDOMSchemaCollection*
cache;
1045 if (doc) IXMLDOMDocument2_Release(doc);
1047 if (
cache) IXMLDOMSchemaCollection_Release(
cache);
1055 ok(
b == VARIANT_TRUE,
"failed to load XML string\n");
1058 ok(
b == VARIANT_TRUE,
"failed to load XML string\n");
1073 ole_check(IXMLDOMDocument2_putref_schemas(doc,
v));
1082 ok(
err !=
NULL,
"domdoc_validate() should always set err\n");
1086 IXMLDOMParseError_Release(
err);
1089 IXMLDOMDocument2_Release(doc);
1092 ok(
b == VARIANT_TRUE,
"failed to load XML string\n");
1099 ole_check(IXMLDOMDocument2_putref_schemas(doc,
v));
1108 ok(
err !=
NULL,
"domdoc_validate() should always set err\n");
1112 IXMLDOMParseError_Release(
err);
1115 IXMLDOMDocument2_Release(doc);
1118 ok(
b == VARIANT_TRUE,
"failed to load XML string\n");
1125 ole_check(IXMLDOMDocument2_putref_schemas(doc,
v));
1133 ok(
err !=
NULL,
"domdoc_validate() should always set err\n");
1136 IXMLDOMParseError_Release(
err);
1139 IXMLDOMDocument2_Release(doc);
1142 ok(
b == VARIANT_TRUE,
"failed to load XML string\n");
1149 ole_check(IXMLDOMDocument2_putref_schemas(doc,
v));
1157 ok(
err !=
NULL,
"domdoc_validate() should always set err\n");
1160 IXMLDOMParseError_Release(
err);
1162 IXMLDOMDocument2_Release(doc);
1163 IXMLDOMDocument2_Release(
schema);
1164 IXMLDOMSchemaCollection_Release(
cache);
1172 const char *
typename;
1177 {
"//Property[Name!text()='testBase64']/Value/base64Data",
VT_ARRAY|
VT_UI1,
"bin.base64" },
1178 {
"//Property[Name!text()='testHex']/Value/hexData",
VT_ARRAY|
VT_UI1,
"bin.hex" },
1179 {
"//Property[Name!text()='testBool']/Value/boolData",
VT_BOOL,
"boolean" },
1180 {
"//Property[Name!text()='testChar']/Value/charData",
VT_I4,
"char",
TRUE },
1181 {
"//Property[Name!text()='testDate']/Value/dateData",
VT_DATE,
"date" },
1182 {
"//Property[Name!text()='testDateTime']/Value/dateTimeData",
VT_DATE,
"dateTime" },
1183 {
"//Property[Name!text()='testDateTimeTz']/Value/dateTimeTzData",
VT_DATE,
"dateTime.tz" },
1184 {
"//Property[Name!text()='testFixed']/Value/fixedData",
VT_CY,
"fixed.14.4" },
1185 {
"//Property[Name!text()='testFloat']/Value/floatData",
VT_R8,
"float" },
1186 {
"//Property[Name!text()='testI1']/Value/i1Data",
VT_I1,
"i1" },
1187 {
"//Property[Name!text()='testI2']/Value/i2Data",
VT_I2,
"i2" },
1188 {
"//Property[Name!text()='testI4']/Value/i4Data",
VT_I4,
"i4" },
1189 {
"//Property[Name!text()='testI8']/Value/i8Data",
VT_NULL,
"i8",
TRUE },
1190 {
"//Property[Name!text()='testInt']/Value/intData",
VT_I4,
"int" },
1191 {
"//Property[Name!text()='testNmtoken']/Value/nmtokData",
VT_BSTR,
NULL },
1192 {
"//Property[Name!text()='testNmtokens']/Value/nmtoksData",
VT_BSTR,
NULL },
1193 {
"//Property[Name!text()='testNumber']/Value/numData",
VT_BSTR,
"number" },
1194 {
"//Property[Name!text()='testR4']/Value/r4Data",
VT_R4,
"r4" },
1195 {
"//Property[Name!text()='testR8']/Value/r8Data",
VT_R8,
"r8" },
1196 {
"//Property[Name!text()='testString']/Value/stringData",
VT_BSTR,
NULL },
1197 {
"//Property[Name!text()='testTime']/Value/timeData",
VT_DATE,
"time" },
1198 {
"//Property[Name!text()='testTimeTz']/Value/timeTzData",
VT_DATE,
"time.tz" },
1199 {
"//Property[Name!text()='testU1']/Value/u1Data",
VT_UI1,
"ui1" },
1200 {
"//Property[Name!text()='testU2']/Value/u2Data",
VT_UI2,
"ui2" },
1201 {
"//Property[Name!text()='testU4']/Value/u4Data",
VT_UI4,
"ui4" },
1202 {
"//Property[Name!text()='testU8']/Value/u8Data",
VT_NULL,
"ui8",
TRUE },
1203 {
"//Property[Name!text()='testURI']/Value/uriData",
VT_BSTR,
"uri" },
1204 {
"//Property[Name!text()='testUUID']/Value/uuidData",
VT_BSTR,
"uuid" },
1210 IXMLDOMDocument2 *doc, *
schema, *doc2;
1211 IXMLDOMSchemaCollection*
cache;
1229 if (doc) IXMLDOMDocument2_Release(doc);
1230 if (doc2) IXMLDOMDocument2_Release(doc2);
1232 if (
cache) IXMLDOMSchemaCollection_Release(
cache);
1238 ok(
b == VARIANT_TRUE,
"failed to load XML string\n");
1242 ok(
b == VARIANT_TRUE,
"failed to load XML string\n");
1246 ok(
b == VARIANT_TRUE,
"failed to load XML string\n");
1249 hr = IXMLDOMDocument2_validate(doc, &
err);
1251 ok(
err !=
NULL,
"domdoc_validate() should always set err\n");
1252 hr = IXMLDOMParseError_get_errorCode(
err, &
l);
1254 ok(
l == E_XML_NODTD,
"got %08x\n",
l);
1255 IXMLDOMParseError_Release(
err);
1258 hr = IXMLDOMDocument2_validate(doc2, &
err);
1260 ok(
err !=
NULL,
"domdoc_validate() should always set err\n");
1261 hr = IXMLDOMParseError_get_errorCode(
err, &
l);
1263 ok(
l == E_XML_NODTD,
"got %08x\n",
l);
1264 IXMLDOMParseError_Release(
err);
1272 hr = IXMLDOMSchemaCollection_add(
cache,
_bstr_(
"urn:x-schema:datatype-test-xdr"),
v);
1282 hr = IXMLDOMDocument2_putref_schemas(doc2,
v);
1290 hr = IXMLDOMDocument2_validate(doc2, &
err);
1292 ok(
err !=
NULL,
"domdoc_validate() should always set err\n");
1293 hr = IXMLDOMParseError_get_errorCode(
err, &
l);
1295 hr = IXMLDOMParseError_get_reason(
err, &bstr);
1299 IXMLDOMParseError_Release(
err);
1308 hr = IXMLDOMDocument2_selectSingleNode(doc,
_bstr_(
ptr->query), &
node);
1321 hr = IXMLDOMNode_get_nodeTypedValue(
node, &
type);
1325 IXMLDOMNode_Release(
node);
1329 hr = IXMLDOMDocument2_selectSingleNode(doc2,
_bstr_(
ptr->query), &
node);
1349 hr = IXMLDOMNode_get_nodeTypedValue(
node, &
v);
1355 switch (
ptr->type_schema)
1369 else if (!
strcmp(
ptr->typename,
"char"))
1379 ok(
V_R4(&
v) == (
float)3.14159265,
"got %f\n",
V_R4(&
v));
1386 ok(
V_R8(&
v) == 3.14159265358979323846,
"got %.20f\n",
V_R8(&
v));
1406 IXMLDOMNode_Release(
node);
1411 IXMLDOMDocument2_Release(
schema);
1412 IXMLDOMDocument2_Release(doc);
1413 IXMLDOMDocument2_Release(doc2);
1414 IXMLDOMSchemaCollection_Release(
cache);
1421 IXMLDOMSchemaCollection2 *
cache;
1428 hr = IXMLDOMSchemaCollection2_get_validateOnLoad(
cache,
NULL);
1432 hr = IXMLDOMSchemaCollection2_get_validateOnLoad(
cache, &
b);
1434 ok(
b == VARIANT_TRUE,
"got %d\n",
b);
1436 IXMLDOMSchemaCollection2_Release(
cache);
1441 static const WCHAR testW[] = {
't',
'e',
's',
't',
'p',
'r',
'o',
'p',0};
1444 IDispatchEx *dispex;
1451 hr = IUnknown_QueryInterface(
obj, &IID_IDispatchEx, (
void**)&dispex);
1456 hr = IDispatchEx_GetTypeInfoCount(dispex, &ticnt);
1458 ok(ticnt == 1,
"ticnt=%u\n", ticnt);
1461 hr = IDispatchEx_DeleteMemberByName(dispex,
name, fdexNameCaseSensitive);
1465 hr = IDispatchEx_DeleteMemberByDispID(dispex, dispid);
1473 hr = IDispatchEx_GetMemberName(dispex, dispid, &
name);
1481 hr = IDispatchEx_GetNameSpaceParent(dispex, &unk);
1483 ok(unk == (
IUnknown*)0xdeadbeef,
"got %p\n", unk);
1486 hr = IDispatchEx_GetDispID(dispex,
name, fdexNameEnsure, &dispid);
1490 IDispatchEx_Release(dispex);
1495 IXMLDOMSchemaCollection *
cache;
1496 IDispatchEx *dispex;
1508 IUnknown_Release(unk);
1510 hr = IXMLDOMSchemaCollection_QueryInterface(
cache, &IID_IDispatchEx, (
void**)&dispex);
1515 dispparams.cArgs = 1;
1516 dispparams.cNamedArgs = 0;
1517 dispparams.rgdispidNamedArgs =
NULL;
1518 dispparams.rgvarg = &
arg;
1527 IDispatchEx_Release(dispex);
1528 IXMLDOMSchemaCollection_Release(
cache);
1534 IXMLDOMSchemaCollection_Release(
cache);
1540 IXMLDOMSchemaCollection2 *
cache;
1553 IXMLDOMSchemaCollection2_Release(
cache);
1564 IXMLDOMSchemaCollection2_Release(
cache);
1570 IXMLDOMSchemaCollection2 *
cache;
1581 ok(doc !=
NULL,
"got %p\n", doc);
1592 hr = IXMLDOMSchemaCollection2_get_length(
cache, &
len);
1597 hr = IXMLDOMSchemaCollection2_remove(
cache,
NULL);
1600 hr = IXMLDOMSchemaCollection2_remove(
cache,
_bstr_(
"invaliduri"));
1607 hr = IXMLDOMSchemaCollection2_get_length(
cache, &
len);
1611 IXMLDOMDocument_Release(doc);
1612 IXMLDOMSchemaCollection2_Release(
cache);
1620 ok(doc !=
NULL,
"got %p\n", doc);
1631 hr = IXMLDOMSchemaCollection2_get_length(
cache, &
len);
1635 hr = IXMLDOMSchemaCollection2_remove(
cache,
NULL);
1638 hr = IXMLDOMSchemaCollection2_remove(
cache,
_bstr_(
"invaliduri"));
1642 hr = IXMLDOMSchemaCollection2_get_length(
cache, &
len);
1650 hr = IXMLDOMSchemaCollection2_get_length(
cache, &
len);
1654 IXMLDOMDocument_Release(doc);
1655 IXMLDOMSchemaCollection2_Release(
cache);
1662 IXMLDOMSchemaCollection2 *
cache;
1670 hr = IXMLDOMSchemaCollection2_QueryInterface(
cache, &CLSID_XMLSchemaCache60, (
void**)&unk);
1671 ok (
hr ==
S_OK,
"Could not get CLSID_XMLSchemaCache60 iface: %08x\n",
hr);
1674 IUnknown_Release(unk);
1675 IXMLDOMSchemaCollection2_Release(
cache);
1683 ok(
r ==
S_OK,
"failed to init com\n");
#define DISP_E_UNKNOWNNAME
static const WCHAR xdr_schema_xml[]
static const CHAR xsd_schema1_uri[]
#define DISPID_XMLDOM_SCHEMACOLLECTION_ADD
#define ole_expect(expr, expect)
BSTR WINAPI SysAllocStringLen(const OLECHAR *str, unsigned int len)
static BSTR alloc_str_from_narrow(const char *str)
static const CHAR szOpenSeqXML4[]
GLdouble GLdouble GLdouble r
char * wine_dbgstr_w(const wchar_t *wstr)
int WINAPI lstrcmpW(LPCWSTR lpString1, LPCWSTR lpString2)
static const CHAR xdr_schema2_xml[]
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG x1
static int alloced_bstrs_count
#define DISP_E_MEMBERNOTFOUND
static const CHAR szOpenSeqXML1[]
static const CHAR szOpenSeqXML2[]
#define expect_int64(expr, x, base)
void WINAPI VariantInit(VARIANTARG *pVarg)
static const CHAR xdr_schema2_uri[]
GLsizei GLsizei GLuint * obj
grfdexPropCanAll(fdexPropCanGet|fdexPropCanPut|fdexPropCanPutRef|\\")
cpp_quote(" fdexPropCanCall|fdexPropCanConstruct|fdexPropCanSourceEvents)") cpp_quote("cpp_quote(" (fdexPropCannotGet | fdexPropCannotPut | fdexPropCannotPutRef | \\") cpp_quote(" fdexPropCannotCall | fdexPropCannotConstruct | fdexPropCannotSourceEvents)") cpp_quote("cpp_quote("(fdexPropNoSideEffects|fdexPropDynamicType)") cpp_quote("cpp_quote(" (grfdexPropCanAll | grfdexPropCannotAll | grfdexPropExtraAll)") cpp_quote(" cpp_quote("cpp_quote(" [ object
static void * _create_object(const GUID *clsid, const char *name, const IID *iid, int line)
static void test_XDR_schemas(void)
GLenum GLuint GLenum GLsizei length
#define win_skip_(file, line)
static void test_XDR_datatypes(void)
static void test_schema_refs(void)
static const CHAR xsd_schema1_xml[]
static const CHAR xdr_schema1_xml[]
BSTR WINAPI SysAllocString(LPCOLESTR str)
static int winetest_strcmpW(const WCHAR *str1, const WCHAR *str2)
static const CHAR xsd_schema2_xml[]
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 const CHAR szOpenSeqXML3[]
static void test_remove(void)
static const CHAR xsd_schema3_uri[]
#define todo_wine_if(is_todo)
GLboolean GLboolean GLboolean b
static void test_collection_content(void)
static const CHAR szDatatypeXDR[]
static const CHAR xdr_schema3_uri[]
static void test_collection_refs(void)
static void test_ifaces(void)
static void test_length(void)
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
#define expect_uint64(expr, x, base)
static const CHAR szDatatypeXML[]
static const CHAR szOpenSeqXDR[]
#define create_cache(iid)
#define check_refs(iface, obj, n)
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
static void test_dispex(void)
static BSTR alloced_bstrs[256]
#define DISPID_SAX_XMLREADER_GETFEATURE
static VARIANTARG static DISPID
#define create_document_version(v, iid)
static const WCHAR emptyW[]
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
static void test_validate_on_load(void)
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
static const xdr_datatypes xdr_datatypes_data[]
static const WCHAR xdr_schema_uri[]
static void test_obj_dispex(IUnknown *obj)
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
#define create_document(iid)
static const WCHAR starW[]
#define MultiByteToWideChar
static const CHAR xdr_schema1_uri[]
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
#define EXPECT_HR(hr, hr_exp)
static BSTR _bstr_(const char *str)
static const WCHAR props[]
struct stdole::DISPPARAMS DISPPARAMS
int strcmp(const char *String1, const char *String2)
#define check_ref_expr(expr, n)
static const CHAR xsd_schema3_xml[]
static const CHAR xsd_schema2_uri[]
GLuint GLuint GLsizei GLenum type
static void test_get(void)
#define create_cache_version(v, iid)
static VARIANT _variantdoc_(void *doc)
static const WCHAR testW[]
static const CHAR xdr_schema3_xml[]
static void free_bstrs(void)
GLuint const GLchar * name