Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
5fc439a7
Commit
5fc439a7
authored
Nov 12, 2010
by
Adam Martinson
Committed by
Alexandre Julliard
Nov 15, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msxml3: XDR schema support.
parent
2a4c07a7
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
69 additions
and
51 deletions
+69
-51
Makefile.in
dlls/msxml3/Makefile.in
+1
-0
schema.c
dlls/msxml3/schema.c
+37
-20
domdoc.c
dlls/msxml3/tests/domdoc.c
+6
-6
schema.c
dlls/msxml3/tests/schema.c
+25
-25
xdr.c
dlls/msxml3/xdr.c
+0
-0
No files found.
dlls/msxml3/Makefile.in
View file @
5fc439a7
...
@@ -30,6 +30,7 @@ C_SRCS = \
...
@@ -30,6 +30,7 @@ C_SRCS = \
schema.c
\
schema.c
\
text.c
\
text.c
\
uuid.c
\
uuid.c
\
xdr.c
\
xmldoc.c
\
xmldoc.c
\
xmlelem.c
xmlelem.c
...
...
dlls/msxml3/schema.c
View file @
5fc439a7
...
@@ -37,13 +37,13 @@
...
@@ -37,13 +37,13 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
msxml
);
WINE_DEFAULT_DEBUG_CHANNEL
(
msxml
);
/* We use a chained hashtable, which can hold any number of schemas
/* We use a chained hashtable, which can hold any number of schemas
* TODO:
XDR schema support
* TODO:
versioned constructor
* TODO: grow/shrink hashtable depending on load factor
* TODO: grow/shrink hashtable depending on load factor
* TODO: implement read-only where appropriate
* TODO: implement read-only where appropriate
*/
*/
/* This is just the number of buckets, should be prime */
/* This is just the number of buckets, should be prime */
#define DEFAULT_HASHTABLE_SIZE
31
#define DEFAULT_HASHTABLE_SIZE
17
#ifdef HAVE_LIBXML2
#ifdef HAVE_LIBXML2
...
@@ -52,6 +52,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(msxml);
...
@@ -52,6 +52,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(msxml);
#include <libxml/schemasInternals.h>
#include <libxml/schemasInternals.h>
#include <libxml/hash.h>
#include <libxml/hash.h>
xmlDocPtr
XDR_to_XSD_doc
(
xmlDocPtr
xdr_doc
,
xmlChar
const
*
nsURI
);
static
const
xmlChar
XSD_schema
[]
=
"schema"
;
static
const
xmlChar
XSD_schema
[]
=
"schema"
;
static
const
xmlChar
XSD_nsURI
[]
=
"http://www.w3.org/2001/XMLSchema"
;
static
const
xmlChar
XSD_nsURI
[]
=
"http://www.w3.org/2001/XMLSchema"
;
static
const
xmlChar
XDR_schema
[]
=
"Schema"
;
static
const
xmlChar
XDR_schema
[]
=
"Schema"
;
...
@@ -114,6 +116,9 @@ static LONG cache_entry_release(cache_entry* entry)
...
@@ -114,6 +116,9 @@ static LONG cache_entry_release(cache_entry* entry)
else
/* SCHEMA_TYPE_XDR */
else
/* SCHEMA_TYPE_XDR */
{
{
xmldoc_release
(
entry
->
doc
);
xmldoc_release
(
entry
->
doc
);
xmldoc_release
(
entry
->
schema
->
doc
);
entry
->
schema
->
doc
=
NULL
;
xmlSchemaFree
(
entry
->
schema
);
heap_free
(
entry
);
heap_free
(
entry
);
}
}
}
}
...
@@ -147,7 +152,7 @@ static inline SCHEMA_TYPE schema_type_from_xmlDocPtr(xmlDocPtr schema)
...
@@ -147,7 +152,7 @@ static inline SCHEMA_TYPE schema_type_from_xmlDocPtr(xmlDocPtr schema)
return
SCHEMA_TYPE_INVALID
;
return
SCHEMA_TYPE_INVALID
;
}
}
static
cache_entry
*
cache_entry_from_url
(
char
const
*
url
)
static
cache_entry
*
cache_entry_from_url
(
char
const
*
url
,
xmlChar
const
*
nsURI
)
{
{
cache_entry
*
entry
=
heap_alloc
(
sizeof
(
cache_entry
));
cache_entry
*
entry
=
heap_alloc
(
sizeof
(
cache_entry
));
xmlSchemaParserCtxtPtr
spctx
=
xmlSchemaNewParserCtxt
(
url
);
xmlSchemaParserCtxtPtr
spctx
=
xmlSchemaNewParserCtxt
(
url
);
...
@@ -157,6 +162,8 @@ static cache_entry* cache_entry_from_url(char const* url)
...
@@ -157,6 +162,8 @@ static cache_entry* cache_entry_from_url(char const* url)
{
{
if
((
entry
->
schema
=
xmlSchemaParse
(
spctx
)))
if
((
entry
->
schema
=
xmlSchemaParse
(
spctx
)))
{
{
/* TODO: if the nsURI is different from the default xmlns or targetNamespace,
* do we need to do something special here? */
xmldoc_init
(
entry
->
schema
->
doc
,
&
CLSID_DOMDocument40
);
xmldoc_init
(
entry
->
schema
->
doc
,
&
CLSID_DOMDocument40
);
entry
->
doc
=
entry
->
schema
->
doc
;
entry
->
doc
=
entry
->
schema
->
doc
;
xmldoc_add_ref
(
entry
->
doc
);
xmldoc_add_ref
(
entry
->
doc
);
...
@@ -177,12 +184,14 @@ static cache_entry* cache_entry_from_url(char const* url)
...
@@ -177,12 +184,14 @@ static cache_entry* cache_entry_from_url(char const* url)
return
entry
;
return
entry
;
}
}
static
cache_entry
*
cache_entry_from_xsd_doc
(
xmlDocPtr
doc
)
static
cache_entry
*
cache_entry_from_xsd_doc
(
xmlDocPtr
doc
,
xmlChar
const
*
nsURI
)
{
{
cache_entry
*
entry
=
heap_alloc
(
sizeof
(
cache_entry
));
cache_entry
*
entry
=
heap_alloc
(
sizeof
(
cache_entry
));
xmlSchemaParserCtxtPtr
spctx
;
xmlSchemaParserCtxtPtr
spctx
;
xmlDocPtr
new_doc
=
xmlCopyDoc
(
doc
,
1
);
xmlDocPtr
new_doc
=
xmlCopyDoc
(
doc
,
1
);
/* TODO: if the nsURI is different from the default xmlns or targetNamespace,
* do we need to do something special here? */
entry
->
type
=
SCHEMA_TYPE_XSD
;
entry
->
type
=
SCHEMA_TYPE_XSD
;
entry
->
ref
=
0
;
entry
->
ref
=
0
;
spctx
=
xmlSchemaNewDocParserCtxt
(
new_doc
);
spctx
=
xmlSchemaNewDocParserCtxt
(
new_doc
);
...
@@ -204,18 +213,33 @@ static cache_entry* cache_entry_from_xsd_doc(xmlDocPtr doc)
...
@@ -204,18 +213,33 @@ static cache_entry* cache_entry_from_xsd_doc(xmlDocPtr doc)
return
entry
;
return
entry
;
}
}
static
cache_entry
*
cache_entry_from_xdr_doc
(
xmlDocPtr
doc
)
static
cache_entry
*
cache_entry_from_xdr_doc
(
xmlDocPtr
doc
,
xmlChar
const
*
nsURI
)
{
{
cache_entry
*
entry
=
heap_alloc
(
sizeof
(
cache_entry
));
cache_entry
*
entry
=
heap_alloc
(
sizeof
(
cache_entry
));
xmlDocPtr
new_doc
=
xmlCopyDoc
(
doc
,
1
);
xmlSchemaParserCtxtPtr
spctx
;
xmlDocPtr
new_doc
=
xmlCopyDoc
(
doc
,
1
),
xsd_doc
=
XDR_to_XSD_doc
(
doc
,
nsURI
);
FIXME
(
"XDR schema support not implemented
\n
"
);
entry
->
type
=
SCHEMA_TYPE_XDR
;
entry
->
type
=
SCHEMA_TYPE_XDR
;
entry
->
ref
=
0
;
entry
->
ref
=
0
;
entry
->
schema
=
NULL
;
spctx
=
xmlSchemaNewDocParserCtxt
(
xsd_doc
);
if
((
entry
->
schema
=
xmlSchemaParse
(
spctx
)))
{
entry
->
doc
=
new_doc
;
entry
->
doc
=
new_doc
;
xmldoc_init
(
entry
->
schema
->
doc
,
&
CLSID_DOMDocument30
);
xmldoc_init
(
entry
->
doc
,
&
CLSID_DOMDocument30
);
xmldoc_init
(
entry
->
doc
,
&
CLSID_DOMDocument30
);
xmldoc_add_ref
(
entry
->
doc
);
xmldoc_add_ref
(
entry
->
doc
);
xmldoc_add_ref
(
entry
->
schema
->
doc
);
}
else
{
FIXME
(
"failed to parse doc
\n
"
);
xmlFreeDoc
(
new_doc
);
xmlFreeDoc
(
xsd_doc
);
heap_free
(
entry
);
entry
=
NULL
;
}
xmlSchemaFreeParserCtxt
(
spctx
);
return
entry
;
return
entry
;
}
}
...
@@ -363,7 +387,7 @@ static HRESULT WINAPI schema_cache_add(IXMLDOMSchemaCollection2* iface, BSTR uri
...
@@ -363,7 +387,7 @@ static HRESULT WINAPI schema_cache_add(IXMLDOMSchemaCollection2* iface, BSTR uri
case
VT_BSTR
:
case
VT_BSTR
:
{
{
xmlChar
*
url
=
xmlChar_from_wchar
(
V_BSTR
(
&
var
));
xmlChar
*
url
=
xmlChar_from_wchar
(
V_BSTR
(
&
var
));
cache_entry
*
entry
=
cache_entry_from_url
((
char
const
*
)
url
);
cache_entry
*
entry
=
cache_entry_from_url
((
char
const
*
)
url
,
name
);
heap_free
(
url
);
heap_free
(
url
);
if
(
entry
)
if
(
entry
)
...
@@ -402,11 +426,11 @@ static HRESULT WINAPI schema_cache_add(IXMLDOMSchemaCollection2* iface, BSTR uri
...
@@ -402,11 +426,11 @@ static HRESULT WINAPI schema_cache_add(IXMLDOMSchemaCollection2* iface, BSTR uri
if
(
type
==
SCHEMA_TYPE_XSD
)
if
(
type
==
SCHEMA_TYPE_XSD
)
{
{
entry
=
cache_entry_from_xsd_doc
(
doc
);
entry
=
cache_entry_from_xsd_doc
(
doc
,
name
);
}
}
else
if
(
type
==
SCHEMA_TYPE_XDR
)
else
if
(
type
==
SCHEMA_TYPE_XDR
)
{
{
entry
=
cache_entry_from_xdr_doc
(
doc
);
entry
=
cache_entry_from_xdr_doc
(
doc
,
name
);
}
}
else
else
{
{
...
@@ -654,18 +678,12 @@ HRESULT SchemaCache_validate_tree(IXMLDOMSchemaCollection2* iface, xmlNodePtr tr
...
@@ -654,18 +678,12 @@ HRESULT SchemaCache_validate_tree(IXMLDOMSchemaCollection2* iface, xmlNodePtr tr
ns
=
tree
->
ns
->
href
;
ns
=
tree
->
ns
->
href
;
}
}
entry
=
xmlHashLookup
(
This
->
cache
,
ns
);
entry
=
(
ns
!=
NULL
)
?
xmlHashLookup
(
This
->
cache
,
ns
)
:
xmlHashLookup
(
This
->
cache
,
BAD_CAST
""
);
/* TODO: if the ns is not in the cache, and it's a URL,
/* TODO: if the ns is not in the cache, and it's a URL,
* do we try to load from that? */
* do we try to load from that? */
if
(
entry
)
if
(
entry
)
{
{
if
(
entry
->
type
==
SCHEMA_TYPE_XDR
)
{
FIXME
(
"partial stub: XDR schema support not implemented
\n
"
);
return
S_OK
;
}
else
if
(
entry
->
type
==
SCHEMA_TYPE_XSD
)
{
xmlSchemaValidCtxtPtr
svctx
;
xmlSchemaValidCtxtPtr
svctx
;
int
err
;
int
err
;
/* TODO: if validateOnLoad property is false,
/* TODO: if validateOnLoad property is false,
...
@@ -684,7 +702,6 @@ HRESULT SchemaCache_validate_tree(IXMLDOMSchemaCollection2* iface, xmlNodePtr tr
...
@@ -684,7 +702,6 @@ HRESULT SchemaCache_validate_tree(IXMLDOMSchemaCollection2* iface, xmlNodePtr tr
xmlSchemaFreeValidCtxt
(
svctx
);
xmlSchemaFreeValidCtxt
(
svctx
);
return
err
?
S_FALSE
:
S_OK
;
return
err
?
S_FALSE
:
S_OK
;
}
}
}
return
E_FAIL
;
return
E_FAIL
;
}
}
...
...
dlls/msxml3/tests/domdoc.c
View file @
5fc439a7
...
@@ -7533,7 +7533,7 @@ static void test_XDR_schemas(void)
...
@@ -7533,7 +7533,7 @@ static void test_XDR_schemas(void)
* this is fine */
* this is fine */
err
=
NULL
;
err
=
NULL
;
bstr
=
NULL
;
bstr
=
NULL
;
todo_wine
ole_check
(
IXMLDOMDocument2_validate
(
doc
,
&
err
));
ole_check
(
IXMLDOMDocument2_validate
(
doc
,
&
err
));
ok
(
err
!=
NULL
,
"domdoc_validate() should always set err
\n
"
);
ok
(
err
!=
NULL
,
"domdoc_validate() should always set err
\n
"
);
ole_expect
(
IXMLDOMParseError_get_reason
(
err
,
&
bstr
),
S_FALSE
);
ole_expect
(
IXMLDOMParseError_get_reason
(
err
,
&
bstr
),
S_FALSE
);
ok
(
IXMLDOMParseError_get_reason
(
err
,
&
bstr
)
==
S_FALSE
,
"got error: %s
\n
"
,
wine_dbgstr_w
(
bstr
));
ok
(
IXMLDOMParseError_get_reason
(
err
,
&
bstr
)
==
S_FALSE
,
"got error: %s
\n
"
,
wine_dbgstr_w
(
bstr
));
...
@@ -7559,7 +7559,7 @@ static void test_XDR_schemas(void)
...
@@ -7559,7 +7559,7 @@ static void test_XDR_schemas(void)
* this is fine */
* this is fine */
err
=
NULL
;
err
=
NULL
;
bstr
=
NULL
;
bstr
=
NULL
;
todo_wine
ole_check
(
IXMLDOMDocument2_validate
(
doc
,
&
err
));
ole_check
(
IXMLDOMDocument2_validate
(
doc
,
&
err
));
ok
(
err
!=
NULL
,
"domdoc_validate() should always set err
\n
"
);
ok
(
err
!=
NULL
,
"domdoc_validate() should always set err
\n
"
);
ole_expect
(
IXMLDOMParseError_get_reason
(
err
,
&
bstr
),
S_FALSE
);
ole_expect
(
IXMLDOMParseError_get_reason
(
err
,
&
bstr
),
S_FALSE
);
ok
(
IXMLDOMParseError_get_reason
(
err
,
&
bstr
)
==
S_FALSE
,
"got error: %s
\n
"
,
wine_dbgstr_w
(
bstr
));
ok
(
IXMLDOMParseError_get_reason
(
err
,
&
bstr
)
==
S_FALSE
,
"got error: %s
\n
"
,
wine_dbgstr_w
(
bstr
));
...
@@ -7946,7 +7946,7 @@ static void test_get_dataType(void)
...
@@ -7946,7 +7946,7 @@ static void test_get_dataType(void)
V_DISPATCH
(
&
v
)
=
NULL
;
V_DISPATCH
(
&
v
)
=
NULL
;
ole_check
(
IXMLDOMDocument2_QueryInterface
(
schema
,
&
IID_IDispatch
,
(
void
**
)
&
V_DISPATCH
(
&
v
)));
ole_check
(
IXMLDOMDocument2_QueryInterface
(
schema
,
&
IID_IDispatch
,
(
void
**
)
&
V_DISPATCH
(
&
v
)));
ok
(
V_DISPATCH
(
&
v
)
!=
NULL
,
"failed to get IDispatch interface
\n
"
);
ok
(
V_DISPATCH
(
&
v
)
!=
NULL
,
"failed to get IDispatch interface
\n
"
);
ole_check
(
IXMLDOMSchemaCollection_add
(
cache
,
_bstr_
(
"urn:x-schema:datatype-test-xdr"
),
v
));
todo_wine
ole_check
(
IXMLDOMSchemaCollection_add
(
cache
,
_bstr_
(
"urn:x-schema:datatype-test-xdr"
),
v
));
VariantClear
(
&
v
);
VariantClear
(
&
v
);
/* associate the cache to the doc */
/* associate the cache to the doc */
...
@@ -7961,11 +7961,11 @@ static void test_get_dataType(void)
...
@@ -7961,11 +7961,11 @@ static void test_get_dataType(void)
err
=
NULL
;
err
=
NULL
;
l
=
0
;
l
=
0
;
bstr
=
NULL
;
bstr
=
NULL
;
ole_check
(
IXMLDOMDocument2_validate
(
doc
,
&
err
));
todo_wine
ole_check
(
IXMLDOMDocument2_validate
(
doc
,
&
err
));
ok
(
err
!=
NULL
,
"domdoc_validate() should always set err
\n
"
);
ok
(
err
!=
NULL
,
"domdoc_validate() should always set err
\n
"
);
ole_expect
(
IXMLDOMParseError_get_errorCode
(
err
,
&
l
),
S_FALSE
);
todo_wine
ole_expect
(
IXMLDOMParseError_get_errorCode
(
err
,
&
l
),
S_FALSE
);
ole_expect
(
IXMLDOMParseError_get_reason
(
err
,
&
bstr
),
S_FALSE
);
ole_expect
(
IXMLDOMParseError_get_reason
(
err
,
&
bstr
),
S_FALSE
);
ok
(
l
==
0
,
"got %08x : %s
\n
"
,
l
,
wine_dbgstr_w
(
bstr
));
todo_wine
ok
(
l
==
0
,
"got %08x : %s
\n
"
,
l
,
wine_dbgstr_w
(
bstr
));
if
(
bstr
)
SysFreeString
(
bstr
);
if
(
bstr
)
SysFreeString
(
bstr
);
IXMLDOMParseError_Release
(
err
);
IXMLDOMParseError_Release
(
err
);
...
...
dlls/msxml3/tests/schema.c
View file @
5fc439a7
...
@@ -356,9 +356,9 @@ static void test_collection_refs(void)
...
@@ -356,9 +356,9 @@ static void test_collection_refs(void)
ole_check
(
IXMLDOMDocument2_loadXML
(
schema3
,
_bstr_
(
xdr_schema3_xml
),
&
b
));
ole_check
(
IXMLDOMDocument2_loadXML
(
schema3
,
_bstr_
(
xdr_schema3_xml
),
&
b
));
ok
(
b
==
VARIANT_TRUE
,
"failed to load XML
\n
"
);
ok
(
b
==
VARIANT_TRUE
,
"failed to load XML
\n
"
);
ole_check
(
IXMLDOMSchemaCollection_add
(
cache1
,
_bstr_
(
xdr_schema1_uri
),
_variantdoc_
(
schema1
)));
todo_wine
ole_check
(
IXMLDOMSchemaCollection_add
(
cache1
,
_bstr_
(
xdr_schema1_uri
),
_variantdoc_
(
schema1
)));
ole_check
(
IXMLDOMSchemaCollection_add
(
cache2
,
_bstr_
(
xdr_schema2_uri
),
_variantdoc_
(
schema2
)));
todo_wine
ole_check
(
IXMLDOMSchemaCollection_add
(
cache2
,
_bstr_
(
xdr_schema2_uri
),
_variantdoc_
(
schema2
)));
ole_check
(
IXMLDOMSchemaCollection_add
(
cache3
,
_bstr_
(
xdr_schema3_uri
),
_variantdoc_
(
schema3
)));
todo_wine
ole_check
(
IXMLDOMSchemaCollection_add
(
cache3
,
_bstr_
(
xdr_schema3_uri
),
_variantdoc_
(
schema3
)));
check_ref_expr
(
IXMLDOMDocument2_Release
(
schema1
),
0
);
check_ref_expr
(
IXMLDOMDocument2_Release
(
schema1
),
0
);
check_ref_expr
(
IXMLDOMDocument2_Release
(
schema2
),
0
);
check_ref_expr
(
IXMLDOMDocument2_Release
(
schema2
),
0
);
...
@@ -383,15 +383,15 @@ static void test_collection_refs(void)
...
@@ -383,15 +383,15 @@ static void test_collection_refs(void)
length
=
-
1
;
length
=
-
1
;
ole_check
(
IXMLDOMSchemaCollection_get_length
(
cache1
,
&
length
));
ole_check
(
IXMLDOMSchemaCollection_get_length
(
cache1
,
&
length
));
ok
(
length
==
1
,
"expected length 1, got %i
\n
"
,
length
);
todo_wine
ok
(
length
==
1
,
"expected length 1, got %i
\n
"
,
length
);
length
=
-
1
;
length
=
-
1
;
ole_check
(
IXMLDOMSchemaCollection_get_length
(
cache2
,
&
length
));
ole_check
(
IXMLDOMSchemaCollection_get_length
(
cache2
,
&
length
));
ok
(
length
==
2
,
"expected length 2, got %i
\n
"
,
length
);
todo_wine
ok
(
length
==
2
,
"expected length 2, got %i
\n
"
,
length
);
length
=
-
1
;
length
=
-
1
;
ole_check
(
IXMLDOMSchemaCollection_get_length
(
cache3
,
&
length
));
ole_check
(
IXMLDOMSchemaCollection_get_length
(
cache3
,
&
length
));
ok
(
length
==
3
,
"expected length 3, got %i
\n
"
,
length
);
todo_wine
ok
(
length
==
3
,
"expected length 3, got %i
\n
"
,
length
);
/* merging collections does not affect the ref count */
/* merging collections does not affect the ref count */
...
@@ -484,23 +484,23 @@ static void test_length(void)
...
@@ -484,23 +484,23 @@ static void test_length(void)
ole_check
(
IXMLDOMSchemaCollection_get_length
(
cache
,
&
length
));
ole_check
(
IXMLDOMSchemaCollection_get_length
(
cache
,
&
length
));
ok
(
length
==
0
,
"expected length 0, got %i
\n
"
,
length
);
ok
(
length
==
0
,
"expected length 0, got %i
\n
"
,
length
);
ole_check
(
IXMLDOMSchemaCollection_add
(
cache
,
_bstr_
(
xdr_schema1_uri
),
_variantdoc_
(
schema1
)));
todo_wine
ole_check
(
IXMLDOMSchemaCollection_add
(
cache
,
_bstr_
(
xdr_schema1_uri
),
_variantdoc_
(
schema1
)));
length
=
-
1
;
length
=
-
1
;
ole_check
(
IXMLDOMSchemaCollection_get_length
(
cache
,
&
length
));
ole_check
(
IXMLDOMSchemaCollection_get_length
(
cache
,
&
length
));
ok
(
length
==
1
,
"expected length 1, got %i
\n
"
,
length
);
todo_wine
ok
(
length
==
1
,
"expected length 1, got %i
\n
"
,
length
);
ole_check
(
IXMLDOMSchemaCollection_add
(
cache
,
_bstr_
(
xdr_schema2_uri
),
_variantdoc_
(
schema2
)));
todo_wine
ole_check
(
IXMLDOMSchemaCollection_add
(
cache
,
_bstr_
(
xdr_schema2_uri
),
_variantdoc_
(
schema2
)));
length
=
-
1
;
length
=
-
1
;
ole_check
(
IXMLDOMSchemaCollection_get_length
(
cache
,
&
length
));
ole_check
(
IXMLDOMSchemaCollection_get_length
(
cache
,
&
length
));
ok
(
length
==
2
,
"expected length 2, got %i
\n
"
,
length
);
todo_wine
ok
(
length
==
2
,
"expected length 2, got %i
\n
"
,
length
);
ole_check
(
IXMLDOMSchemaCollection_add
(
cache
,
_bstr_
(
xdr_schema3_uri
),
_variantdoc_
(
schema3
)));
todo_wine
ole_check
(
IXMLDOMSchemaCollection_add
(
cache
,
_bstr_
(
xdr_schema3_uri
),
_variantdoc_
(
schema3
)));
length
=
-
1
;
length
=
-
1
;
ole_check
(
IXMLDOMSchemaCollection_get_length
(
cache
,
&
length
));
ole_check
(
IXMLDOMSchemaCollection_get_length
(
cache
,
&
length
));
ok
(
length
==
3
,
"expected length 3, got %i
\n
"
,
length
);
todo_wine
ok
(
length
==
3
,
"expected length 3, got %i
\n
"
,
length
);
/* adding with VT_NULL is the same as removing */
/* adding with VT_NULL is the same as removing */
V_VT
(
&
v
)
=
VT_NULL
;
V_VT
(
&
v
)
=
VT_NULL
;
...
@@ -508,13 +508,13 @@ static void test_length(void)
...
@@ -508,13 +508,13 @@ static void test_length(void)
length
=
-
1
;
length
=
-
1
;
ole_check
(
IXMLDOMSchemaCollection_get_length
(
cache
,
&
length
));
ole_check
(
IXMLDOMSchemaCollection_get_length
(
cache
,
&
length
));
ok
(
length
==
2
,
"expected length 2, got %i
\n
"
,
length
);
todo_wine
ok
(
length
==
2
,
"expected length 2, got %i
\n
"
,
length
);
ole_check
(
IXMLDOMSchemaCollection_remove
(
cache
,
_bstr_
(
xdr_schema2_uri
)));
ole_check
(
IXMLDOMSchemaCollection_remove
(
cache
,
_bstr_
(
xdr_schema2_uri
)));
length
=
-
1
;
length
=
-
1
;
ole_check
(
IXMLDOMSchemaCollection_get_length
(
cache
,
&
length
));
ole_check
(
IXMLDOMSchemaCollection_get_length
(
cache
,
&
length
));
ok
(
length
==
1
,
"expected length 1, got %i
\n
"
,
length
);
todo_wine
ok
(
length
==
1
,
"expected length 1, got %i
\n
"
,
length
);
ole_check
(
IXMLDOMSchemaCollection_remove
(
cache
,
_bstr_
(
xdr_schema3_uri
)));
ole_check
(
IXMLDOMSchemaCollection_remove
(
cache
,
_bstr_
(
xdr_schema3_uri
)));
...
@@ -567,13 +567,13 @@ static void test_collection_content(void)
...
@@ -567,13 +567,13 @@ static void test_collection_content(void)
ole_check
(
IXMLDOMDocument2_loadXML
(
schema3
,
_bstr_
(
xdr_schema3_xml
),
&
b
));
ole_check
(
IXMLDOMDocument2_loadXML
(
schema3
,
_bstr_
(
xdr_schema3_xml
),
&
b
));
ok
(
b
==
VARIANT_TRUE
,
"failed to load XML
\n
"
);
ok
(
b
==
VARIANT_TRUE
,
"failed to load XML
\n
"
);
ole_check
(
IXMLDOMSchemaCollection_add
(
cache1
,
_bstr_
(
xdr_schema1_uri
),
_variantdoc_
(
schema1
)));
todo_wine
ole_check
(
IXMLDOMSchemaCollection_add
(
cache1
,
_bstr_
(
xdr_schema1_uri
),
_variantdoc_
(
schema1
)));
ole_check
(
IXMLDOMSchemaCollection_add
(
cache1
,
_bstr_
(
xdr_schema2_uri
),
_variantdoc_
(
schema2
)));
todo_wine
ole_check
(
IXMLDOMSchemaCollection_add
(
cache1
,
_bstr_
(
xdr_schema2_uri
),
_variantdoc_
(
schema2
)));
ole_check
(
IXMLDOMSchemaCollection_add
(
cache1
,
_bstr_
(
xdr_schema3_uri
),
_variantdoc_
(
schema3
)));
todo_wine
ole_check
(
IXMLDOMSchemaCollection_add
(
cache1
,
_bstr_
(
xdr_schema3_uri
),
_variantdoc_
(
schema3
)));
length
=
-
1
;
length
=
-
1
;
ole_check
(
IXMLDOMSchemaCollection_get_length
(
cache1
,
&
length
));
ole_check
(
IXMLDOMSchemaCollection_get_length
(
cache1
,
&
length
));
ok
(
length
==
3
,
"expected length 3, got %i
\n
"
,
length
);
todo_wine
ok
(
length
==
3
,
"expected length 3, got %i
\n
"
,
length
);
IXMLDOMDocument2_Release
(
schema1
);
IXMLDOMDocument2_Release
(
schema1
);
IXMLDOMDocument2_Release
(
schema2
);
IXMLDOMDocument2_Release
(
schema2
);
...
@@ -598,15 +598,15 @@ static void test_collection_content(void)
...
@@ -598,15 +598,15 @@ static void test_collection_content(void)
ok
(
b
==
VARIANT_TRUE
,
"failed to load XML
\n
"
);
ok
(
b
==
VARIANT_TRUE
,
"failed to load XML
\n
"
);
/* combining XDR and XSD schemas in the same cache is fine */
/* combining XDR and XSD schemas in the same cache is fine */
ole_check
(
IXMLDOMSchemaCollection_add
(
cache2
,
_bstr_
(
xdr_schema1_uri
),
_variantdoc_
(
schema1
)));
todo_wine
ole_check
(
IXMLDOMSchemaCollection_add
(
cache2
,
_bstr_
(
xdr_schema1_uri
),
_variantdoc_
(
schema1
)));
ole_check
(
IXMLDOMSchemaCollection_add
(
cache2
,
_bstr_
(
xdr_schema2_uri
),
_variantdoc_
(
schema2
)));
todo_wine
ole_check
(
IXMLDOMSchemaCollection_add
(
cache2
,
_bstr_
(
xdr_schema2_uri
),
_variantdoc_
(
schema2
)));
ole_check
(
IXMLDOMSchemaCollection_add
(
cache2
,
_bstr_
(
xsd_schema1_uri
),
_variantdoc_
(
schema3
)));
ole_check
(
IXMLDOMSchemaCollection_add
(
cache2
,
_bstr_
(
xsd_schema1_uri
),
_variantdoc_
(
schema3
)));
ole_check
(
IXMLDOMSchemaCollection_add
(
cache2
,
_bstr_
(
xsd_schema2_uri
),
_variantdoc_
(
schema4
)));
ole_check
(
IXMLDOMSchemaCollection_add
(
cache2
,
_bstr_
(
xsd_schema2_uri
),
_variantdoc_
(
schema4
)));
ole_check
(
IXMLDOMSchemaCollection_add
(
cache2
,
_bstr_
(
xsd_schema3_uri
),
_variantdoc_
(
schema5
)));
ole_check
(
IXMLDOMSchemaCollection_add
(
cache2
,
_bstr_
(
xsd_schema3_uri
),
_variantdoc_
(
schema5
)));
length
=
-
1
;
length
=
-
1
;
ole_check
(
IXMLDOMSchemaCollection_get_length
(
cache2
,
&
length
));
ole_check
(
IXMLDOMSchemaCollection_get_length
(
cache2
,
&
length
));
ok
(
length
==
5
,
"expected length 5, got %i
\n
"
,
length
);
todo_wine
ok
(
length
==
5
,
"expected length 5, got %i
\n
"
,
length
);
IXMLDOMDocument2_Release
(
schema1
);
IXMLDOMDocument2_Release
(
schema1
);
IXMLDOMDocument2_Release
(
schema2
);
IXMLDOMDocument2_Release
(
schema2
);
...
@@ -637,12 +637,12 @@ static void test_collection_content(void)
...
@@ -637,12 +637,12 @@ static void test_collection_content(void)
for
(
i
=
0
;
i
<
3
;
++
i
)
for
(
i
=
0
;
i
<
3
;
++
i
)
{
{
bstr
=
NULL
;
bstr
=
NULL
;
ole_check
(
IXMLDOMSchemaCollection_get_namespaceURI
(
cache1
,
i
,
&
bstr
));
todo_wine
ole_check
(
IXMLDOMSchemaCollection_get_namespaceURI
(
cache1
,
i
,
&
bstr
));
ok
(
bstr
!=
NULL
&&
*
bstr
,
"expected non-empty string
\n
"
);
todo_wine
ok
(
bstr
!=
NULL
&&
*
bstr
,
"expected non-empty string
\n
"
);
content
[
i
]
=
bstr
;
content
[
i
]
=
bstr
;
for
(
j
=
0
;
j
<
i
;
++
j
)
for
(
j
=
0
;
j
<
i
;
++
j
)
ok
(
lstrcmpW
(
content
[
j
],
bstr
),
"got duplicate entry
\n
"
);
todo_wine
ok
(
lstrcmpW
(
content
[
j
],
bstr
),
"got duplicate entry
\n
"
);
}
}
for
(
i
=
0
;
i
<
3
;
++
i
)
for
(
i
=
0
;
i
<
3
;
++
i
)
...
@@ -651,7 +651,7 @@ static void test_collection_content(void)
...
@@ -651,7 +651,7 @@ static void test_collection_content(void)
content
[
i
]
=
NULL
;
content
[
i
]
=
NULL
;
}
}
if
(
cache2
)
if
(
FALSE
&&
cache2
)
{
{
for
(
i
=
0
;
i
<
5
;
++
i
)
for
(
i
=
0
;
i
<
5
;
++
i
)
{
{
...
...
dlls/msxml3/xdr.c
0 → 100644
View file @
5fc439a7
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment