Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
0cbd938a
Commit
0cbd938a
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: Always return node type from Read().
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
80cf8838
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
12 deletions
+35
-12
reader.c
dlls/xmllite/reader.c
+4
-6
reader.c
dlls/xmllite/tests/reader.c
+31
-6
No files found.
dlls/xmllite/reader.c
View file @
0cbd938a
...
...
@@ -2786,12 +2786,10 @@ static HRESULT WINAPI xmlreader_Read(IXmlReader* iface, XmlNodeType *nodetype)
hr
=
reader_parse_nextnode
(
This
);
if
(
oldtype
==
XmlNodeType_None
&&
This
->
nodetype
!=
oldtype
)
This
->
state
=
XmlReadState_Interactive
;
if
(
hr
==
S_OK
)
{
TRACE
(
"node type %s
\n
"
,
debugstr_nodetype
(
This
->
nodetype
));
if
(
nodetype
)
*
nodetype
=
This
->
nodetype
;
}
TRACE
(
"node type %s
\n
"
,
debugstr_nodetype
(
This
->
nodetype
));
if
(
nodetype
)
*
nodetype
=
This
->
nodetype
;
return
hr
;
}
...
...
dlls/xmllite/tests/reader.c
View file @
0cbd938a
...
...
@@ -647,8 +647,9 @@ static void test_readerinput(void)
static
void
test_reader_state
(
void
)
{
IXmlReader
*
reader
;
XmlNodeType
nodetype
;
IXmlReader
*
reader
;
IStream
*
stream
;
HRESULT
hr
;
hr
=
CreateXmlReader
(
&
IID_IXmlReader
,
(
void
**
)
&
reader
,
NULL
);
...
...
@@ -662,10 +663,33 @@ static void test_reader_state(void)
test_read_state
(
reader
,
XmlReadState_Closed
,
-
1
,
FALSE
);
if
(
0
)
{
/* newer versions crash here, probably cause no input was set */
/* newer versions crash here, probably
be
cause no input was set */
hr
=
IXmlReader_Read
(
reader
,
&
nodetype
);
ok
(
hr
==
S_FALSE
,
"got %08x
\n
"
,
hr
);
}
stream
=
create_stream_on_data
(
"xml"
,
sizeof
(
"xml"
));
hr
=
IXmlReader_SetInput
(
reader
,
(
IUnknown
*
)
stream
);
ok
(
hr
==
S_OK
,
"Expected S_OK, got %08x
\n
"
,
hr
);
test_read_state
(
reader
,
XmlReadState_Initial
,
-
1
,
FALSE
);
nodetype
=
XmlNodeType_Element
;
hr
=
IXmlReader_Read
(
reader
,
&
nodetype
);
todo_wine
ok
(
FAILED
(
hr
),
"got %08x
\n
"
,
hr
);
ok
(
nodetype
==
XmlNodeType_None
,
"Unexpected node type %d
\n
"
,
nodetype
);
test_read_state
(
reader
,
XmlReadState_Error
,
-
1
,
TRUE
);
nodetype
=
XmlNodeType_Element
;
hr
=
IXmlReader_Read
(
reader
,
&
nodetype
);
todo_wine
ok
(
FAILED
(
hr
),
"got %08x
\n
"
,
hr
);
ok
(
nodetype
==
XmlNodeType_None
,
"Unexpected node type %d
\n
"
,
nodetype
);
IStream_Release
(
stream
);
IXmlReader_Release
(
reader
);
}
...
...
@@ -1118,9 +1142,8 @@ static void test_read_full(void)
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
i
=
0
;
type
=
XmlNodeType_None
;
hr
=
IXmlReader_Read
(
reader
,
&
type
);
while
(
hr
==
S_OK
)
type
=
~
0u
;
while
(
IXmlReader_Read
(
reader
,
&
type
)
==
S_OK
)
{
ok
(
test
->
types
[
i
]
!=
XmlNodeType_None
,
"%d: unexpected end of test data
\n
"
,
i
);
if
(
test
->
types
[
i
]
==
XmlNodeType_None
)
break
;
...
...
@@ -1134,7 +1157,6 @@ static void test_read_full(void)
ok
(
hr
==
S_OK
,
"%d: GetValue failed 0x%08x
\n
"
,
i
,
hr
);
ok
(
len
>
0
,
"%d: wrong value length %d
\n
"
,
i
,
len
);
}
hr
=
IXmlReader_Read
(
reader
,
&
type
);
i
++
;
}
ok
(
test
->
types
[
i
]
==
XmlNodeType_None
,
"incomplete sequence, got %d
\n
"
,
test
->
types
[
i
]);
...
...
@@ -2024,6 +2046,7 @@ static void test_namespaceuri(void)
hr
=
IXmlReader_SetInput
(
reader
,
(
IUnknown
*
)
stream
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
type
=
~
0u
;
while
(
IXmlReader_Read
(
reader
,
&
type
)
==
S_OK
)
{
const
WCHAR
*
uri
,
*
local
;
WCHAR
*
uriW
;
...
...
@@ -2042,6 +2065,8 @@ static void test_namespaceuri(void)
j
++
;
}
todo_wine
ok
(
type
==
XmlNodeType_None
,
"Unexpected node type %d
\n
"
,
type
);
IStream_Release
(
stream
);
}
...
...
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