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
b7d24e22
Commit
b7d24e22
authored
Jan 28, 2022
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jan 28, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite/tests: Remove remaining kernel32 heap calls.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
9b17bd17
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
31 deletions
+29
-31
analyzer.c
dlls/dwrite/tests/analyzer.c
+4
-7
font.c
dlls/dwrite/tests/font.c
+19
-16
layout.c
dlls/dwrite/tests/layout.c
+6
-8
No files found.
dlls/dwrite/tests/analyzer.c
View file @
b7d24e22
...
...
@@ -134,16 +134,13 @@ static void add_call(struct call_sequence **seq, int sequence_index, const struc
if
(
!
call_seq
->
sequence
)
{
call_seq
->
size
=
10
;
call_seq
->
sequence
=
HeapAlloc
(
GetProcessHeap
(),
0
,
call_seq
->
size
*
sizeof
(
struct
call_entry
));
call_seq
->
sequence
=
malloc
(
call_seq
->
size
*
sizeof
(
*
call_seq
->
sequence
));
}
if
(
call_seq
->
count
==
call_seq
->
size
)
{
call_seq
->
size
*=
2
;
call_seq
->
sequence
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
call_seq
->
sequence
,
call_seq
->
size
*
sizeof
(
struct
call_entry
));
call_seq
->
sequence
=
realloc
(
call_seq
->
sequence
,
call_seq
->
size
*
sizeof
(
*
call_seq
->
sequence
));
}
assert
(
call_seq
->
sequence
);
...
...
@@ -155,7 +152,7 @@ static inline void flush_sequence(struct call_sequence **seg, int sequence_index
{
struct
call_sequence
*
call_seq
=
seg
[
sequence_index
];
HeapFree
(
GetProcessHeap
(),
0
,
call_seq
->
sequence
);
free
(
call_seq
->
sequence
);
call_seq
->
sequence
=
NULL
;
call_seq
->
count
=
call_seq
->
size
=
0
;
}
...
...
@@ -165,7 +162,7 @@ static void init_call_sequences(struct call_sequence **seq, int n)
int
i
;
for
(
i
=
0
;
i
<
n
;
i
++
)
seq
[
i
]
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
struct
call_sequence
));
seq
[
i
]
=
calloc
(
1
,
sizeof
(
*
seq
[
i
]
));
}
static
void
test_uint
(
UINT32
actual
,
UINT32
expected
,
const
char
*
name
,
const
struct
testcontext
*
ctxt
)
...
...
dlls/dwrite/tests/font.c
View file @
b7d24e22
...
...
@@ -783,11 +783,13 @@ static ULONG WINAPI fontdatastream_AddRef(IDWriteFontFileStream *iface)
static
ULONG
WINAPI
fontdatastream_Release
(
IDWriteFontFileStream
*
iface
)
{
struct
test_fontdatastream
*
This
=
impl_from_IDWriteFontFileStream
(
iface
);
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
if
(
ref
==
0
)
HeapFree
(
GetProcessHeap
(),
0
,
This
);
return
ref
;
struct
test_fontdatastream
*
stream
=
impl_from_IDWriteFontFileStream
(
iface
);
ULONG
refcount
=
InterlockedDecrement
(
&
stream
->
ref
);
if
(
!
refcount
)
free
(
stream
);
return
refcount
;
}
static
HRESULT
WINAPI
fontdatastream_ReadFileFragment
(
IDWriteFontFileStream
*
iface
,
void
const
**
fragment_start
,
UINT64
offset
,
UINT64
fragment_size
,
void
**
fragment_context
)
...
...
@@ -836,16 +838,17 @@ static const IDWriteFontFileStreamVtbl fontdatastreamvtbl =
static
HRESULT
create_fontdatastream
(
LPVOID
data
,
UINT
size
,
IDWriteFontFileStream
**
iface
)
{
struct
test_fontdatastream
*
This
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
struct
test_fontdatastream
));
if
(
!
This
)
struct
test_fontdatastream
*
object
=
calloc
(
1
,
sizeof
(
*
object
));
if
(
!
object
)
return
E_OUTOFMEMORY
;
This
->
data
=
data
;
This
->
size
=
size
;
This
->
ref
=
1
;
This
->
IDWriteFontFileStream_iface
.
lpVtbl
=
&
fontdatastreamvtbl
;
object
->
IDWriteFontFileStream_iface
.
lpVtbl
=
&
fontdatastreamvtbl
;
object
->
ref
=
1
;
object
->
data
=
data
;
object
->
size
=
size
;
*
iface
=
&
object
->
IDWriteFontFileStream_iface
;
*
iface
=
&
This
->
IDWriteFontFileStream_iface
;
return
S_OK
;
}
...
...
@@ -6014,7 +6017,7 @@ static void test_CreateGlyphRunAnalysis(void)
ok
(
!
IsRectEmpty
(
&
rect
),
"Unexpected empty bbox.
\n
"
);
size
=
(
rect
.
right
-
rect
.
left
)
*
(
rect
.
bottom
-
rect
.
top
);
bits
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
bits
=
malloc
(
size
);
hr
=
IDWriteGlyphRunAnalysis_CreateAlphaTexture
(
analysis
,
DWRITE_TEXTURE_ALIASED_1x1
,
&
rect
,
bits
,
size
);
ok
(
hr
==
S_OK
,
"Failed to get alpha texture, hr %#x.
\n
"
,
hr
);
...
...
@@ -6029,7 +6032,7 @@ static void test_CreateGlyphRunAnalysis(void)
todo_wine
ok
(
hr
==
DWRITE_E_UNSUPPORTEDOPERATION
,
"Unexpected hr %#x.
\n
"
,
hr
);
HeapFree
(
GetProcessHeap
(),
0
,
bits
);
free
(
bits
);
hr
=
IDWriteFactory_CreateCustomRenderingParams
(
factory
,
0
.
1
f
,
0
.
0
f
,
1
.
0
f
,
DWRITE_PIXEL_GEOMETRY_FLAT
,
DWRITE_RENDERING_MODE_NATURAL
,
&
params
);
...
...
@@ -6095,7 +6098,7 @@ static void test_CreateGlyphRunAnalysis(void)
ok
(
!
IsRectEmpty
(
&
rect
),
"Unexpected empty bbox.
\n
"
);
size
=
(
rect
.
right
-
rect
.
left
)
*
(
rect
.
bottom
-
rect
.
top
);
bits
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
bits
=
malloc
(
size
);
hr
=
IDWriteGlyphRunAnalysis_CreateAlphaTexture
(
analysis
,
DWRITE_TEXTURE_ALIASED_1x1
,
&
rect
,
bits
,
size
);
ok
(
hr
==
S_OK
,
"Failed to get alpha texture, hr %#x.
\n
"
,
hr
);
...
...
@@ -6110,7 +6113,7 @@ static void test_CreateGlyphRunAnalysis(void)
todo_wine
ok
(
hr
==
DWRITE_E_UNSUPPORTEDOPERATION
,
"Unexpected hr %#x.
\n
"
,
hr
);
HeapFree
(
GetProcessHeap
(),
0
,
bits
);
free
(
bits
);
IDWriteGlyphRunAnalysis_Release
(
analysis
);
...
...
dlls/dwrite/tests/layout.c
View file @
b7d24e22
...
...
@@ -343,14 +343,12 @@ static void add_call(struct drawcall_sequence **seq, int sequence_index, const s
if
(
!
call_seq
->
sequence
)
{
call_seq
->
size
=
10
;
call_seq
->
sequence
=
HeapAlloc
(
GetProcessHeap
(),
0
,
call_seq
->
size
*
sizeof
(
struct
drawcall_entry
));
call_seq
->
sequence
=
malloc
(
call_seq
->
size
*
sizeof
(
*
call_seq
->
sequence
));
}
if
(
call_seq
->
count
==
call_seq
->
size
)
{
call_seq
->
size
*=
2
;
call_seq
->
sequence
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
call_seq
->
sequence
,
call_seq
->
size
*
sizeof
(
struct
drawcall_entry
));
call_seq
->
sequence
=
realloc
(
call_seq
->
sequence
,
call_seq
->
size
*
sizeof
(
*
call_seq
->
sequence
));
}
assert
(
call_seq
->
sequence
);
...
...
@@ -361,7 +359,7 @@ static inline void flush_sequence(struct drawcall_sequence **seg, int sequence_i
{
struct
drawcall_sequence
*
call_seq
=
seg
[
sequence_index
];
HeapFree
(
GetProcessHeap
(),
0
,
call_seq
->
sequence
);
free
(
call_seq
->
sequence
);
call_seq
->
sequence
=
NULL
;
call_seq
->
count
=
call_seq
->
size
=
0
;
}
...
...
@@ -371,7 +369,7 @@ static void init_call_sequences(struct drawcall_sequence **seq, int n)
int
i
;
for
(
i
=
0
;
i
<
n
;
i
++
)
seq
[
i
]
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
struct
drawcall_sequence
));
seq
[
i
]
=
calloc
(
1
,
sizeof
(
*
seq
[
i
]
));
}
static
void
ok_sequence_
(
struct
drawcall_sequence
**
seq
,
int
sequence_index
,
...
...
@@ -879,7 +877,7 @@ static ULONG WINAPI testeffect_Release(IUnknown *iface)
LONG
ref
=
InterlockedDecrement
(
&
effect
->
ref
);
if
(
!
ref
)
HeapFree
(
GetProcessHeap
(),
0
,
effect
);
free
(
effect
);
return
ref
;
}
...
...
@@ -894,7 +892,7 @@ static IUnknown *create_test_effect(void)
{
struct
test_effect
*
effect
;
effect
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
effect
));
effect
=
calloc
(
1
,
sizeof
(
*
effect
));
effect
->
IUnknown_iface
.
lpVtbl
=
&
testeffectvtbl
;
effect
->
ref
=
1
;
...
...
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