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
ffce2de2
Commit
ffce2de2
authored
Sep 23, 2023
by
Esme Povirk
Committed by
Alexandre Julliard
Sep 25, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32/tests: Use a child window for test_PeekMessage3.
Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=54026
parent
8f6cf2d3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
33 deletions
+38
-33
msg.c
dlls/user32/tests/msg.c
+38
-33
No files found.
dlls/user32/tests/msg.c
View file @
ffce2de2
...
...
@@ -13988,119 +13988,124 @@ done:
static
void
test_PeekMessage3
(
void
)
{
HWND
hwnd
;
HWND
parent_hwnd
,
hwnd
;
BOOL
ret
;
MSG
msg
;
hwnd
=
CreateWindowA
(
"Test
WindowClass"
,
"PeekMessage3"
,
WS_OVERLAPPEDWINDOW
,
parent_hwnd
=
CreateWindowA
(
"Simple
WindowClass"
,
"PeekMessage3"
,
WS_OVERLAPPEDWINDOW
,
10
,
10
,
800
,
800
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
parent_hwnd
!=
NULL
,
"expected parent_hwnd != NULL
\n
"
);
hwnd
=
CreateWindowA
(
"TestWindowClass"
,
"PeekMessage3"
,
WS_CHILD
,
0
,
0
,
1
,
1
,
parent_hwnd
,
NULL
,
NULL
,
NULL
);
ok
(
hwnd
!=
NULL
,
"expected hwnd != NULL
\n
"
);
flush_events
();
/* GetMessage() and PeekMessage(..., PM_REMOVE) should prefer messages which
* were already seen. */
SetTimer
(
hwnd
,
1
,
100
,
NULL
);
while
(
!
PeekMessageA
(
&
msg
,
NULL
,
0
,
0
,
PM_NOREMOVE
));
while
(
!
PeekMessageA
(
&
msg
,
hwnd
,
0
,
0
,
PM_NOREMOVE
));
ok
(
msg
.
message
==
WM_TIMER
,
"msg.message = %u instead of WM_TIMER
\n
"
,
msg
.
message
);
PostMessageA
(
hwnd
,
WM_USER
,
0
,
0
);
ret
=
PeekMessageA
(
&
msg
,
NULL
,
0
,
0
,
PM_NOREMOVE
);
ret
=
PeekMessageA
(
&
msg
,
hwnd
,
0
,
0
,
PM_NOREMOVE
);
todo_wine
ok
(
ret
&&
msg
.
message
==
WM_TIMER
,
"msg.message = %u instead of WM_TIMER
\n
"
,
msg
.
message
);
ret
=
GetMessageA
(
&
msg
,
NULL
,
0
,
0
);
ret
=
GetMessageA
(
&
msg
,
hwnd
,
0
,
0
);
todo_wine
ok
(
ret
&&
msg
.
message
==
WM_TIMER
,
"msg.message = %u instead of WM_TIMER
\n
"
,
msg
.
message
);
ret
=
GetMessageA
(
&
msg
,
NULL
,
0
,
0
);
ret
=
GetMessageA
(
&
msg
,
hwnd
,
0
,
0
);
todo_wine
ok
(
ret
&&
msg
.
message
==
WM_USER
,
"msg.message = %u instead of WM_USER
\n
"
,
msg
.
message
);
ret
=
PeekMessageA
(
&
msg
,
NULL
,
0
,
0
,
0
);
ret
=
PeekMessageA
(
&
msg
,
hwnd
,
0
,
0
,
0
);
ok
(
!
ret
,
"expected PeekMessage to return FALSE, got %u
\n
"
,
ret
);
SetTimer
(
hwnd
,
1
,
100
,
NULL
);
while
(
!
PeekMessageA
(
&
msg
,
NULL
,
0
,
0
,
PM_NOREMOVE
));
while
(
!
PeekMessageA
(
&
msg
,
hwnd
,
0
,
0
,
PM_NOREMOVE
));
ok
(
msg
.
message
==
WM_TIMER
,
"msg.message = %u instead of WM_TIMER
\n
"
,
msg
.
message
);
PostMessageA
(
hwnd
,
WM_USER
,
0
,
0
);
ret
=
PeekMessageA
(
&
msg
,
NULL
,
0
,
0
,
PM_REMOVE
);
ret
=
PeekMessageA
(
&
msg
,
hwnd
,
0
,
0
,
PM_REMOVE
);
todo_wine
ok
(
ret
&&
msg
.
message
==
WM_TIMER
,
"msg.message = %u instead of WM_TIMER
\n
"
,
msg
.
message
);
ret
=
PeekMessageA
(
&
msg
,
NULL
,
0
,
0
,
PM_REMOVE
);
ret
=
PeekMessageA
(
&
msg
,
hwnd
,
0
,
0
,
PM_REMOVE
);
todo_wine
ok
(
ret
&&
msg
.
message
==
WM_USER
,
"msg.message = %u instead of WM_USER
\n
"
,
msg
.
message
);
ret
=
PeekMessageA
(
&
msg
,
NULL
,
0
,
0
,
0
);
ret
=
PeekMessageA
(
&
msg
,
hwnd
,
0
,
0
,
0
);
ok
(
!
ret
,
"expected PeekMessage to return FALSE, got %u
\n
"
,
ret
);
/* It doesn't matter if a message range is specified or not. */
SetTimer
(
hwnd
,
1
,
100
,
NULL
);
while
(
!
PeekMessageA
(
&
msg
,
NULL
,
WM_TIMER
,
WM_TIMER
,
PM_NOREMOVE
));
while
(
!
PeekMessageA
(
&
msg
,
hwnd
,
WM_TIMER
,
WM_TIMER
,
PM_NOREMOVE
));
ok
(
msg
.
message
==
WM_TIMER
,
"msg.message = %u instead of WM_TIMER
\n
"
,
msg
.
message
);
PostMessageA
(
hwnd
,
WM_USER
,
0
,
0
);
ret
=
GetMessageA
(
&
msg
,
NULL
,
0
,
0
);
ret
=
GetMessageA
(
&
msg
,
hwnd
,
0
,
0
);
todo_wine
ok
(
ret
&&
msg
.
message
==
WM_TIMER
,
"msg.message = %u instead of WM_TIMER
\n
"
,
msg
.
message
);
ret
=
GetMessageA
(
&
msg
,
NULL
,
0
,
0
);
ret
=
GetMessageA
(
&
msg
,
hwnd
,
0
,
0
);
todo_wine
ok
(
ret
&&
msg
.
message
==
WM_USER
,
"msg.message = %u instead of WM_USER
\n
"
,
msg
.
message
);
ret
=
PeekMessageA
(
&
msg
,
NULL
,
0
,
0
,
0
);
ret
=
PeekMessageA
(
&
msg
,
hwnd
,
0
,
0
,
0
);
ok
(
!
ret
,
"expected PeekMessage to return FALSE, got %u
\n
"
,
ret
);
/* But not if the post messages were added before the PeekMessage() call. */
PostMessageA
(
hwnd
,
WM_USER
,
0
,
0
);
SetTimer
(
hwnd
,
1
,
100
,
NULL
);
while
(
!
PeekMessageA
(
&
msg
,
NULL
,
WM_TIMER
,
WM_TIMER
,
PM_NOREMOVE
));
while
(
!
PeekMessageA
(
&
msg
,
hwnd
,
WM_TIMER
,
WM_TIMER
,
PM_NOREMOVE
));
ok
(
msg
.
message
==
WM_TIMER
,
"msg.message = %u instead of WM_TIMER
\n
"
,
msg
.
message
);
ret
=
GetMessageA
(
&
msg
,
NULL
,
0
,
0
);
ret
=
GetMessageA
(
&
msg
,
hwnd
,
0
,
0
);
ok
(
ret
&&
msg
.
message
==
WM_USER
,
"msg.message = %u instead of WM_USER
\n
"
,
msg
.
message
);
ret
=
GetMessageA
(
&
msg
,
NULL
,
0
,
0
);
ret
=
GetMessageA
(
&
msg
,
hwnd
,
0
,
0
);
ok
(
ret
&&
msg
.
message
==
WM_TIMER
,
"msg.message = %u instead of WM_TIMER
\n
"
,
msg
.
message
);
ret
=
PeekMessageA
(
&
msg
,
NULL
,
0
,
0
,
0
);
ret
=
PeekMessageA
(
&
msg
,
hwnd
,
0
,
0
,
0
);
ok
(
!
ret
,
"expected PeekMessage to return FALSE, got %u
\n
"
,
ret
);
/* More complicated test with multiple messages. */
PostMessageA
(
hwnd
,
WM_USER
,
0
,
0
);
SetTimer
(
hwnd
,
1
,
100
,
NULL
);
while
(
!
PeekMessageA
(
&
msg
,
NULL
,
WM_TIMER
,
WM_TIMER
,
PM_NOREMOVE
));
while
(
!
PeekMessageA
(
&
msg
,
hwnd
,
WM_TIMER
,
WM_TIMER
,
PM_NOREMOVE
));
ok
(
msg
.
message
==
WM_TIMER
,
"msg.message = %u instead of WM_TIMER
\n
"
,
msg
.
message
);
PostMessageA
(
hwnd
,
WM_USER
+
1
,
0
,
0
);
ret
=
GetMessageA
(
&
msg
,
NULL
,
0
,
0
);
ret
=
GetMessageA
(
&
msg
,
hwnd
,
0
,
0
);
ok
(
ret
&&
msg
.
message
==
WM_USER
,
"msg.message = %u instead of WM_USER
\n
"
,
msg
.
message
);
ret
=
GetMessageA
(
&
msg
,
NULL
,
0
,
0
);
ret
=
GetMessageA
(
&
msg
,
hwnd
,
0
,
0
);
todo_wine
ok
(
ret
&&
msg
.
message
==
WM_TIMER
,
"msg.message = %u instead of WM_TIMER
\n
"
,
msg
.
message
);
ret
=
GetMessageA
(
&
msg
,
NULL
,
0
,
0
);
ret
=
GetMessageA
(
&
msg
,
hwnd
,
0
,
0
);
todo_wine
ok
(
ret
&&
msg
.
message
==
WM_USER
+
1
,
"msg.message = %u instead of WM_USER + 1
\n
"
,
msg
.
message
);
ret
=
PeekMessageA
(
&
msg
,
NULL
,
0
,
0
,
0
);
ret
=
PeekMessageA
(
&
msg
,
hwnd
,
0
,
0
,
0
);
ok
(
!
ret
,
"expected PeekMessage to return FALSE, got %u
\n
"
,
ret
);
/* Also works for posted messages, but the situation is a bit different,
* because both messages are in the same queue. */
PostMessageA
(
hwnd
,
WM_TIMER
,
0
,
0
);
while
(
!
PeekMessageA
(
&
msg
,
NULL
,
WM_TIMER
,
WM_TIMER
,
PM_NOREMOVE
));
while
(
!
PeekMessageA
(
&
msg
,
hwnd
,
WM_TIMER
,
WM_TIMER
,
PM_NOREMOVE
));
ok
(
msg
.
message
==
WM_TIMER
,
"msg.message = %u instead of WM_TIMER
\n
"
,
msg
.
message
);
PostMessageA
(
hwnd
,
WM_USER
,
0
,
0
);
ret
=
GetMessageA
(
&
msg
,
NULL
,
0
,
0
);
ret
=
GetMessageA
(
&
msg
,
hwnd
,
0
,
0
);
ok
(
ret
&&
msg
.
message
==
WM_TIMER
,
"msg.message = %u instead of WM_TIMER
\n
"
,
msg
.
message
);
ret
=
GetMessageA
(
&
msg
,
NULL
,
0
,
0
);
ret
=
GetMessageA
(
&
msg
,
hwnd
,
0
,
0
);
ok
(
ret
&&
msg
.
message
==
WM_USER
,
"msg.message = %u instead of WM_USER
\n
"
,
msg
.
message
);
ret
=
PeekMessageA
(
&
msg
,
NULL
,
0
,
0
,
0
);
ret
=
PeekMessageA
(
&
msg
,
hwnd
,
0
,
0
,
0
);
ok
(
!
ret
,
"expected PeekMessage to return FALSE, got %u
\n
"
,
ret
);
PostMessageA
(
hwnd
,
WM_USER
,
0
,
0
);
PostMessageA
(
hwnd
,
WM_TIMER
,
0
,
0
);
while
(
!
PeekMessageA
(
&
msg
,
NULL
,
WM_TIMER
,
WM_TIMER
,
PM_NOREMOVE
));
while
(
!
PeekMessageA
(
&
msg
,
hwnd
,
WM_TIMER
,
WM_TIMER
,
PM_NOREMOVE
));
ok
(
msg
.
message
==
WM_TIMER
,
"msg.message = %u instead of WM_TIMER
\n
"
,
msg
.
message
);
ret
=
GetMessageA
(
&
msg
,
NULL
,
0
,
0
);
ret
=
GetMessageA
(
&
msg
,
hwnd
,
0
,
0
);
ok
(
ret
&&
msg
.
message
==
WM_USER
,
"msg.message = %u instead of WM_USER
\n
"
,
msg
.
message
);
ret
=
GetMessageA
(
&
msg
,
NULL
,
0
,
0
);
ret
=
GetMessageA
(
&
msg
,
hwnd
,
0
,
0
);
ok
(
ret
&&
msg
.
message
==
WM_TIMER
,
"msg.message = %u instead of WM_TIMER
\n
"
,
msg
.
message
);
ret
=
PeekMessageA
(
&
msg
,
NULL
,
0
,
0
,
0
);
ret
=
PeekMessageA
(
&
msg
,
hwnd
,
0
,
0
,
0
);
ok
(
!
ret
,
"expected PeekMessage to return FALSE, got %u
\n
"
,
ret
);
DestroyWindow
(
hwnd
);
DestroyWindow
(
parent_
hwnd
);
flush_events
();
}
...
...
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