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
a930084d
Commit
a930084d
authored
Sep 16, 2010
by
Nikolay Sivov
Committed by
Alexandre Julliard
Sep 18, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msxml3: Fix ::selectSingleNode() behaviour on invalid arguments.
parent
a6bfb91a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
71 additions
and
1 deletion
+71
-1
node.c
dlls/msxml3/node.c
+2
-1
domdoc.c
dlls/msxml3/tests/domdoc.c
+69
-0
No files found.
dlls/msxml3/node.c
View file @
a930084d
...
...
@@ -1363,6 +1363,8 @@ static HRESULT WINAPI xmlnode_selectNodes(
TRACE
(
"(%p)->(%s %p)
\n
"
,
This
,
debugstr_w
(
queryString
),
resultList
);
if
(
!
queryString
||
!
resultList
)
return
E_INVALIDARG
;
return
queryresult_create
(
This
->
node
,
queryString
,
resultList
);
}
...
...
@@ -1377,7 +1379,6 @@ static HRESULT WINAPI xmlnode_selectSingleNode(
TRACE
(
"(%p)->(%s %p)
\n
"
,
This
,
debugstr_w
(
queryString
),
resultNode
);
*
resultNode
=
NULL
;
r
=
IXMLDOMNode_selectNodes
(
This
->
iface
,
queryString
,
&
list
);
if
(
r
==
S_OK
)
{
...
...
dlls/msxml3/tests/domdoc.c
View file @
a930084d
...
...
@@ -6218,6 +6218,74 @@ static void test_get_prefix(void)
free_bstrs
();
}
static
void
test_selectSingleNode
(
void
)
{
IXMLDOMDocument
*
doc
;
IXMLDOMNodeList
*
list
;
IXMLDOMNode
*
node
;
VARIANT_BOOL
b
;
HRESULT
hr
;
LONG
len
;
BSTR
str
;
doc
=
create_document
(
&
IID_IXMLDOMDocument
);
if
(
!
doc
)
return
;
hr
=
IXMLDOMDocument_selectSingleNode
(
doc
,
NULL
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IXMLDOMDocument_selectNodes
(
doc
,
NULL
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08x
\n
"
,
hr
);
str
=
SysAllocString
(
szComplete4
);
hr
=
IXMLDOMDocument_loadXML
(
doc
,
str
,
&
b
);
ok
(
hr
==
S_OK
,
"loadXML failed
\n
"
);
ok
(
b
==
VARIANT_TRUE
,
"failed to load XML string
\n
"
);
SysFreeString
(
str
);
hr
=
IXMLDOMDocument_selectSingleNode
(
doc
,
NULL
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IXMLDOMDocument_selectNodes
(
doc
,
NULL
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IXMLDOMDocument_selectSingleNode
(
doc
,
_bstr_
(
"lc"
),
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IXMLDOMDocument_selectNodes
(
doc
,
_bstr_
(
"lc"
),
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IXMLDOMDocument_selectSingleNode
(
doc
,
_bstr_
(
"lc"
),
&
node
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
IXMLDOMNode_Release
(
node
);
hr
=
IXMLDOMDocument_selectNodes
(
doc
,
_bstr_
(
"lc"
),
&
list
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
IXMLDOMNodeList_Release
(
list
);
list
=
(
void
*
)
0xdeadbeef
;
hr
=
IXMLDOMDocument_selectNodes
(
doc
,
NULL
,
&
list
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08x
\n
"
,
hr
);
ok
(
list
==
(
void
*
)
0xdeadbeef
,
"got %p
\n
"
,
list
);
node
=
(
void
*
)
0xdeadbeef
;
hr
=
IXMLDOMDocument_selectSingleNode
(
doc
,
_bstr_
(
"nonexistent"
),
&
node
);
ok
(
hr
==
S_FALSE
,
"got 0x%08x
\n
"
,
hr
);
ok
(
node
==
0
,
"got %p
\n
"
,
node
);
list
=
(
void
*
)
0xdeadbeef
;
hr
=
IXMLDOMDocument_selectNodes
(
doc
,
_bstr_
(
"nonexistent"
),
&
list
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
len
=
1
;
hr
=
IXMLDOMNodeList_get_length
(
list
,
&
len
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
len
==
0
,
"got %d
\n
"
,
len
);
IXMLDOMNodeList_Release
(
list
);
IXMLDOMDocument_Release
(
doc
);
free_bstrs
();
}
START_TEST
(
domdoc
)
{
IXMLDOMDocument
*
doc
;
...
...
@@ -6276,6 +6344,7 @@ START_TEST(domdoc)
test_createNode
();
test_get_prefix
();
test_default_properties
();
test_selectSingleNode
();
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