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
d3cb9a29
Commit
d3cb9a29
authored
Aug 12, 2021
by
Akihiro Sagawa
Committed by
Alexandre Julliard
Aug 12, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32/tests: Test pending redraw state with owner-drawn list box.
Signed-off-by:
Akihiro Sagawa
<
sagawa.aki@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
247185ba
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
1 deletion
+49
-1
listbox.c
dlls/comctl32/tests/listbox.c
+49
-1
No files found.
dlls/comctl32/tests/listbox.c
View file @
d3cb9a29
...
...
@@ -326,7 +326,7 @@ static void test_item_height(void)
DestroyWindow
(
hLB
);
}
static
int
got_selchange
;
static
unsigned
int
got_selchange
,
got_drawitem
;
static
LRESULT
WINAPI
main_window_proc
(
HWND
hwnd
,
UINT
msg
,
WPARAM
wParam
,
LPARAM
lParam
)
{
...
...
@@ -418,6 +418,7 @@ static LRESULT WINAPI main_window_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARA
SendMessageA
(
dis
->
hwndItem
,
LB_GETITEMRECT
,
dis
->
itemID
,
(
LPARAM
)
&
rc_item
);
ok
(
EqualRect
(
&
dis
->
rcItem
,
&
rc_item
),
"item rects are not equal
\n
"
);
got_drawitem
++
;
break
;
}
...
...
@@ -467,6 +468,19 @@ static void test_ownerdraw(void)
0
,
LBS_NODATA
};
static
const
struct
{
UINT
message
;
WPARAM
wparam
;
LPARAM
lparam
;
UINT
drawitem
;
}
testcase
[]
=
{
{
WM_NULL
,
0
,
0
,
0
},
{
WM_PAINT
,
0
,
0
,
0
},
{
LB_GETCOUNT
,
0
,
0
,
0
},
{
LB_SETCOUNT
,
ARRAY_SIZE
(
strings
),
0
,
ARRAY_SIZE
(
strings
)
},
{
LB_ADDSTRING
,
0
,
(
LPARAM
)
"foo"
,
ARRAY_SIZE
(
strings
)
+
1
},
{
LB_DELETESTRING
,
0
,
0
,
ARRAY_SIZE
(
strings
)
-
1
},
};
HWND
parent
,
hLB
;
INT
ret
;
RECT
rc
;
...
...
@@ -528,6 +542,40 @@ static void test_ownerdraw(void)
DestroyWindow
(
hLB
);
}
/* test pending redraw state */
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
testcase
);
i
++
)
{
winetest_push_context
(
"%d"
,
i
);
hLB
=
create_listbox
(
LBS_OWNERDRAWFIXED
|
LBS_NODATA
|
WS_CHILD
|
WS_VISIBLE
,
parent
);
assert
(
hLB
);
ret
=
SendMessageA
(
hLB
,
WM_SETREDRAW
,
FALSE
,
0
);
ok
(
!
ret
,
"got %d
\n
"
,
ret
);
ret
=
SendMessageA
(
hLB
,
testcase
[
i
].
message
,
testcase
[
i
].
wparam
,
testcase
[
i
].
lparam
);
if
(
testcase
[
i
].
message
>=
LB_ADDSTRING
&&
testcase
[
i
].
message
<
LB_MSGMAX
&&
testcase
[
i
].
message
!=
LB_SETCOUNT
)
ok
(
ret
>
0
,
"expected > 0, got %d
\n
"
,
ret
);
else
ok
(
!
ret
,
"expected 0, got %d
\n
"
,
ret
);
got_drawitem
=
0
;
ret
=
RedrawWindow
(
hLB
,
NULL
,
0
,
RDW_UPDATENOW
);
ok
(
ret
,
"RedrawWindow failed
\n
"
);
ok
(
!
got_drawitem
,
"got %u
\n
"
,
got_drawitem
);
ret
=
SendMessageA
(
hLB
,
WM_SETREDRAW
,
TRUE
,
0
);
ok
(
!
ret
,
"got %d
\n
"
,
ret
);
got_drawitem
=
0
;
ret
=
RedrawWindow
(
hLB
,
NULL
,
0
,
RDW_UPDATENOW
);
ok
(
ret
,
"RedrawWindow failed
\n
"
);
todo_wine_if
(
testcase
[
i
].
message
==
LB_SETCOUNT
)
ok
(
got_drawitem
==
testcase
[
i
].
drawitem
,
"expected %u, got %u
\n
"
,
testcase
[
i
].
drawitem
,
got_drawitem
);
DestroyWindow
(
hLB
);
winetest_pop_context
();
}
DestroyWindow
(
parent
);
}
...
...
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