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
97e78d9a
Commit
97e78d9a
authored
Sep 05, 2010
by
Nikolay Sivov
Committed by
Alexandre Julliard
Sep 07, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msxml3/tests: Some tests for ::get_ownerDocument() returned document instance.
parent
0adfd6cf
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
79 additions
and
0 deletions
+79
-0
domdoc.c
dlls/msxml3/tests/domdoc.c
+79
-0
No files found.
dlls/msxml3/tests/domdoc.c
View file @
97e78d9a
...
...
@@ -5854,6 +5854,84 @@ static void test_removeQualifiedItem(void)
free_bstrs
();
}
static
void
test_get_ownerDocument
(
void
)
{
IXMLDOMDocument
*
doc1
,
*
doc2
,
*
doc3
;
IXMLDOMDocument2
*
doc
,
*
doc_owner
;
IXMLDOMNode
*
node
;
VARIANT_BOOL
b
;
VARIANT
var
;
HRESULT
hr
;
BSTR
str
;
doc
=
create_document
(
&
IID_IXMLDOMDocument2
);
if
(
!
doc
)
return
;
str
=
SysAllocString
(
szComplete4
);
hr
=
IXMLDOMDocument2_loadXML
(
doc
,
str
,
&
b
);
ok
(
hr
==
S_OK
,
"loadXML failed
\n
"
);
ok
(
b
==
VARIANT_TRUE
,
"failed to load XML string
\n
"
);
SysFreeString
(
str
);
V_VT
(
&
var
)
=
VT_BSTR
;
V_BSTR
(
&
var
)
=
_bstr_
(
"xmlns:wi=
\'
www.winehq.org
\'
"
);
hr
=
IXMLDOMDocument2_setProperty
(
doc
,
_bstr_
(
"SelectionNamespaces"
),
var
);
todo_wine
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IXMLDOMDocument2_get_firstChild
(
doc
,
&
node
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IXMLDOMNode_get_ownerDocument
(
node
,
&
doc1
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
VariantClear
(
&
var
);
hr
=
IXMLDOMDocument_QueryInterface
(
doc1
,
&
IID_IXMLDOMDocument2
,
(
void
**
)
&
doc_owner
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
doc_owner
!=
doc
,
"got %p, doc %p
\n
"
,
doc_owner
,
doc
);
hr
=
IXMLDOMDocument2_getProperty
(
doc_owner
,
_bstr_
(
"SelectionNamespaces"
),
&
var
);
todo_wine
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
todo_wine
ok
(
lstrcmpW
(
V_BSTR
(
&
var
),
_bstr_
(
"xmlns:wi=
\'
www.winehq.org
\'
"
))
==
0
,
"expected previously set value
\n
"
);
IXMLDOMDocument2_Release
(
doc_owner
);
VariantClear
(
&
var
);
hr
=
IXMLDOMNode_get_ownerDocument
(
node
,
&
doc2
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
IXMLDOMNode_Release
(
node
);
ok
(
doc1
!=
doc2
,
"got %p, expected %p. original %p
\n
"
,
doc2
,
doc1
,
doc
);
/* reload */
str
=
SysAllocString
(
szComplete4
);
hr
=
IXMLDOMDocument2_loadXML
(
doc
,
str
,
&
b
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
b
==
VARIANT_TRUE
,
"failed to load XML string
\n
"
);
SysFreeString
(
str
);
/* property retained even after reload */
VariantClear
(
&
var
);
hr
=
IXMLDOMDocument2_getProperty
(
doc
,
_bstr_
(
"SelectionNamespaces"
),
&
var
);
todo_wine
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
todo_wine
ok
(
lstrcmpW
(
V_BSTR
(
&
var
),
_bstr_
(
"xmlns:wi=
\'
www.winehq.org
\'
"
))
==
0
,
"expected previously set value
\n
"
);
VariantClear
(
&
var
);
hr
=
IXMLDOMDocument2_get_firstChild
(
doc
,
&
node
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IXMLDOMNode_get_ownerDocument
(
node
,
&
doc3
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
IXMLDOMNode_Release
(
node
);
hr
=
IXMLDOMDocument_QueryInterface
(
doc3
,
&
IID_IXMLDOMDocument2
,
(
void
**
)
&
doc_owner
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
doc3
!=
doc1
&&
doc3
!=
doc2
&&
doc_owner
!=
doc
,
"got %p, (%p, %p, %p)
\n
"
,
doc3
,
doc
,
doc1
,
doc2
);
IXMLDOMDocument_Release
(
doc1
);
IXMLDOMDocument_Release
(
doc2
);
IXMLDOMDocument_Release
(
doc3
);
IXMLDOMDocument2_Release
(
doc
);
free_bstrs
();
}
START_TEST
(
domdoc
)
{
IXMLDOMDocument
*
doc
;
...
...
@@ -5906,6 +5984,7 @@ START_TEST(domdoc)
test_splitText
();
test_getQualifiedItem
();
test_removeQualifiedItem
();
test_get_ownerDocument
();
CoUninitialize
();
}
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