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
3b050d61
Commit
3b050d61
authored
Dec 23, 2016
by
Hans Leidekker
Committed by
Alexandre Julliard
Dec 23, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
webservices/tests: Add a helper to print the contents of the output buffer.
Signed-off-by:
Hans Leidekker
<
hans@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
87c1ce80
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
1 deletion
+37
-1
writer.c
dlls/webservices/tests/writer.c
+37
-1
No files found.
dlls/webservices/tests/writer.c
View file @
3b050d61
...
...
@@ -339,6 +339,41 @@ static void test_WsSetOutputToBuffer(void)
WsFreeHeap
(
heap
);
}
static
char
strbuf
[
512
];
static
const
char
*
debugstr_bytes
(
const
BYTE
*
bytes
,
ULONG
len
)
{
const
BYTE
*
src
=
bytes
;
char
*
dst
=
strbuf
;
while
(
len
)
{
BYTE
c
=
*
src
++
;
if
(
dst
-
strbuf
>
sizeof
(
strbuf
)
-
7
)
break
;
switch
(
c
)
{
case
'\n'
:
*
dst
++
=
'\\'
;
*
dst
++
=
'n'
;
break
;
case
'\r'
:
*
dst
++
=
'\\'
;
*
dst
++
=
'r'
;
break
;
case
'\t'
:
*
dst
++
=
'\\'
;
*
dst
++
=
't'
;
break
;
default:
if
(
c
>=
' '
&&
c
<
127
)
*
dst
++
=
c
;
else
{
sprintf
(
dst
,
"
\\
%02x"
,
c
);
dst
+=
3
;
}
}
len
--
;
}
if
(
len
)
{
*
dst
++
=
'.'
;
*
dst
++
=
'.'
;
*
dst
++
=
'.'
;
}
*
dst
=
0
;
return
strbuf
;
}
static
void
check_output
(
WS_XML_WRITER
*
writer
,
const
char
*
expected
,
unsigned
int
line
)
{
WS_BYTES
bytes
;
...
...
@@ -351,7 +386,8 @@ static void check_output( WS_XML_WRITER *writer, const char *expected, unsigned
ok
(
hr
==
S_OK
,
"%u: got %08x
\n
"
,
line
,
hr
);
ok
(
bytes
.
length
==
len
,
"%u: got %u expected %u
\n
"
,
line
,
bytes
.
length
,
len
);
if
(
bytes
.
length
!=
len
)
return
;
ok
(
!
memcmp
(
bytes
.
bytes
,
expected
,
len
),
"%u: got %s expected %s
\n
"
,
line
,
bytes
.
bytes
,
expected
);
ok
(
!
memcmp
(
bytes
.
bytes
,
expected
,
len
),
"%u: got %s expected %s
\n
"
,
line
,
debugstr_bytes
(
bytes
.
bytes
,
bytes
.
length
),
expected
);
}
static
void
test_WsWriteStartElement
(
void
)
...
...
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