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
70f10e1a
Commit
70f10e1a
authored
Oct 20, 2010
by
Adam Martinson
Committed by
Alexandre Julliard
Oct 21, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msxml3: Implement schema_cache_get().
parent
d87b8b8e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
26 deletions
+52
-26
schema.c
dlls/msxml3/schema.c
+18
-2
schema.c
dlls/msxml3/tests/schema.c
+34
-24
No files found.
dlls/msxml3/schema.c
View file @
70f10e1a
...
...
@@ -448,8 +448,24 @@ static HRESULT WINAPI schema_cache_add(IXMLDOMSchemaCollection *iface, BSTR uri,
static
HRESULT
WINAPI
schema_cache_get
(
IXMLDOMSchemaCollection
*
iface
,
BSTR
uri
,
IXMLDOMNode
**
node
)
{
FIXME
(
"stub
\n
"
);
return
E_NOTIMPL
;
schema_cache
*
This
=
impl_from_IXMLDOMSchemaCollection
(
iface
);
xmlChar
*
name
;
cache_entry
*
entry
;
TRACE
(
"(%p)->(%s, %p)
\n
"
,
This
,
wine_dbgstr_w
(
uri
),
node
);
if
(
!
node
)
return
E_POINTER
;
name
=
xmlChar_from_wchar
(
uri
);
entry
=
(
cache_entry
*
)
xmlHashLookup
(
This
->
cache
,
name
);
heap_free
(
name
);
/* TODO: this should be read-only */
if
(
entry
)
return
DOMDocument_create_from_xmldoc
(
entry
->
doc
,
(
IXMLDOMDocument3
**
)
node
);
*
node
=
NULL
;
return
S_OK
;
}
static
HRESULT
WINAPI
schema_cache_remove
(
IXMLDOMSchemaCollection
*
iface
,
BSTR
uri
)
...
...
dlls/msxml3/tests/schema.c
View file @
70f10e1a
...
...
@@ -368,14 +368,14 @@ static void test_collection_refs(void)
schema3
=
NULL
;
/* releasing the original doc does not affect the schema cache */
todo_wine
ole_check
(
IXMLDOMSchemaCollection_get
(
cache1
,
_bstr_
(
xdr_schema1_uri
),
(
IXMLDOMNode
**
)
&
schema1
));
todo_wine
ole_check
(
IXMLDOMSchemaCollection_get
(
cache2
,
_bstr_
(
xdr_schema2_uri
),
(
IXMLDOMNode
**
)
&
schema2
));
todo_wine
ole_check
(
IXMLDOMSchemaCollection_get
(
cache3
,
_bstr_
(
xdr_schema3_uri
),
(
IXMLDOMNode
**
)
&
schema3
));
ole_check
(
IXMLDOMSchemaCollection_get
(
cache1
,
_bstr_
(
xdr_schema1_uri
),
(
IXMLDOMNode
**
)
&
schema1
));
ole_check
(
IXMLDOMSchemaCollection_get
(
cache2
,
_bstr_
(
xdr_schema2_uri
),
(
IXMLDOMNode
**
)
&
schema2
));
ole_check
(
IXMLDOMSchemaCollection_get
(
cache3
,
_bstr_
(
xdr_schema3_uri
),
(
IXMLDOMNode
**
)
&
schema3
));
/* we get a read-only domdoc interface, created just for us */
if
(
schema1
)
todo_wine
check_refs
(
IXMLDOMDocument2
,
schema1
,
1
);
if
(
schema2
)
todo_wine
check_refs
(
IXMLDOMDocument2
,
schema2
,
1
);
if
(
schema3
)
todo_wine
check_refs
(
IXMLDOMDocument2
,
schema3
,
1
);
if
(
schema1
)
check_refs
(
IXMLDOMDocument2
,
schema1
,
1
);
if
(
schema2
)
check_refs
(
IXMLDOMDocument2
,
schema2
,
1
);
if
(
schema3
)
check_refs
(
IXMLDOMDocument2
,
schema3
,
1
);
ole_expect
(
IXMLDOMSchemaCollection_addCollection
(
cache1
,
NULL
),
E_POINTER
);
ole_check
(
IXMLDOMSchemaCollection_addCollection
(
cache2
,
cache1
));
...
...
@@ -400,26 +400,26 @@ static void test_collection_refs(void)
check_refs
(
IXMLDOMSchemaCollection
,
cache3
,
1
);
/* nor does it affect the domdoc instances */
if
(
schema1
)
todo_wine
check_refs
(
IXMLDOMDocument2
,
schema1
,
1
);
if
(
schema2
)
todo_wine
check_refs
(
IXMLDOMDocument2
,
schema2
,
1
);
if
(
schema3
)
todo_wine
check_refs
(
IXMLDOMDocument2
,
schema3
,
1
);
if
(
schema1
)
check_refs
(
IXMLDOMDocument2
,
schema1
,
1
);
if
(
schema2
)
check_refs
(
IXMLDOMDocument2
,
schema2
,
1
);
if
(
schema3
)
check_refs
(
IXMLDOMDocument2
,
schema3
,
1
);
if
(
schema1
)
todo_wine
check_ref_expr
(
IXMLDOMDocument2_Release
(
schema1
),
0
);
if
(
schema2
)
todo_wine
check_ref_expr
(
IXMLDOMDocument2_Release
(
schema2
),
0
);
if
(
schema3
)
todo_wine
check_ref_expr
(
IXMLDOMDocument2_Release
(
schema3
),
0
);
if
(
schema1
)
check_ref_expr
(
IXMLDOMDocument2_Release
(
schema1
),
0
);
if
(
schema2
)
check_ref_expr
(
IXMLDOMDocument2_Release
(
schema2
),
0
);
if
(
schema3
)
check_ref_expr
(
IXMLDOMDocument2_Release
(
schema3
),
0
);
schema1
=
NULL
;
schema2
=
NULL
;
schema3
=
NULL
;
/* releasing the domdoc instances doesn't change the cache */
todo_wine
ole_check
(
IXMLDOMSchemaCollection_get
(
cache1
,
_bstr_
(
xdr_schema1_uri
),
(
IXMLDOMNode
**
)
&
schema1
));
todo_wine
ole_check
(
IXMLDOMSchemaCollection_get
(
cache2
,
_bstr_
(
xdr_schema2_uri
),
(
IXMLDOMNode
**
)
&
schema2
));
todo_wine
ole_check
(
IXMLDOMSchemaCollection_get
(
cache3
,
_bstr_
(
xdr_schema3_uri
),
(
IXMLDOMNode
**
)
&
schema3
));
ole_check
(
IXMLDOMSchemaCollection_get
(
cache1
,
_bstr_
(
xdr_schema1_uri
),
(
IXMLDOMNode
**
)
&
schema1
));
ole_check
(
IXMLDOMSchemaCollection_get
(
cache2
,
_bstr_
(
xdr_schema2_uri
),
(
IXMLDOMNode
**
)
&
schema2
));
ole_check
(
IXMLDOMSchemaCollection_get
(
cache3
,
_bstr_
(
xdr_schema3_uri
),
(
IXMLDOMNode
**
)
&
schema3
));
/* we can just get them again */
if
(
schema1
)
todo_wine
check_refs
(
IXMLDOMDocument2
,
schema1
,
1
);
if
(
schema2
)
todo_wine
check_refs
(
IXMLDOMDocument2
,
schema2
,
1
);
if
(
schema3
)
todo_wine
check_refs
(
IXMLDOMDocument2
,
schema3
,
1
);
if
(
schema1
)
check_refs
(
IXMLDOMDocument2
,
schema1
,
1
);
if
(
schema2
)
check_refs
(
IXMLDOMDocument2
,
schema2
,
1
);
if
(
schema3
)
check_refs
(
IXMLDOMDocument2
,
schema3
,
1
);
/* releasing the caches does not affect the domdoc instances */
check_ref_expr
(
IXMLDOMSchemaCollection_Release
(
cache1
),
0
);
...
...
@@ -427,13 +427,13 @@ static void test_collection_refs(void)
check_ref_expr
(
IXMLDOMSchemaCollection_Release
(
cache3
),
0
);
/* they're just for us */
if
(
schema1
)
todo_wine
check_refs
(
IXMLDOMDocument2
,
schema1
,
1
);
if
(
schema2
)
todo_wine
check_refs
(
IXMLDOMDocument2
,
schema2
,
1
);
if
(
schema3
)
todo_wine
check_refs
(
IXMLDOMDocument2
,
schema3
,
1
);
if
(
schema1
)
check_refs
(
IXMLDOMDocument2
,
schema1
,
1
);
if
(
schema2
)
check_refs
(
IXMLDOMDocument2
,
schema2
,
1
);
if
(
schema3
)
check_refs
(
IXMLDOMDocument2
,
schema3
,
1
);
if
(
schema1
)
todo_wine
check_ref_expr
(
IXMLDOMDocument2_Release
(
schema1
),
0
);
if
(
schema2
)
todo_wine
check_ref_expr
(
IXMLDOMDocument2_Release
(
schema2
),
0
);
if
(
schema3
)
todo_wine
check_ref_expr
(
IXMLDOMDocument2_Release
(
schema3
),
0
);
if
(
schema1
)
check_ref_expr
(
IXMLDOMDocument2_Release
(
schema1
),
0
);
if
(
schema2
)
check_ref_expr
(
IXMLDOMDocument2_Release
(
schema2
),
0
);
if
(
schema3
)
check_ref_expr
(
IXMLDOMDocument2_Release
(
schema3
),
0
);
free_bstrs
();
}
...
...
@@ -624,6 +624,16 @@ static void test_collection_content(void)
/* pointer is checked first */
ole_expect
(
IXMLDOMSchemaCollection_get_namespaceURI
(
cache1
,
3
,
NULL
),
E_POINTER
);
schema1
=
NULL
;
/* no error if ns uri does not exist */
ole_check
(
IXMLDOMSchemaCollection_get
(
cache1
,
_bstr_
(
xsd_schema1_uri
),
(
IXMLDOMNode
**
)
&
schema1
));
ok
(
!
schema1
,
"expected NULL
\n
"
);
/* a NULL bstr corresponds to no-uri ns */
ole_check
(
IXMLDOMSchemaCollection_get
(
cache1
,
NULL
,
(
IXMLDOMNode
**
)
&
schema1
));
ok
(
!
schema1
,
"expected NULL
\n
"
);
/* error if return pointer is NULL */
ole_expect
(
IXMLDOMSchemaCollection_get
(
cache1
,
_bstr_
(
xdr_schema1_uri
),
NULL
),
E_POINTER
);
for
(
i
=
0
;
i
<
3
;
++
i
)
{
bstr
=
NULL
;
...
...
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