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
20920457
Commit
20920457
authored
Mar 08, 2017
by
Nikolay Sivov
Committed by
Alexandre Julliard
Mar 08, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
xmllite/tests: Fix a memory leak (Valgrind).
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
c7fb64db
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
1 deletion
+16
-1
writer.c
dlls/xmllite/tests/writer.c
+16
-1
No files found.
dlls/xmllite/tests/writer.c
View file @
20920457
...
...
@@ -31,6 +31,15 @@
#include "initguid.h"
DEFINE_GUID
(
IID_IXmlWriterOutput
,
0xc1131708
,
0x0f59
,
0x477f
,
0x93
,
0x59
,
0x7d
,
0x33
,
0x24
,
0x51
,
0xbc
,
0x1a
);
#define EXPECT_REF(obj, ref) _expect_ref((IUnknown *)obj, ref, __LINE__)
static
void
_expect_ref
(
IUnknown
*
obj
,
ULONG
ref
,
int
line
)
{
ULONG
refcount
;
IUnknown_AddRef
(
obj
);
refcount
=
IUnknown_Release
(
obj
);
ok_
(
__FILE__
,
line
)(
refcount
==
ref
,
"expected refcount %d, got %d
\n
"
,
ref
,
refcount
);
}
static
void
check_output
(
IStream
*
stream
,
const
char
*
expected
,
BOOL
todo
,
int
line
)
{
int
len
=
strlen
(
expected
),
size
;
...
...
@@ -273,6 +282,7 @@ static void test_writeroutput(void)
output
=
NULL
;
hr
=
CreateXmlWriterOutputWithEncodingName
(
&
testoutput
,
NULL
,
NULL
,
&
output
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
EXPECT_REF
(
output
,
1
);
IUnknown_Release
(
output
);
hr
=
CreateXmlWriterOutputWithEncodingName
(
&
testoutput
,
NULL
,
utf16W
,
&
output
);
...
...
@@ -280,9 +290,13 @@ static void test_writeroutput(void)
unk
=
NULL
;
hr
=
IUnknown_QueryInterface
(
output
,
&
IID_IXmlWriterOutput
,
(
void
**
)
&
unk
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
unk
!=
NULL
,
"got %p
\n
"
,
unk
);
todo_wine
ok
(
unk
!=
NULL
&&
unk
!=
output
,
"got %p, output %p
\n
"
,
unk
,
output
);
EXPECT_REF
(
output
,
2
);
/* releasing 'unk' crashes on native */
IUnknown_Release
(
output
);
EXPECT_REF
(
output
,
1
);
IUnknown_Release
(
output
);
output
=
NULL
;
hr
=
CreateXmlWriterOutputWithEncodingCodePage
(
&
testoutput
,
NULL
,
~
0u
,
&
output
);
...
...
@@ -297,6 +311,7 @@ static void test_writeroutput(void)
ok
(
unk
!=
NULL
,
"got %p
\n
"
,
unk
);
/* releasing 'unk' crashes on native */
IUnknown_Release
(
output
);
IUnknown_Release
(
output
);
}
static
void
test_writestartdocument
(
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