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
4fa4ea73
Commit
4fa4ea73
authored
Oct 06, 2010
by
Henri Verbeet
Committed by
Alexandre Julliard
Oct 06, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d8/tests: Add window proc tests for switching between fullscreen and windowed.
parent
a59d0f45
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
95 additions
and
0 deletions
+95
-0
device.c
dlls/d3d8/tests/device.c
+95
-0
No files found.
dlls/d3d8/tests/device.c
View file @
4fa4ea73
...
...
@@ -89,6 +89,22 @@ static IDirect3DDevice8 *create_device(IDirect3D8 *d3d8, HWND device_window, HWN
return
NULL
;
}
static
HRESULT
reset_device
(
IDirect3DDevice8
*
device
,
HWND
device_window
,
BOOL
windowed
)
{
D3DPRESENT_PARAMETERS
present_parameters
=
{
0
};
present_parameters
.
Windowed
=
windowed
;
present_parameters
.
hDeviceWindow
=
device_window
;
present_parameters
.
SwapEffect
=
D3DSWAPEFFECT_DISCARD
;
present_parameters
.
BackBufferWidth
=
640
;
present_parameters
.
BackBufferHeight
=
480
;
present_parameters
.
BackBufferFormat
=
D3DFMT_A8R8G8B8
;
present_parameters
.
EnableAutoDepthStencil
=
TRUE
;
present_parameters
.
AutoDepthStencilFormat
=
D3DFMT_D24S8
;
return
IDirect3DDevice8_Reset
(
device
,
&
present_parameters
);
}
#define CHECK_CALL(r,c,d,rc) \
if (SUCCEEDED(r)) {\
int tmp1 = get_refcount( (IUnknown *)d ); \
...
...
@@ -1707,6 +1723,7 @@ static void test_wndproc_windowed(void)
IDirect3D8
*
d3d8
;
HANDLE
thread
;
LONG_PTR
proc
;
HRESULT
hr
;
ULONG
ref
;
DWORD
res
,
tid
;
...
...
@@ -1774,6 +1791,32 @@ static void test_wndproc_windowed(void)
ok
(
proc
==
(
LONG_PTR
)
test_proc
,
"Expected wndproc %#lx, got %#lx.
\n
"
,
(
LONG_PTR
)
test_proc
,
proc
);
filter_messages
=
NULL
;
hr
=
reset_device
(
device
,
device_window
,
FALSE
);
ok
(
SUCCEEDED
(
hr
),
"Failed to reset device, hr %#x.
\n
"
,
hr
);
proc
=
GetWindowLongPtrA
(
device_window
,
GWLP_WNDPROC
);
ok
(
proc
==
(
LONG_PTR
)
test_proc
,
"Expected wndproc %#lx, got %#lx.
\n
"
,
(
LONG_PTR
)
test_proc
,
proc
);
proc
=
GetWindowLongPtrA
(
focus_window
,
GWLP_WNDPROC
);
ok
(
proc
!=
(
LONG_PTR
)
test_proc
,
"Expected wndproc %#lx, got %#lx.
\n
"
,
(
LONG_PTR
)
test_proc
,
proc
);
hr
=
reset_device
(
device
,
device_window
,
TRUE
);
ok
(
SUCCEEDED
(
hr
),
"Failed to reset device, hr %#x.
\n
"
,
hr
);
proc
=
GetWindowLongPtrA
(
device_window
,
GWLP_WNDPROC
);
ok
(
proc
==
(
LONG_PTR
)
test_proc
,
"Expected wndproc %#lx, got %#lx.
\n
"
,
(
LONG_PTR
)
test_proc
,
proc
);
proc
=
GetWindowLongPtrA
(
focus_window
,
GWLP_WNDPROC
);
ok
(
proc
==
(
LONG_PTR
)
test_proc
,
"Expected wndproc %#lx, got %#lx.
\n
"
,
(
LONG_PTR
)
test_proc
,
proc
);
filter_messages
=
focus_window
;
ref
=
IDirect3DDevice8_Release
(
device
);
ok
(
ref
==
0
,
"The device was not properly freed: refcount %u.
\n
"
,
ref
);
...
...
@@ -1786,6 +1829,32 @@ static void test_wndproc_windowed(void)
goto
done
;
}
filter_messages
=
NULL
;
hr
=
reset_device
(
device
,
focus_window
,
FALSE
);
ok
(
SUCCEEDED
(
hr
),
"Failed to reset device, hr %#x.
\n
"
,
hr
);
proc
=
GetWindowLongPtrA
(
device_window
,
GWLP_WNDPROC
);
ok
(
proc
==
(
LONG_PTR
)
test_proc
,
"Expected wndproc %#lx, got %#lx.
\n
"
,
(
LONG_PTR
)
test_proc
,
proc
);
proc
=
GetWindowLongPtrA
(
focus_window
,
GWLP_WNDPROC
);
ok
(
proc
!=
(
LONG_PTR
)
test_proc
,
"Expected wndproc %#lx, got %#lx.
\n
"
,
(
LONG_PTR
)
test_proc
,
proc
);
hr
=
reset_device
(
device
,
focus_window
,
TRUE
);
ok
(
SUCCEEDED
(
hr
),
"Failed to reset device, hr %#x.
\n
"
,
hr
);
proc
=
GetWindowLongPtrA
(
device_window
,
GWLP_WNDPROC
);
ok
(
proc
==
(
LONG_PTR
)
test_proc
,
"Expected wndproc %#lx, got %#lx.
\n
"
,
(
LONG_PTR
)
test_proc
,
proc
);
proc
=
GetWindowLongPtrA
(
focus_window
,
GWLP_WNDPROC
);
ok
(
proc
==
(
LONG_PTR
)
test_proc
,
"Expected wndproc %#lx, got %#lx.
\n
"
,
(
LONG_PTR
)
test_proc
,
proc
);
filter_messages
=
device_window
;
ref
=
IDirect3DDevice8_Release
(
device
);
ok
(
ref
==
0
,
"The device was not properly freed: refcount %u.
\n
"
,
ref
);
...
...
@@ -1796,6 +1865,32 @@ static void test_wndproc_windowed(void)
goto
done
;
}
filter_messages
=
NULL
;
hr
=
reset_device
(
device
,
device_window
,
FALSE
);
ok
(
SUCCEEDED
(
hr
),
"Failed to reset device, hr %#x.
\n
"
,
hr
);
proc
=
GetWindowLongPtrA
(
device_window
,
GWLP_WNDPROC
);
ok
(
proc
==
(
LONG_PTR
)
test_proc
,
"Expected wndproc %#lx, got %#lx.
\n
"
,
(
LONG_PTR
)
test_proc
,
proc
);
proc
=
GetWindowLongPtrA
(
focus_window
,
GWLP_WNDPROC
);
ok
(
proc
!=
(
LONG_PTR
)
test_proc
,
"Expected wndproc %#lx, got %#lx.
\n
"
,
(
LONG_PTR
)
test_proc
,
proc
);
hr
=
reset_device
(
device
,
device_window
,
TRUE
);
ok
(
SUCCEEDED
(
hr
),
"Failed to reset device, hr %#x.
\n
"
,
hr
);
proc
=
GetWindowLongPtrA
(
device_window
,
GWLP_WNDPROC
);
ok
(
proc
==
(
LONG_PTR
)
test_proc
,
"Expected wndproc %#lx, got %#lx.
\n
"
,
(
LONG_PTR
)
test_proc
,
proc
);
proc
=
GetWindowLongPtrA
(
focus_window
,
GWLP_WNDPROC
);
ok
(
proc
==
(
LONG_PTR
)
test_proc
,
"Expected wndproc %#lx, got %#lx.
\n
"
,
(
LONG_PTR
)
test_proc
,
proc
);
filter_messages
=
device_window
;
ref
=
IDirect3DDevice8_Release
(
device
);
ok
(
ref
==
0
,
"The device was not properly freed: refcount %u.
\n
"
,
ref
);
...
...
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