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
9d4c73f4
Commit
9d4c73f4
authored
Feb 13, 2019
by
Nikolay Sivov
Committed by
Alexandre Julliard
Feb 13, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
xmllite/tests: Test complete writer output for UTF-16 case.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
8d2e59ed
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
25 deletions
+12
-25
writer.c
dlls/xmllite/tests/writer.c
+12
-25
No files found.
dlls/xmllite/tests/writer.c
View file @
9d4c73f4
...
...
@@ -49,16 +49,18 @@ static void check_output_raw(IStream *stream, const void *expected, SIZE_T size,
SIZE_T
content_size
;
HGLOBAL
hglobal
;
HRESULT
hr
;
char
*
ptr
;
WCHAR
*
ptr
;
hr
=
GetHGlobalFromStream
(
stream
,
&
hglobal
);
ok_
(
__FILE__
,
line
)(
hr
==
S_OK
,
"Failed to get the stream handle, hr %#x.
\n
"
,
hr
);
content_size
=
GlobalSize
(
hglobal
);
ok_
(
__FILE__
,
line
)(
size
<=
content_size
,
"Unexpected test output size.
\n
"
);
ok_
(
__FILE__
,
line
)(
size
==
content_size
,
"Unexpected test output size %ld.
\n
"
,
content_size
);
ptr
=
GlobalLock
(
hglobal
);
if
(
size
<=
content_size
)
ok_
(
__FILE__
,
line
)(
!
memcmp
(
expected
,
ptr
,
size
),
"Unexpected output content.
\n
"
);
if
(
size
!=
content_size
&&
*
ptr
==
0xfeff
)
ok_
(
__FILE__
,
line
)(
0
,
"Content: %s.
\n
"
,
wine_dbgstr_wn
(
ptr
,
content_size
/
sizeof
(
WCHAR
)));
GlobalUnlock
(
hglobal
);
}
...
...
@@ -719,11 +721,14 @@ static void test_omitxmldeclaration(void)
static
void
test_bom
(
void
)
{
static
const
WCHAR
piW
[]
=
{
0xfeff
,
'<'
,
'?'
,
'x'
,
'm'
,
'l'
,
' '
,
'v'
,
'e'
,
'r'
,
's'
,
'i'
,
'o'
,
'n'
,
'='
,
'"'
,
'1'
,
'.'
,
'0'
,
'"'
,
'?'
,
'>'
};
static
const
WCHAR
aopenW
[]
=
{
0xfeff
,
'<'
,
'a'
};
static
const
WCHAR
afullW
[]
=
{
0xfeff
,
'<'
,
'a'
,
' '
,
'/'
,
'>'
};
static
const
WCHAR
versionW
[]
=
{
'v'
,
'e'
,
'r'
,
's'
,
'i'
,
'o'
,
'n'
,
'='
,
'"'
,
'1'
,
'.'
,
'0'
,
'"'
,
0
};
static
const
WCHAR
utf16W
[]
=
{
'u'
,
't'
,
'f'
,
'-'
,
'1'
,
'6'
,
0
};
static
const
WCHAR
xmlW
[]
=
{
'x'
,
'm'
,
'l'
,
0
};
static
const
WCHAR
bomW
[]
=
{
0xfeff
};
IXmlWriterOutput
*
output
;
unsigned
char
*
ptr
;
IXmlWriter
*
writer
;
IStream
*
stream
;
HGLOBAL
hglobal
;
...
...
@@ -750,12 +755,7 @@ static void test_bom(void)
hr
=
IXmlWriter_Flush
(
writer
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
hr
=
GetHGlobalFromStream
(
stream
,
&
hglobal
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ptr
=
GlobalLock
(
hglobal
);
ok
(
ptr
[
0
]
==
0xff
&&
ptr
[
1
]
==
0xfe
,
"got %x,%x
\n
"
,
ptr
[
0
],
ptr
[
1
]);
GlobalUnlock
(
hglobal
);
CHECK_OUTPUT_RAW
(
stream
,
bomW
,
sizeof
(
bomW
));
IStream_Release
(
stream
);
IUnknown_Release
(
output
);
...
...
@@ -776,12 +776,7 @@ static void test_bom(void)
hr
=
IXmlWriter_Flush
(
writer
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
hr
=
GetHGlobalFromStream
(
stream
,
&
hglobal
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ptr
=
GlobalLock
(
hglobal
);
ok
(
ptr
[
0
]
==
0xff
&&
ptr
[
1
]
==
0xfe
,
"got %x,%x
\n
"
,
ptr
[
0
],
ptr
[
1
]);
GlobalUnlock
(
hglobal
);
CHECK_OUTPUT_RAW
(
stream
,
piW
,
sizeof
(
piW
));
IUnknown_Release
(
output
);
IStream_Release
(
stream
);
...
...
@@ -802,12 +797,7 @@ static void test_bom(void)
hr
=
IXmlWriter_Flush
(
writer
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
hr
=
GetHGlobalFromStream
(
stream
,
&
hglobal
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ptr
=
GlobalLock
(
hglobal
);
ok
(
ptr
[
0
]
==
0xff
&&
ptr
[
1
]
==
0xfe
,
"got %x,%x
\n
"
,
ptr
[
0
],
ptr
[
1
]);
GlobalUnlock
(
hglobal
);
CHECK_OUTPUT_RAW
(
stream
,
aopenW
,
sizeof
(
aopenW
));
IUnknown_Release
(
output
);
IStream_Release
(
stream
);
...
...
@@ -833,10 +823,7 @@ static void test_bom(void)
hr
=
GetHGlobalFromStream
(
stream
,
&
hglobal
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ptr
=
GlobalLock
(
hglobal
);
ok
(
ptr
[
0
]
==
0xff
&&
ptr
[
1
]
==
0xfe
&&
ptr
[
2
]
==
'<'
,
"Unexpected output: %#x,%#x,%#x
\n
"
,
ptr
[
0
],
ptr
[
1
],
ptr
[
2
]);
GlobalUnlock
(
hglobal
);
CHECK_OUTPUT_RAW
(
stream
,
afullW
,
sizeof
(
afullW
));
IUnknown_Release
(
output
);
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