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
65758cde
Commit
65758cde
authored
Jul 10, 2009
by
Austin Lund
Committed by
Alexandre Julliard
Aug 13, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32/tests: Added tests for infinite WM_PAINT loop.
parent
956a52bd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
73 additions
and
0 deletions
+73
-0
win.c
dlls/user32/tests/win.c
+73
-0
No files found.
dlls/user32/tests/win.c
View file @
65758cde
...
...
@@ -4859,6 +4859,78 @@ static void test_Expose(void)
DestroyWindow
(
mw
);
}
static
LRESULT
CALLBACK
TestNCRedraw_WndProc
(
HWND
hwnd
,
UINT
msg
,
WPARAM
wParam
,
LPARAM
lParam
)
{
static
UINT
ncredrawflags
;
PAINTSTRUCT
ps
;
RECT
rect
;
BOOL
updateRectValue
;
switch
(
msg
)
{
case
WM_CREATE
:
ncredrawflags
=
*
(
UINT
*
)
(((
CREATESTRUCT
*
)
lParam
)
->
lpCreateParams
);
return
0
;
case
WM_NCPAINT
:
updateRectValue
=
GetUpdateRect
(
hwnd
,
&
rect
,
FALSE
);
RedrawWindow
(
hwnd
,
NULL
,
NULL
,
ncredrawflags
);
break
;
case
WM_PAINT
:
BeginPaint
(
hwnd
,
&
ps
);
EndPaint
(
hwnd
,
&
ps
);
return
0
;
}
return
DefWindowProc
(
hwnd
,
msg
,
wParam
,
lParam
);
}
static
void
run_NCRedrawLoop
(
UINT
flags
)
{
HWND
hwnd
;
MSG
msg
;
UINT
loopcount
=
0
;
hwnd
=
CreateWindowA
(
"TestNCRedrawClass"
,
"MainWindow"
,
WS_OVERLAPPEDWINDOW
,
0
,
0
,
200
,
100
,
NULL
,
NULL
,
0
,
&
flags
);
ShowWindow
(
hwnd
,
SW_SHOW
);
UpdateWindow
(
hwnd
);
while
(
PeekMessage
(
&
msg
,
hwnd
,
0
,
0
,
PM_REMOVE
)
!=
0
)
{
if
(
msg
.
message
==
WM_PAINT
)
loopcount
++
;
if
(
loopcount
>=
100
)
break
;
TranslateMessage
(
&
msg
);
DispatchMessage
(
&
msg
);
MsgWaitForMultipleObjects
(
0
,
NULL
,
FALSE
,
100
,
QS_ALLINPUT
);
}
if
(
flags
==
(
RDW_INVALIDATE
|
RDW_FRAME
))
todo_wine
ok
(
loopcount
<
100
,
"Detected infinite WM_PAINT loop (%x).
\n
"
,
flags
);
else
ok
(
loopcount
<
100
,
"Detected infinite WM_PAINT loop (%x).
\n
"
,
flags
);
DestroyWindow
(
hwnd
);
}
static
void
test_NCRedraw
(
void
)
{
WNDCLASSA
wndclass
;
wndclass
.
lpszClassName
=
"TestNCRedrawClass"
;
wndclass
.
style
=
CS_HREDRAW
|
CS_VREDRAW
;
wndclass
.
lpfnWndProc
=
TestNCRedraw_WndProc
;
wndclass
.
cbClsExtra
=
0
;
wndclass
.
cbWndExtra
=
0
;
wndclass
.
hInstance
=
0
;
wndclass
.
hIcon
=
LoadIcon
(
NULL
,
IDI_APPLICATION
);
wndclass
.
hCursor
=
LoadCursor
(
NULL
,
IDC_ARROW
);
wndclass
.
hbrBackground
=
GetStockObject
(
WHITE_BRUSH
);
wndclass
.
lpszMenuName
=
NULL
;
RegisterClassA
(
&
wndclass
);
run_NCRedrawLoop
(
RDW_INVALIDATE
|
RDW_FRAME
);
run_NCRedrawLoop
(
RDW_INVALIDATE
);
}
static
void
test_GetWindowModuleFileName
(
void
)
{
HWND
hwnd
;
...
...
@@ -5647,6 +5719,7 @@ START_TEST(win)
test_SetMenu
(
hwndMain
);
test_SetFocus
(
hwndMain
);
test_SetActiveWindow
(
hwndMain
);
test_NCRedraw
();
test_children_zorder
(
hwndMain
);
test_popup_zorder
(
hwndMain2
,
hwndMain
);
...
...
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