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
8b2b455b
Commit
8b2b455b
authored
Jul 14, 2016
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jul 15, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
xmllite/writer: Close open tag with WriteFullEndElement().
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
6870f3c0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
78 additions
and
1 deletion
+78
-1
writer.c
dlls/xmllite/tests/writer.c
+75
-0
writer.c
dlls/xmllite/writer.c
+3
-1
No files found.
dlls/xmllite/tests/writer.c
View file @
8b2b455b
...
...
@@ -1143,6 +1143,80 @@ todo_wine
IStream_Release
(
stream
);
}
static
void
test_WriteFullEndElement
(
void
)
{
static
const
WCHAR
aW
[]
=
{
'a'
,
0
};
IXmlWriter
*
writer
;
IStream
*
stream
;
HRESULT
hr
;
hr
=
CreateXmlWriter
(
&
IID_IXmlWriter
,
(
void
**
)
&
writer
,
NULL
);
ok
(
hr
==
S_OK
,
"Expected S_OK, got %08x
\n
"
,
hr
);
/* standalone element */
stream
=
writer_set_output
(
writer
);
hr
=
IXmlWriter_SetProperty
(
writer
,
XmlWriterProperty_OmitXmlDeclaration
,
TRUE
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IXmlWriter_SetProperty
(
writer
,
XmlWriterProperty_Indent
,
TRUE
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IXmlWriter_WriteStartDocument
(
writer
,
XmlStandalone_Omit
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IXmlWriter_WriteStartElement
(
writer
,
NULL
,
aW
,
NULL
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IXmlWriter_WriteFullEndElement
(
writer
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IXmlWriter_WriteEndDocument
(
writer
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IXmlWriter_Flush
(
writer
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
CHECK_OUTPUT
(
stream
,
"<a></a>"
);
IStream_Release
(
stream
);
/* nested elements */
stream
=
writer_set_output
(
writer
);
hr
=
IXmlWriter_SetProperty
(
writer
,
XmlWriterProperty_OmitXmlDeclaration
,
TRUE
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IXmlWriter_SetProperty
(
writer
,
XmlWriterProperty_Indent
,
TRUE
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IXmlWriter_WriteStartDocument
(
writer
,
XmlStandalone_Omit
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IXmlWriter_WriteStartElement
(
writer
,
NULL
,
aW
,
NULL
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IXmlWriter_WriteStartElement
(
writer
,
NULL
,
aW
,
NULL
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IXmlWriter_WriteFullEndElement
(
writer
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IXmlWriter_WriteEndDocument
(
writer
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IXmlWriter_Flush
(
writer
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
CHECK_OUTPUT
(
stream
,
"<a>
\r\n
"
" <a></a>
\r\n
"
"</a>"
);
IXmlWriter_Release
(
writer
);
IStream_Release
(
stream
);
}
START_TEST
(
writer
)
{
test_writer_create
();
...
...
@@ -1160,4 +1234,5 @@ START_TEST(writer)
test_WriteRaw
();
test_indentation
();
test_WriteAttributeString
();
test_WriteFullEndElement
();
}
dlls/xmllite/writer.c
View file @
8b2b455b
...
...
@@ -947,11 +947,13 @@ static HRESULT WINAPI xmlwriter_WriteFullEndElement(IXmlWriter *iface)
if
(
!
element
)
return
WR_E_INVALIDACTION
;
writer_close_starttag
(
This
);
writer_dec_indent
(
This
);
/* write full end tag */
write_output_buffer
(
This
->
output
,
closeelementW
,
ARRAY_SIZE
(
closeelementW
));
write_output_buffer
(
This
->
output
,
element
->
qname
,
element
->
len
);
write_output_buffer
(
This
->
output
,
gtW
,
ARRAY_SIZE
(
gtW
));
This
->
starttagopen
=
FALSE
;
return
S_OK
;
}
...
...
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