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
ce91365b
Commit
ce91365b
authored
May 17, 2016
by
Hans Leidekker
Committed by
Alexandre Julliard
May 17, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
webservices/tests: Add tests.
Signed-off-by:
Hans Leidekker
<
hans@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
dfc47061
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
82 additions
and
6 deletions
+82
-6
reader.c
dlls/webservices/tests/reader.c
+82
-6
No files found.
dlls/webservices/tests/reader.c
View file @
ce91365b
...
...
@@ -1051,7 +1051,7 @@ static void test_WsReadEndElement(void)
hr
=
WsReadEndElement
(
reader
,
NULL
);
ok
(
hr
==
WS_E_INVALID_FORMAT
,
"got %08x
\n
"
,
hr
);
hr
=
set_input
(
reader
,
"<a></
a>"
,
sizeof
(
"<a></a
>"
)
-
1
);
hr
=
set_input
(
reader
,
"<a></
A>"
,
sizeof
(
"<a></A
>"
)
-
1
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
hr
=
WsFillReader
(
reader
,
sizeof
(
"<a></a>"
)
-
1
,
NULL
,
NULL
);
...
...
@@ -1722,6 +1722,7 @@ static void test_WsMoveReader(void)
WS_XML_STRING
localname
=
{
1
,
(
BYTE
*
)
"a"
},
localname2
=
{
1
,
(
BYTE
*
)
"b"
},
ns
=
{
0
,
NULL
};
const
WS_XML_NODE
*
node
;
WS_XML_ELEMENT_NODE
*
elem
;
WS_XML_UTF8_TEXT
utf8
;
hr
=
WsCreateReader
(
NULL
,
0
,
&
reader
,
NULL
)
;
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
...
...
@@ -1803,7 +1804,7 @@ static void test_WsMoveReader(void)
hr
=
WsGetReaderNode
(
reader
,
&
node
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
node
->
nodeType
==
WS_XML_NODE_TYPE_END_ELEMENT
,
"got %u
\n
"
,
elem
->
node
.
nodeType
);
ok
(
node
->
nodeType
==
WS_XML_NODE_TYPE_END_ELEMENT
,
"got %u
\n
"
,
node
->
nodeType
);
/* EOF node is last child of BOF node */
hr
=
WsMoveReader
(
reader
,
WS_MOVE_TO_BOF
,
NULL
,
NULL
);
...
...
@@ -1814,14 +1815,14 @@ static void test_WsMoveReader(void)
hr
=
WsGetReaderNode
(
reader
,
&
node
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
node
->
nodeType
==
WS_XML_NODE_TYPE_ELEMENT
,
"got %u
\n
"
,
elem
->
node
.
nodeType
);
ok
(
node
->
nodeType
==
WS_XML_NODE_TYPE_ELEMENT
,
"got %u
\n
"
,
node
->
nodeType
);
hr
=
WsMoveReader
(
reader
,
WS_MOVE_TO_NEXT_NODE
,
NULL
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
hr
=
WsGetReaderNode
(
reader
,
&
node
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
node
->
nodeType
==
WS_XML_NODE_TYPE_EOF
,
"got %u
\n
"
,
elem
->
node
.
nodeType
);
ok
(
node
->
nodeType
==
WS_XML_NODE_TYPE_EOF
,
"got %u
\n
"
,
node
->
nodeType
);
hr
=
WsMoveReader
(
reader
,
WS_MOVE_TO_ROOT_ELEMENT
,
NULL
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
...
...
@@ -1848,7 +1849,7 @@ static void test_WsMoveReader(void)
hr
=
WsGetReaderNode
(
reader
,
&
node
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
node
->
nodeType
==
WS_XML_NODE_TYPE_END_ELEMENT
,
"got %u
\n
"
,
elem
->
node
.
nodeType
);
ok
(
node
->
nodeType
==
WS_XML_NODE_TYPE_END_ELEMENT
,
"got %u
\n
"
,
node
->
nodeType
);
hr
=
WsMoveReader
(
reader
,
WS_MOVE_TO_PARENT_ELEMENT
,
NULL
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
...
...
@@ -1875,11 +1876,86 @@ static void test_WsMoveReader(void)
hr
=
WsGetReaderNode
(
reader
,
&
node
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
node
->
nodeType
==
WS_XML_NODE_TYPE_BOF
,
"got %u
\n
"
,
elem
->
node
.
nodeType
);
ok
(
node
->
nodeType
==
WS_XML_NODE_TYPE_BOF
,
"got %u
\n
"
,
node
->
nodeType
);
hr
=
WsMoveReader
(
reader
,
WS_MOVE_TO_PARENT_ELEMENT
,
NULL
,
NULL
);
ok
(
hr
==
WS_E_INVALID_FORMAT
,
"got %08x
\n
"
,
hr
);
WsFreeWriter
(
writer
);
WsFreeHeap
(
heap
);
hr
=
WsCreateHeap
(
1
<<
16
,
0
,
NULL
,
0
,
&
heap
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
hr
=
WsCreateXmlBuffer
(
heap
,
NULL
,
0
,
&
buffer
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
hr
=
WsCreateWriter
(
NULL
,
0
,
&
writer
,
NULL
)
;
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
hr
=
WsSetOutputToBuffer
(
writer
,
buffer
,
NULL
,
0
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
/* <a><b>test</b></a> */
hr
=
WsWriteStartElement
(
writer
,
NULL
,
&
localname
,
&
ns
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
hr
=
WsWriteStartElement
(
writer
,
NULL
,
&
localname2
,
&
ns
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
utf8
.
text
.
textType
=
WS_XML_TEXT_TYPE_UTF8
;
utf8
.
value
.
bytes
=
(
BYTE
*
)
"test"
;
utf8
.
value
.
length
=
sizeof
(
"test"
)
-
1
;
hr
=
WsWriteText
(
writer
,
&
utf8
.
text
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
hr
=
WsWriteEndElement
(
writer
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
hr
=
WsWriteEndElement
(
writer
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
hr
=
WsSetInputToBuffer
(
reader
,
buffer
,
NULL
,
0
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
hr
=
WsMoveReader
(
reader
,
WS_MOVE_TO_ROOT_ELEMENT
,
NULL
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
hr
=
WsGetReaderNode
(
reader
,
&
node
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
node
->
nodeType
==
WS_XML_NODE_TYPE_ELEMENT
,
"got %u
\n
"
,
node
->
nodeType
);
hr
=
WsMoveReader
(
reader
,
WS_MOVE_TO_NEXT_NODE
,
NULL
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
hr
=
WsGetReaderNode
(
reader
,
&
node
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
node
->
nodeType
==
WS_XML_NODE_TYPE_EOF
,
"got %u
\n
"
,
node
->
nodeType
);
hr
=
WsMoveReader
(
reader
,
WS_MOVE_TO_ROOT_ELEMENT
,
NULL
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
hr
=
WsMoveReader
(
reader
,
WS_MOVE_TO_CHILD_NODE
,
NULL
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
hr
=
WsGetReaderNode
(
reader
,
&
node
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
node
->
nodeType
==
WS_XML_NODE_TYPE_ELEMENT
,
"got %u
\n
"
,
node
->
nodeType
);
hr
=
WsGetReaderNode
(
reader
,
&
node
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
elem
=
(
WS_XML_ELEMENT_NODE
*
)
node
;
ok
(
elem
->
node
.
nodeType
==
WS_XML_NODE_TYPE_ELEMENT
,
"got %u
\n
"
,
elem
->
node
.
nodeType
);
ok
(
elem
->
localName
->
length
==
1
,
"got %u
\n
"
,
elem
->
localName
->
length
);
ok
(
!
memcmp
(
elem
->
localName
->
bytes
,
"b"
,
1
),
"wrong data
\n
"
);
hr
=
WsMoveReader
(
reader
,
WS_MOVE_TO_NEXT_NODE
,
NULL
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
hr
=
WsGetReaderNode
(
reader
,
&
node
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
node
->
nodeType
==
WS_XML_NODE_TYPE_END_ELEMENT
,
"got %u
\n
"
,
node
->
nodeType
);
WsFreeReader
(
reader
);
WsFreeWriter
(
writer
);
WsFreeHeap
(
heap
);
...
...
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