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
6632d2c4
Commit
6632d2c4
authored
Nov 04, 2010
by
Henri Verbeet
Committed by
Alexandre Julliard
Nov 04, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d8/tests: Check for multiple expected messages in test_wndproc().
parent
4c4a4145
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
52 additions
and
11 deletions
+52
-11
device.c
dlls/d3d8/tests/device.c
+52
-11
No files found.
dlls/d3d8/tests/device.c
View file @
6632d2c4
...
...
@@ -1520,11 +1520,21 @@ cleanup:
}
static
HWND
filter_messages
;
static
struct
enum
message_window
{
DEVICE_WINDOW
,
FOCUS_WINDOW
,
};
struct
message
{
HWND
window
;
UINT
message
;
}
expect_message
;
enum
message_window
window
;
};
static
const
struct
message
*
expect_messages
;
static
HWND
device_window
,
focus_window
;
struct
wndproc_thread_param
{
...
...
@@ -1541,7 +1551,27 @@ static LRESULT CALLBACK test_proc(HWND hwnd, UINT message, WPARAM wparam, LPARAM
todo_wine
ok
(
0
,
"Received unexpected message %#x for window %p.
\n
"
,
message
,
hwnd
);
}
if
(
expect_message
.
window
==
hwnd
&&
expect_message
.
message
==
message
)
expect_message
.
message
=
0
;
if
(
expect_messages
)
{
HWND
w
;
switch
(
expect_messages
->
window
)
{
case
DEVICE_WINDOW
:
w
=
device_window
;
break
;
case
FOCUS_WINDOW
:
w
=
focus_window
;
break
;
default:
w
=
NULL
;
break
;
};
if
(
hwnd
==
w
&&
expect_messages
->
message
==
message
)
++
expect_messages
;
}
return
DefWindowProcA
(
hwnd
,
message
,
wparam
,
lparam
);
}
...
...
@@ -1580,7 +1610,6 @@ static DWORD WINAPI wndproc_thread(void *param)
static
void
test_wndproc
(
void
)
{
struct
wndproc_thread_param
thread_params
;
HWND
device_window
,
focus_window
,
tmp
;
IDirect3DDevice8
*
device
;
WNDCLASSA
wc
=
{
0
};
IDirect3D8
*
d3d8
;
...
...
@@ -1588,6 +1617,17 @@ static void test_wndproc(void)
LONG_PTR
proc
;
ULONG
ref
;
DWORD
res
,
tid
;
HWND
tmp
;
static
const
struct
message
messages
[]
=
{
{
WM_ACTIVATE
,
FOCUS_WINDOW
},
{
WM_SETFOCUS
,
FOCUS_WINDOW
},
{
WM_WINDOWPOSCHANGING
,
DEVICE_WINDOW
},
{
WM_MOVE
,
DEVICE_WINDOW
},
{
WM_SIZE
,
DEVICE_WINDOW
},
{
0
,
0
},
};
if
(
!
(
d3d8
=
pDirect3DCreate8
(
D3D_SDK_VERSION
)))
{
...
...
@@ -1630,11 +1670,10 @@ static void test_wndproc(void)
ok
(
tmp
==
thread_params
.
dummy_window
,
"Expected foreground window %p, got %p.
\n
"
,
thread_params
.
dummy_window
,
tmp
);
expect_message
.
window
=
focus_window
;
expect_message
.
message
=
WM_SETFOCUS
;
flush_events
();
expect_messages
=
messages
;
device
=
create_device
(
d3d8
,
device_window
,
focus_window
,
FALSE
);
if
(
!
device
)
{
...
...
@@ -1642,8 +1681,10 @@ static void test_wndproc(void)
goto
done
;
}
ok
(
!
expect_message
.
message
,
"Expected message %#x for window %p, but didn't receive it.
\n
"
,
expect_message
.
message
,
expect_message
.
window
);
ok
(
!
expect_messages
->
message
,
"Expected message %#x for window %#x, but didn't receive it.
\n
"
,
expect_messages
->
message
,
expect_messages
->
window
);
expect_messages
=
NULL
;
if
(
0
)
/* Disabled until we can make this work in a reliable way on Wine. */
{
tmp
=
GetFocus
();
...
...
@@ -1717,7 +1758,6 @@ done:
static
void
test_wndproc_windowed
(
void
)
{
struct
wndproc_thread_param
thread_params
;
HWND
device_window
,
focus_window
,
tmp
;
IDirect3DDevice8
*
device
;
WNDCLASSA
wc
=
{
0
};
IDirect3D8
*
d3d8
;
...
...
@@ -1726,6 +1766,7 @@ static void test_wndproc_windowed(void)
HRESULT
hr
;
ULONG
ref
;
DWORD
res
,
tid
;
HWND
tmp
;
if
(
!
(
d3d8
=
pDirect3DCreate8
(
D3D_SDK_VERSION
)))
{
...
...
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