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
073c43a1
Commit
073c43a1
authored
Mar 06, 2017
by
Nikolay Sivov
Committed by
Alexandre Julliard
Mar 06, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
xmllite/reader: Implement IsEOF().
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
b1880793
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
60 additions
and
2 deletions
+60
-2
reader.c
dlls/xmllite/reader.c
+4
-2
reader.c
dlls/xmllite/tests/reader.c
+56
-0
No files found.
dlls/xmllite/reader.c
View file @
073c43a1
...
...
@@ -2554,6 +2554,7 @@ static HRESULT reader_parse_nextnode(xmlreader *reader)
if
(
hr
==
S_FALSE
)
{
reader
->
instate
=
XmlReadInState_Eof
;
reader
->
state
=
XmlReadState_EndOfFile
;
reader
->
nodetype
=
XmlNodeType_None
;
}
return
hr
;
...
...
@@ -3171,8 +3172,9 @@ static HRESULT WINAPI xmlreader_GetDepth(IXmlReader* iface, UINT *depth)
static
BOOL
WINAPI
xmlreader_IsEOF
(
IXmlReader
*
iface
)
{
FIXME
(
"(%p): stub
\n
"
,
iface
);
return
FALSE
;
xmlreader
*
This
=
impl_from_IXmlReader
(
iface
);
TRACE
(
"(%p)
\n
"
,
iface
);
return
This
->
state
==
XmlReadState_EndOfFile
;
}
static
const
struct
IXmlReaderVtbl
xmlreader_vtbl
=
...
...
dlls/xmllite/tests/reader.c
View file @
073c43a1
...
...
@@ -2173,6 +2173,61 @@ static void test_encoding_detection(void)
IXmlReader_Release
(
reader
);
}
static
void
test_eof_state
(
IXmlReader
*
reader
,
BOOL
eof
)
{
LONG_PTR
state
;
HRESULT
hr
;
ok
(
IXmlReader_IsEOF
(
reader
)
==
eof
,
"Unexpected IsEOF() result
\n
"
);
hr
=
IXmlReader_GetProperty
(
reader
,
XmlReaderProperty_ReadState
,
&
state
);
ok
(
hr
==
S_OK
,
"GetProperty() failed, %#x
\n
"
,
hr
);
ok
((
state
==
XmlReadState_EndOfFile
)
==
eof
,
"Unexpected EndOfFile state %ld
\n
"
,
state
);
}
static
void
test_endoffile
(
void
)
{
static
const
char
*
xml
=
"<a/>"
;
IXmlReader
*
reader
;
XmlNodeType
type
;
IStream
*
stream
;
HRESULT
hr
;
hr
=
CreateXmlReader
(
&
IID_IXmlReader
,
(
void
**
)
&
reader
,
NULL
);
ok
(
hr
==
S_OK
,
"S_OK, got %08x
\n
"
,
hr
);
test_eof_state
(
reader
,
FALSE
);
stream
=
create_stream_on_data
(
xml
,
strlen
(
xml
));
hr
=
IXmlReader_SetInput
(
reader
,
(
IUnknown
*
)
stream
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
test_eof_state
(
reader
,
FALSE
);
type
=
XmlNodeType_None
;
hr
=
IXmlReader_Read
(
reader
,
&
type
);
ok
(
hr
==
S_OK
,
"got %#x
\n
"
,
hr
);
ok
(
type
==
XmlNodeType_Element
,
"Unexpected type %d
\n
"
,
type
);
test_eof_state
(
reader
,
FALSE
);
type
=
XmlNodeType_Element
;
hr
=
IXmlReader_Read
(
reader
,
&
type
);
ok
(
hr
==
S_FALSE
,
"got %#x
\n
"
,
hr
);
ok
(
type
==
XmlNodeType_None
,
"Unexpected type %d
\n
"
,
type
);
test_eof_state
(
reader
,
TRUE
);
hr
=
IXmlReader_SetInput
(
reader
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
test_eof_state
(
reader
,
FALSE
);
IStream_Release
(
stream
);
IXmlReader_Release
(
reader
);
}
START_TEST
(
reader
)
{
test_reader_create
();
...
...
@@ -2196,4 +2251,5 @@ START_TEST(reader)
test_namespaceuri
();
test_read_charref
();
test_encoding_detection
();
test_endoffile
();
}
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