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
969c8afa
Commit
969c8afa
authored
Nov 21, 2023
by
Daniel Lehman
Committed by
Alexandre Julliard
Nov 24, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msxml6/tests: Copy create namespace tests.
With changes for msxml6 and TODOs for wine.
parent
bd7213ec
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
108 additions
and
0 deletions
+108
-0
domdoc.c
dlls/msxml3/tests/domdoc.c
+1
-0
domdoc.c
dlls/msxml6/tests/domdoc.c
+107
-0
No files found.
dlls/msxml3/tests/domdoc.c
View file @
969c8afa
...
@@ -13327,6 +13327,7 @@ static struct attrtest_t attrtests[] = {
...
@@ -13327,6 +13327,7 @@ static struct attrtest_t attrtests[] = {
{
0
}
{
0
}
};
};
/* see dlls/msxml[46]/tests/domdoc.c */
static
void
test_create_attribute
(
void
)
static
void
test_create_attribute
(
void
)
{
{
struct
attrtest_t
*
ptr
=
attrtests
;
struct
attrtest_t
*
ptr
=
attrtests
;
...
...
dlls/msxml6/tests/domdoc.c
View file @
969c8afa
...
@@ -54,6 +54,112 @@ static void free_bstrs(void)
...
@@ -54,6 +54,112 @@ static void free_bstrs(void)
alloced_bstrs_count
=
0
;
alloced_bstrs_count
=
0
;
}
}
struct
attrtest_t
{
const
WCHAR
*
name
;
const
WCHAR
*
uri
;
const
WCHAR
*
prefix
;
const
WCHAR
*
href
;
BOOL
todo
;
};
static
struct
attrtest_t
attrtests
[]
=
{
{
L"xmlns"
,
L"http://www.w3.org/2000/xmlns/"
,
NULL
,
L"http://www.w3.org/2000/xmlns/"
,
TRUE
},
{
L"xmlns"
,
L"nondefaulturi"
,
NULL
,
L"http://www.w3.org/2000/xmlns/"
,
TRUE
},
{
L"c"
,
L"http://www.w3.org/2000/xmlns/"
,
NULL
,
L"http://www.w3.org/2000/xmlns/"
},
{
L"c"
,
L"nsref1"
,
NULL
,
L"nsref1"
},
{
L"ns:c"
,
L"nsref1"
,
L"ns"
,
L"nsref1"
},
{
L"xmlns:c"
,
L"http://www.w3.org/2000/xmlns/"
,
L"xmlns"
,
L"http://www.w3.org/2000/xmlns/"
},
{
L"xmlns:c"
,
L"nondefaulturi"
,
L"xmlns"
,
L"http://www.w3.org/2000/xmlns/"
},
{
0
}
};
/* see dlls/msxml[34]/tests/domdoc.c */
static
void
test_create_attribute
(
void
)
{
struct
attrtest_t
*
ptr
=
attrtests
;
IXMLDOMElement
*
el
;
IXMLDOMDocument2
*
doc
;
IXMLDOMNode
*
node
;
VARIANT
var
;
HRESULT
hr
;
int
i
=
0
;
BSTR
str
;
hr
=
CoCreateInstance
(
&
CLSID_DOMDocument60
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IXMLDOMDocument2
,
(
void
**
)
&
doc
);
ok
(
hr
==
S_OK
,
"Failed to create DOMDocument60, hr %#lx.
\n
"
,
hr
);
while
(
ptr
->
name
)
{
V_VT
(
&
var
)
=
VT_I1
;
V_I1
(
&
var
)
=
NODE_ATTRIBUTE
;
hr
=
IXMLDOMDocument2_createNode
(
doc
,
var
,
_bstr_
(
ptr
->
name
),
_bstr_
(
ptr
->
uri
),
&
node
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
str
=
NULL
;
hr
=
IXMLDOMNode_get_prefix
(
node
,
&
str
);
if
(
ptr
->
prefix
)
{
ok
(
hr
==
S_OK
,
"%d: unexpected hr %#lx
\n
"
,
i
,
hr
);
ok
(
!
lstrcmpW
(
str
,
_bstr_
(
ptr
->
prefix
)),
"%d: got prefix %s, expected %s
\n
"
,
i
,
wine_dbgstr_w
(
str
),
wine_dbgstr_w
(
ptr
->
prefix
));
}
else
{
todo_wine_if
(
ptr
->
todo
)
{
ok
(
hr
==
S_FALSE
,
"%d: unexpected hr %#lx
\n
"
,
i
,
hr
);
ok
(
str
==
NULL
,
"%d: got prefix %s
\n
"
,
i
,
wine_dbgstr_w
(
str
));
}
}
SysFreeString
(
str
);
str
=
NULL
;
hr
=
IXMLDOMNode_get_namespaceURI
(
node
,
&
str
);
ok
(
hr
==
S_OK
,
"%d: unexpected hr %#lx
\n
"
,
i
,
hr
);
todo_wine_if
(
ptr
->
todo
)
ok
(
!
lstrcmpW
(
str
,
_bstr_
(
ptr
->
href
))
||
broken
(
!
ptr
->
prefix
&&
!
lstrcmpW
(
str
,
L"xmlns"
)),
/* win7 msxml6 */
"%d: got uri %s, expected %s
\n
"
,
i
,
wine_dbgstr_w
(
str
),
wine_dbgstr_w
(
ptr
->
href
));
SysFreeString
(
str
);
IXMLDOMNode_Release
(
node
);
free_bstrs
();
i
++
;
ptr
++
;
}
V_VT
(
&
var
)
=
VT_I1
;
V_I1
(
&
var
)
=
NODE_ELEMENT
;
hr
=
IXMLDOMDocument2_createNode
(
doc
,
var
,
_bstr_
(
L"e"
),
NULL
,
&
node
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
hr
=
IXMLDOMNode_QueryInterface
(
node
,
&
IID_IXMLDOMElement
,
(
void
**
)
&
el
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
IXMLDOMNode_Release
(
node
);
V_VT
(
&
var
)
=
VT_I1
;
V_I1
(
&
var
)
=
NODE_ATTRIBUTE
;
hr
=
IXMLDOMDocument2_createNode
(
doc
,
var
,
_bstr_
(
L"xmlns:a"
),
_bstr_
(
L"http://www.w3.org/2000/xmlns/"
),
&
node
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
hr
=
IXMLDOMElement_setAttributeNode
(
el
,
(
IXMLDOMAttribute
*
)
node
,
NULL
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
/* for some reason default namespace uri is not reported */
hr
=
IXMLDOMNode_get_namespaceURI
(
node
,
&
str
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
ok
(
!
lstrcmpW
(
str
,
L"http://www.w3.org/2000/xmlns/"
)
||
broken
(
!
ptr
->
prefix
&&
!
lstrcmpW
(
str
,
L"xmlns"
)),
/* win7 msxml6 */
"got uri %s
\n
"
,
wine_dbgstr_w
(
str
));
SysFreeString
(
str
);
IXMLDOMNode_Release
(
node
);
IXMLDOMElement_Release
(
el
);
IXMLDOMDocument2_Release
(
doc
);
free_bstrs
();
}
/* see dlls/msxml[34]/tests/domdoc.c */
/* see dlls/msxml[34]/tests/domdoc.c */
static
void
test_namespaces_as_attributes
(
void
)
static
void
test_namespaces_as_attributes
(
void
)
{
{
...
@@ -240,6 +346,7 @@ START_TEST(domdoc)
...
@@ -240,6 +346,7 @@ START_TEST(domdoc)
IXMLDOMDocument2_Release
(
doc
);
IXMLDOMDocument2_Release
(
doc
);
test_namespaces_as_attributes
();
test_namespaces_as_attributes
();
test_create_attribute
();
CoUninitialize
();
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