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
d5255f51
Commit
d5255f51
authored
Mar 02, 2016
by
Hans Leidekker
Committed by
Alexandre Julliard
Mar 02, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
webservices: Move the reader to EOF at end of data in WsReadEndElement.
Signed-off-by:
Hans Leidekker
<
hans@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
b7178446
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
89 additions
and
5 deletions
+89
-5
reader.c
dlls/webservices/reader.c
+10
-0
reader.c
dlls/webservices/tests/reader.c
+79
-5
No files found.
dlls/webservices/reader.c
View file @
d5255f51
...
...
@@ -1194,6 +1194,16 @@ static HRESULT read_endelement( struct reader *reader )
WS_XML_STRING
*
prefix
,
*
localname
;
HRESULT
hr
;
if
(
reader
->
state
==
READER_STATE_EOF
)
return
WS_E_INVALID_FORMAT
;
if
(
read_end_of_data
(
reader
))
{
struct
list
*
eof
=
list_tail
(
&
reader
->
root
->
children
);
reader
->
current
=
LIST_ENTRY
(
eof
,
struct
node
,
entry
);
reader
->
state
=
READER_STATE_EOF
;
return
S_OK
;
}
if
(
read_cmp
(
reader
,
"</"
,
2
))
return
WS_E_INVALID_FORMAT
;
read_skip
(
reader
,
2
);
...
...
dlls/webservices/tests/reader.c
View file @
d5255f51
...
...
@@ -887,11 +887,11 @@ static void test_WsReadStartElement(void)
/* WsReadEndElement advances reader to EOF */
hr
=
WsReadEndElement
(
reader
,
NULL
);
todo_wine
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
hr
=
WsGetReaderNode
(
reader
,
&
node
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
todo_wine
if
(
node
)
ok
(
node
->
nodeType
==
WS_XML_NODE_TYPE_EOF
,
"got %u
\n
"
,
node
->
nodeType
);
if
(
node
)
ok
(
node
->
nodeType
==
WS_XML_NODE_TYPE_EOF
,
"got %u
\n
"
,
node
->
nodeType
);
hr
=
WsReadEndElement
(
reader
,
NULL
);
ok
(
hr
==
WS_E_INVALID_FORMAT
,
"got %08x
\n
"
,
hr
);
...
...
@@ -904,6 +904,7 @@ static void test_WsReadEndElement(void)
HRESULT
hr
;
WS_XML_READER
*
reader
;
const
WS_XML_NODE
*
node
;
int
found
;
hr
=
WsCreateReader
(
NULL
,
0
,
&
reader
,
NULL
)
;
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
...
...
@@ -976,11 +977,11 @@ static void test_WsReadEndElement(void)
/* WsReadEndElement advances reader to EOF */
hr
=
WsReadEndElement
(
reader
,
NULL
);
todo_wine
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
hr
=
WsGetReaderNode
(
reader
,
&
node
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
todo_wine
if
(
node
)
ok
(
node
->
nodeType
==
WS_XML_NODE_TYPE_EOF
,
"got %u
\n
"
,
node
->
nodeType
);
if
(
node
)
ok
(
node
->
nodeType
==
WS_XML_NODE_TYPE_EOF
,
"got %u
\n
"
,
node
->
nodeType
);
hr
=
WsReadEndElement
(
reader
,
NULL
);
ok
(
hr
==
WS_E_INVALID_FORMAT
,
"got %08x
\n
"
,
hr
);
...
...
@@ -1009,6 +1010,79 @@ static void test_WsReadEndElement(void)
hr
=
WsReadEndElement
(
reader
,
NULL
);
ok
(
hr
==
WS_E_INVALID_FORMAT
,
"got %08x
\n
"
,
hr
);
hr
=
set_input
(
reader
,
"<a></a>"
,
sizeof
(
"<a></a>"
)
-
1
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
hr
=
WsFillReader
(
reader
,
sizeof
(
"<a></a>"
)
-
1
,
NULL
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
found
=
-
1
;
hr
=
WsReadToStartElement
(
reader
,
NULL
,
NULL
,
&
found
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
found
==
TRUE
,
"got %d
\n
"
,
found
);
hr
=
WsGetReaderNode
(
reader
,
&
node
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
if
(
node
)
ok
(
node
->
nodeType
==
WS_XML_NODE_TYPE_ELEMENT
,
"got %u
\n
"
,
node
->
nodeType
);
hr
=
WsReadEndElement
(
reader
,
NULL
);
ok
(
hr
==
WS_E_INVALID_FORMAT
,
"got %08x
\n
"
,
hr
);
hr
=
set_input
(
reader
,
"<a></a>"
,
sizeof
(
"<a></a>"
)
-
1
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
hr
=
WsFillReader
(
reader
,
sizeof
(
"<a></a>"
)
-
1
,
NULL
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
found
=
-
1
;
hr
=
WsReadToStartElement
(
reader
,
NULL
,
NULL
,
&
found
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
found
==
TRUE
,
"got %d
\n
"
,
found
);
hr
=
WsGetReaderNode
(
reader
,
&
node
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
if
(
node
)
ok
(
node
->
nodeType
==
WS_XML_NODE_TYPE_ELEMENT
,
"got %u
\n
"
,
node
->
nodeType
);
hr
=
WsReadStartElement
(
reader
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
hr
=
WsGetReaderNode
(
reader
,
&
node
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
if
(
node
)
ok
(
node
->
nodeType
==
WS_XML_NODE_TYPE_END_ELEMENT
,
"got %u
\n
"
,
node
->
nodeType
);
hr
=
WsReadEndElement
(
reader
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
hr
=
WsGetReaderNode
(
reader
,
&
node
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
if
(
node
)
ok
(
node
->
nodeType
==
WS_XML_NODE_TYPE_EOF
,
"got %u
\n
"
,
node
->
nodeType
);
hr
=
set_input
(
reader
,
"<a/>"
,
sizeof
(
"<a/>"
)
-
1
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
hr
=
WsFillReader
(
reader
,
sizeof
(
"<a/>"
)
-
1
,
NULL
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
found
=
-
1
;
hr
=
WsReadToStartElement
(
reader
,
NULL
,
NULL
,
&
found
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
found
==
TRUE
,
"got %d
\n
"
,
found
);
hr
=
WsGetReaderNode
(
reader
,
&
node
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
if
(
node
)
ok
(
node
->
nodeType
==
WS_XML_NODE_TYPE_ELEMENT
,
"got %u
\n
"
,
node
->
nodeType
);
hr
=
WsReadStartElement
(
reader
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
hr
=
WsGetReaderNode
(
reader
,
&
node
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
if
(
node
)
ok
(
node
->
nodeType
==
WS_XML_NODE_TYPE_END_ELEMENT
,
"got %u
\n
"
,
node
->
nodeType
);
hr
=
WsReadEndElement
(
reader
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
WsFreeReader
(
reader
);
}
...
...
@@ -2134,7 +2208,7 @@ static void test_WsGetNamespaceFromPrefix(void)
hr
=
WsReadStartElement
(
reader
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
hr
=
WsReadEndElement
(
reader
,
NULL
);
todo_wine
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
hr
=
WsGetNamespaceFromPrefix
(
reader
,
&
prefix
,
TRUE
,
&
ns
,
NULL
);
todo_wine
ok
(
hr
==
WS_E_INVALID_FORMAT
,
"got %08x
\n
"
,
hr
);
...
...
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