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
e3a6d593
Commit
e3a6d593
authored
Mar 23, 2016
by
Nikolay Sivov
Committed by
Alexandre Julliard
Mar 23, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
xmllite/writer: Fix WriteEndElement()/WriteFullEndElement() on ready state.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
6ca1ebdd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
1 deletion
+30
-1
writer.c
dlls/xmllite/tests/writer.c
+14
-1
writer.c
dlls/xmllite/writer.c
+16
-0
No files found.
dlls/xmllite/tests/writer.c
View file @
e3a6d593
...
...
@@ -91,13 +91,14 @@ todo_wine
hr
=
IXmlWriter_WriteEndElement
(
writer
);
ok
(
hr
==
exp_hr
,
"got 0x%08x, expected 0x%08x
\n
"
,
hr
,
exp_hr
);
todo_wine
{
hr
=
IXmlWriter_WriteEntityRef
(
writer
,
aW
);
todo_wine
ok
(
hr
==
exp_hr
,
"got 0x%08x, expected 0x%08x
\n
"
,
hr
,
exp_hr
);
hr
=
IXmlWriter_WriteFullEndElement
(
writer
);
ok
(
hr
==
exp_hr
,
"got 0x%08x, expected 0x%08x
\n
"
,
hr
,
exp_hr
);
todo_wine
{
hr
=
IXmlWriter_WriteName
(
writer
,
aW
);
ok
(
hr
==
exp_hr
,
"got 0x%08x, expected 0x%08x
\n
"
,
hr
,
exp_hr
);
...
...
@@ -915,13 +916,25 @@ static void test_WriteRaw(void)
static
void
test_writer_state
(
void
)
{
IXmlWriter
*
writer
;
IStream
*
stream
;
HRESULT
hr
;
hr
=
CreateXmlWriter
(
&
IID_IXmlWriter
,
(
void
**
)
&
writer
,
NULL
);
ok
(
hr
==
S_OK
,
"Expected S_OK, got %08x
\n
"
,
hr
);
/* initial state */
check_writer_state
(
writer
,
E_UNEXPECTED
);
/* set output and call 'wrong' method */
stream
=
writer_set_output
(
writer
);
hr
=
IXmlWriter_WriteEndElement
(
writer
);
ok
(
hr
==
WR_E_INVALIDACTION
,
"got 0x%08x
\n
"
,
hr
);
check_writer_state
(
writer
,
WR_E_INVALIDACTION
);
IStream_Release
(
stream
);
IXmlWriter_Release
(
writer
);
}
...
...
dlls/xmllite/writer.c
View file @
e3a6d593
...
...
@@ -788,6 +788,10 @@ static HRESULT WINAPI xmlwriter_WriteEndElement(IXmlWriter *iface)
{
case
XmlWriterState_Initial
:
return
E_UNEXPECTED
;
case
XmlWriterState_Ready
:
case
XmlWriterState_DocClosed
:
This
->
state
=
XmlWriterState_DocClosed
;
return
WR_E_INVALIDACTION
;
default:
;
}
...
...
@@ -827,6 +831,18 @@ static HRESULT WINAPI xmlwriter_WriteFullEndElement(IXmlWriter *iface)
TRACE
(
"%p
\n
"
,
This
);
switch
(
This
->
state
)
{
case
XmlWriterState_Initial
:
return
E_UNEXPECTED
;
case
XmlWriterState_Ready
:
case
XmlWriterState_DocClosed
:
This
->
state
=
XmlWriterState_DocClosed
;
return
WR_E_INVALIDACTION
;
default:
;
}
element
=
pop_element
(
This
);
if
(
!
element
)
return
WR_E_INVALIDACTION
;
...
...
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