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
1cb6fa5e
Commit
1cb6fa5e
authored
Mar 24, 2016
by
Nikolay Sivov
Committed by
Alexandre Julliard
Mar 24, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
xmllite/writer: Fix a bunch of Write* methods to set closed state.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
2d9f6f72
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
63 additions
and
2 deletions
+63
-2
writer.c
dlls/xmllite/tests/writer.c
+55
-2
writer.c
dlls/xmllite/writer.c
+8
-0
No files found.
dlls/xmllite/tests/writer.c
View file @
1cb6fa5e
...
...
@@ -918,23 +918,76 @@ static void test_writer_state(void)
/* initial state */
check_writer_state
(
writer
,
E_UNEXPECTED
);
/* set output and call 'wrong' method */
/* set output and call 'wrong' method
, WriteEndElement
*/
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
);
/* WriteAttributeString */
stream
=
writer_set_output
(
writer
);
hr
=
IXmlWriter_WriteAttributeString
(
writer
,
NULL
,
aW
,
NULL
,
aW
);
ok
(
hr
==
WR_E_INVALIDACTION
,
"got 0x%08x
\n
"
,
hr
);
check_writer_state
(
writer
,
WR_E_INVALIDACTION
);
IStream_Release
(
stream
);
/* WriteEndDocument */
stream
=
writer_set_output
(
writer
);
hr
=
IXmlWriter_WriteEndDocument
(
writer
);
ok
(
hr
==
WR_E_INVALIDACTION
,
"got 0x%08x
\n
"
,
hr
);
check_writer_state
(
writer
,
WR_E_INVALIDACTION
);
IStream_Release
(
stream
);
/* WriteFullEndElement */
stream
=
writer_set_output
(
writer
);
hr
=
IXmlWriter_WriteFullEndElement
(
writer
);
ok
(
hr
==
WR_E_INVALIDACTION
,
"got 0x%08x
\n
"
,
hr
);
check_writer_state
(
writer
,
WR_E_INVALIDACTION
);
IStream_Release
(
stream
);
/* WriteCData */
stream
=
writer_set_output
(
writer
);
hr
=
IXmlWriter_WriteCData
(
writer
,
aW
);
ok
(
hr
==
WR_E_INVALIDACTION
,
"got 0x%08x
\n
"
,
hr
);
check_writer_state
(
writer
,
WR_E_INVALIDACTION
);
IStream_Release
(
stream
);
/* WriteName */
stream
=
writer_set_output
(
writer
);
hr
=
IXmlWriter_WriteName
(
writer
,
aW
);
ok
(
hr
==
WR_E_INVALIDACTION
,
"got 0x%08x
\n
"
,
hr
);
check_writer_state
(
writer
,
WR_E_INVALIDACTION
);
IStream_Release
(
stream
);
/* WriteNmToken */
stream
=
writer_set_output
(
writer
);
hr
=
IXmlWriter_WriteNmToken
(
writer
,
aW
);
ok
(
hr
==
WR_E_INVALIDACTION
,
"got 0x%08x
\n
"
,
hr
);
check_writer_state
(
writer
,
WR_E_INVALIDACTION
);
IStream_Release
(
stream
);
/* WriteString */
stream
=
writer_set_output
(
writer
);
hr
=
IXmlWriter_WriteString
(
writer
,
aW
);
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 @
1cb6fa5e
...
...
@@ -626,7 +626,9 @@ static HRESULT WINAPI xmlwriter_WriteCData(IXmlWriter *iface, LPCWSTR data)
case
XmlWriterState_ElemStarted
:
writer_close_starttag
(
This
);
break
;
case
XmlWriterState_Ready
:
case
XmlWriterState_DocClosed
:
This
->
state
=
XmlWriterState_DocClosed
;
return
WR_E_INVALIDACTION
;
default:
;
...
...
@@ -912,7 +914,9 @@ static HRESULT WINAPI xmlwriter_WriteName(IXmlWriter *iface, LPCWSTR pwszName)
{
case
XmlWriterState_Initial
:
return
E_UNEXPECTED
;
case
XmlWriterState_Ready
:
case
XmlWriterState_DocClosed
:
This
->
state
=
XmlWriterState_DocClosed
;
return
WR_E_INVALIDACTION
;
default:
;
...
...
@@ -931,7 +935,9 @@ static HRESULT WINAPI xmlwriter_WriteNmToken(IXmlWriter *iface, LPCWSTR pwszNmTo
{
case
XmlWriterState_Initial
:
return
E_UNEXPECTED
;
case
XmlWriterState_Ready
:
case
XmlWriterState_DocClosed
:
This
->
state
=
XmlWriterState_DocClosed
;
return
WR_E_INVALIDACTION
;
default:
;
...
...
@@ -1136,7 +1142,9 @@ static HRESULT WINAPI xmlwriter_WriteString(IXmlWriter *iface, LPCWSTR pwszText)
{
case
XmlWriterState_Initial
:
return
E_UNEXPECTED
;
case
XmlWriterState_Ready
:
case
XmlWriterState_DocClosed
:
This
->
state
=
XmlWriterState_DocClosed
;
return
WR_E_INVALIDACTION
;
default:
;
...
...
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