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
0e99baed
Commit
0e99baed
authored
Nov 05, 2023
by
Alex Henrie
Committed by
Alexandre Julliard
Nov 23, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32/tests: Use CRT allocation functions.
parent
9b9f7a00
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
23 additions
and
28 deletions
+23
-28
combo.c
dlls/comctl32/tests/combo.c
+2
-2
listbox.c
dlls/comctl32/tests/listbox.c
+4
-5
mru.c
dlls/comctl32/tests/mru.c
+2
-3
msg.h
dlls/comctl32/tests/msg.h
+4
-4
rebar.c
dlls/comctl32/tests/rebar.c
+6
-7
subclass.c
dlls/comctl32/tests/subclass.c
+3
-4
taskdialog.c
dlls/comctl32/tests/taskdialog.c
+2
-3
No files found.
dlls/comctl32/tests/combo.c
View file @
0e99baed
...
...
@@ -161,7 +161,7 @@ static void test_comboex(void)
*
out_of_range_item
=
"Out of Range Item"
;
/* Allocate space for result */
textBuffer
=
heap_
alloc
(
MAX_CHARS
);
textBuffer
=
m
alloc
(
MAX_CHARS
);
/* Basic comboboxex test */
myHwnd
=
createComboEx
(
WS_BORDER
|
WS_VISIBLE
|
WS_CHILD
|
CBS_DROPDOWN
);
...
...
@@ -247,7 +247,7 @@ static void test_comboex(void)
/* Cleanup */
heap_
free
(
textBuffer
);
free
(
textBuffer
);
DestroyWindow
(
myHwnd
);
}
...
...
dlls/comctl32/tests/listbox.c
View file @
0e99baed
...
...
@@ -27,7 +27,6 @@
#include "winnls.h"
#include "commctrl.h"
#include "wine/heap.h"
#include "wine/test.h"
#include "v6util.h"
#include "msg.h"
...
...
@@ -254,18 +253,18 @@ static void run_test(DWORD style, const struct listbox_test test)
WCHAR
*
txtw
;
CHAR
*
txt
;
txt
=
heap_alloc_zero
(
size
+
1
);
txt
=
calloc
(
1
,
size
+
1
);
resA
=
SendMessageA
(
hLB
,
LB_GETTEXT
,
i
,
(
LPARAM
)
txt
);
ok
(
!
strcmp
(
txt
,
strings
[
i
]),
"returned string for item %d does not match %s vs %s
\n
"
,
i
,
txt
,
strings
[
i
]);
txtw
=
heap_alloc_zero
((
size
+
1
)
*
sizeof
(
*
txtw
));
txtw
=
calloc
(
size
+
1
,
sizeof
(
*
txtw
));
resW
=
SendMessageW
(
hLB
,
LB_GETTEXT
,
i
,
(
LPARAM
)
txtw
);
ok
(
resA
==
resW
,
"Unexpected text length.
\n
"
);
WideCharToMultiByte
(
CP_ACP
,
0
,
txtw
,
-
1
,
txt
,
size
,
NULL
,
NULL
);
ok
(
!
strcmp
(
txt
,
strings
[
i
]),
"Unexpected string for item %d, %s vs %s.
\n
"
,
i
,
txt
,
strings
[
i
]);
heap_
free
(
txtw
);
heap_
free
(
txt
);
free
(
txtw
);
free
(
txt
);
}
/* Confirm the count of items, and that an invalid delete does not remove anything */
...
...
dlls/comctl32/tests/mru.c
View file @
0e99baed
...
...
@@ -28,7 +28,6 @@
#include "commctrl.h"
#include "shlwapi.h"
#include "wine/heap.h"
#include "wine/test.h"
/* Keys for testing MRU functions */
...
...
@@ -121,7 +120,7 @@ static LSTATUS mru_RegDeleteTreeA(HKEY hKey, LPCSTR lpszSubKey)
if
(
dwMaxLen
>
ARRAY_SIZE
(
szNameBuf
))
{
/* Name too big: alloc a buffer for it */
if
(
!
(
lpszName
=
heap_
alloc
(
dwMaxLen
*
sizeof
(
CHAR
))))
if
(
!
(
lpszName
=
m
alloc
(
dwMaxLen
*
sizeof
(
CHAR
))))
{
ret
=
ERROR_NOT_ENOUGH_MEMORY
;
goto
cleanup
;
...
...
@@ -156,7 +155,7 @@ static LSTATUS mru_RegDeleteTreeA(HKEY hKey, LPCSTR lpszSubKey)
cleanup:
/* Free buffer if allocated */
if
(
lpszName
!=
szNameBuf
)
heap_
free
(
lpszName
);
free
(
lpszName
);
if
(
lpszSubKey
)
RegCloseKey
(
hSubKey
);
return
ret
;
...
...
dlls/comctl32/tests/msg.h
View file @
0e99baed
...
...
@@ -71,13 +71,13 @@ static void add_message(struct msg_sequence **seq, int sequence_index,
if
(
!
msg_seq
->
sequence
)
{
msg_seq
->
size
=
10
;
msg_seq
->
sequence
=
heap_
alloc
(
msg_seq
->
size
*
sizeof
(
*
msg_seq
->
sequence
));
msg_seq
->
sequence
=
m
alloc
(
msg_seq
->
size
*
sizeof
(
*
msg_seq
->
sequence
));
}
if
(
msg_seq
->
count
==
msg_seq
->
size
)
{
msg_seq
->
size
*=
2
;
msg_seq
->
sequence
=
heap_
realloc
(
msg_seq
->
sequence
,
msg_seq
->
size
*
sizeof
(
*
msg_seq
->
sequence
));
msg_seq
->
sequence
=
realloc
(
msg_seq
->
sequence
,
msg_seq
->
size
*
sizeof
(
*
msg_seq
->
sequence
));
}
assert
(
msg_seq
->
sequence
);
...
...
@@ -89,7 +89,7 @@ static void add_message(struct msg_sequence **seq, int sequence_index,
static
inline
void
flush_sequence
(
struct
msg_sequence
**
seg
,
int
sequence_index
)
{
struct
msg_sequence
*
msg_seq
=
seg
[
sequence_index
];
heap_
free
(
msg_seq
->
sequence
);
free
(
msg_seq
->
sequence
);
msg_seq
->
sequence
=
NULL
;
msg_seq
->
count
=
msg_seq
->
size
=
0
;
}
...
...
@@ -394,5 +394,5 @@ static void init_msg_sequences(struct msg_sequence **seq, int n)
int
i
;
for
(
i
=
0
;
i
<
n
;
i
++
)
seq
[
i
]
=
heap_alloc_zero
(
sizeof
(
*
seq
[
i
]));
seq
[
i
]
=
calloc
(
1
,
sizeof
(
*
seq
[
i
]));
}
dlls/comctl32/tests/rebar.c
View file @
0e99baed
...
...
@@ -22,7 +22,6 @@
#include <windows.h>
#include <commctrl.h>
#include "wine/heap.h"
#include "wine/test.h"
static
BOOL
(
WINAPI
*
pImageList_Destroy
)(
HIMAGELIST
);
...
...
@@ -215,9 +214,9 @@ static rbsize_result_t rbsize_init(int cleft, int ctop, int cright, int cbottom,
SetRect
(
&
ret
.
rcClient
,
cleft
,
ctop
,
cright
,
cbottom
);
ret
.
cyBarHeight
=
cyBarHeight
;
ret
.
nRows
=
0
;
ret
.
cyRowHeights
=
heap_alloc_zero
(
nRows
*
sizeof
(
int
));
ret
.
cyRowHeights
=
calloc
(
nRows
,
sizeof
(
int
));
ret
.
nBands
=
0
;
ret
.
bands
=
heap_alloc_zero
(
nBands
*
sizeof
(
*
ret
.
bands
));
ret
.
bands
=
calloc
(
nBands
,
sizeof
(
*
ret
.
bands
));
return
ret
;
}
...
...
@@ -241,7 +240,7 @@ static rbsize_result_t *rbsize_results;
static
void
rbsize_results_init
(
void
)
{
rbsize_results
=
heap_
alloc
(
rbsize_results_num
*
sizeof
(
*
rbsize_results
));
rbsize_results
=
m
alloc
(
rbsize_results_num
*
sizeof
(
*
rbsize_results
));
rbsize_results
[
0
]
=
rbsize_init
(
0
,
0
,
672
,
0
,
0
,
0
,
0
);
...
...
@@ -428,10 +427,10 @@ static void rbsize_results_free(void)
int
i
;
for
(
i
=
0
;
i
<
rbsize_results_num
;
i
++
)
{
heap_
free
(
rbsize_results
[
i
].
cyRowHeights
);
heap_
free
(
rbsize_results
[
i
].
bands
);
free
(
rbsize_results
[
i
].
cyRowHeights
);
free
(
rbsize_results
[
i
].
bands
);
}
heap_
free
(
rbsize_results
);
free
(
rbsize_results
);
rbsize_results
=
NULL
;
}
...
...
dlls/comctl32/tests/subclass.c
View file @
0e99baed
...
...
@@ -26,7 +26,6 @@
#include "winuser.h"
#include "commctrl.h"
#include "wine/heap.h"
#include "wine/test.h"
static
BOOL
(
WINAPI
*
pGetWindowSubclass
)(
HWND
,
SUBCLASSPROC
,
UINT_PTR
,
DWORD_PTR
*
);
...
...
@@ -124,12 +123,12 @@ static void add_message(const struct message *msg)
if
(
!
sequence
)
{
sequence_size
=
10
;
sequence
=
heap_alloc
(
sequence_size
*
sizeof
(
struct
message
)
);
sequence
=
malloc
(
sequence_size
*
sizeof
(
struct
message
)
);
}
if
(
sequence_cnt
==
sequence_size
)
{
sequence_size
*=
2
;
sequence
=
heap_realloc
(
sequence
,
sequence_size
*
sizeof
(
struct
message
)
);
sequence
=
realloc
(
sequence
,
sequence_size
*
sizeof
(
struct
message
)
);
}
assert
(
sequence
);
...
...
@@ -141,7 +140,7 @@ static void add_message(const struct message *msg)
static
void
flush_sequence
(
void
)
{
heap_
free
(
sequence
);
free
(
sequence
);
sequence
=
NULL
;
sequence_cnt
=
sequence_size
=
0
;
}
...
...
dlls/comctl32/tests/taskdialog.c
View file @
0e99baed
...
...
@@ -24,7 +24,6 @@
#include "winuser.h"
#include "commctrl.h"
#include "wine/heap.h"
#include "wine/test.h"
#include "v6util.h"
#include "msg.h"
...
...
@@ -404,7 +403,7 @@ static void run_test_(TASKDIALOGCONFIG *info, int expect_button, int expect_radi
int
i
;
/* Allocate messages to test against, plus 2 implicit and 1 empty */
msg_start
=
msg
=
heap_alloc_zero
(
sizeof
(
*
msg
)
*
(
test_messages_len
+
3
));
msg_start
=
msg
=
calloc
(
test_messages_len
+
3
,
sizeof
(
*
msg
));
/* Always needed, thus made implicit */
init_test_message
(
TDN_DIALOG_CONSTRUCTED
,
0
,
0
,
msg
++
);
...
...
@@ -425,7 +424,7 @@ static void run_test_(TASKDIALOGCONFIG *info, int expect_button, int expect_radi
ok_
(
file
,
line
)(
ret_radio
==
expect_radio_button
,
"Wrong radio button. Expected %d, got %d
\n
"
,
expect_radio_button
,
ret_radio
);
heap_
free
(
msg_start
);
free
(
msg_start
);
}
static
const
LONG_PTR
test_ref_data
=
123456
;
...
...
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