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
6b0d878f
Commit
6b0d878f
authored
Feb 29, 2012
by
Henri Verbeet
Committed by
Alexandre Julliard
Feb 29, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d8/tests: Add some tests for resetting the device window.
parent
90739d94
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
88 additions
and
0 deletions
+88
-0
device.c
dlls/d3d8/tests/device.c
+88
-0
No files found.
dlls/d3d8/tests/device.c
View file @
6b0d878f
...
...
@@ -3004,6 +3004,93 @@ done:
ok
(
devmode
.
dmPelsHeight
==
screen_height
,
"Got unexpect height %u.
\n
"
,
devmode
.
dmPelsHeight
);
}
static
void
test_device_window_reset
(
void
)
{
RECT
fullscreen_rect
,
device_rect
,
r
;
IDirect3DDevice8
*
device
;
WNDCLASSA
wc
=
{
0
};
IDirect3D8
*
d3d8
;
LONG_PTR
proc
;
HRESULT
hr
;
ULONG
ref
;
if
(
!
(
d3d8
=
pDirect3DCreate8
(
D3D_SDK_VERSION
)))
{
skip
(
"Failed to create IDirect3D8 object, skipping tests.
\n
"
);
return
;
}
wc
.
lpfnWndProc
=
test_proc
;
wc
.
lpszClassName
=
"d3d8_test_wndproc_wc"
;
ok
(
RegisterClassA
(
&
wc
),
"Failed to register window class.
\n
"
);
focus_window
=
CreateWindowA
(
"d3d8_test_wndproc_wc"
,
"d3d8_test"
,
WS_OVERLAPPEDWINDOW
,
0
,
0
,
screen_width
/
2
,
screen_height
/
2
,
0
,
0
,
0
,
0
);
device_window
=
CreateWindowA
(
"d3d8_test_wndproc_wc"
,
"d3d8_test"
,
WS_OVERLAPPEDWINDOW
,
0
,
0
,
screen_width
/
2
,
screen_height
/
2
,
0
,
0
,
0
,
0
);
SetRect
(
&
fullscreen_rect
,
0
,
0
,
screen_width
,
screen_height
);
GetWindowRect
(
device_window
,
&
device_rect
);
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
);
device
=
create_device
(
d3d8
,
NULL
,
focus_window
,
FALSE
);
if
(
!
device
)
{
skip
(
"Failed to create a D3D device, skipping tests.
\n
"
);
goto
done
;
}
GetWindowRect
(
focus_window
,
&
r
);
ok
(
EqualRect
(
&
r
,
&
fullscreen_rect
),
"Expected {%d, %d, %d, %d}, got {%d, %d, %d, %d}.
\n
"
,
fullscreen_rect
.
left
,
fullscreen_rect
.
top
,
fullscreen_rect
.
right
,
fullscreen_rect
.
bottom
,
r
.
left
,
r
.
top
,
r
.
right
,
r
.
bottom
);
GetWindowRect
(
device_window
,
&
r
);
ok
(
EqualRect
(
&
r
,
&
device_rect
),
"Expected {%d, %d, %d, %d}, got {%d, %d, %d, %d}.
\n
"
,
device_rect
.
left
,
device_rect
.
top
,
device_rect
.
right
,
device_rect
.
bottom
,
r
.
left
,
r
.
top
,
r
.
right
,
r
.
bottom
);
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
,
FALSE
);
ok
(
SUCCEEDED
(
hr
),
"Failed to reset device.
\n
"
);
GetWindowRect
(
focus_window
,
&
r
);
ok
(
EqualRect
(
&
r
,
&
fullscreen_rect
),
"Expected {%d, %d, %d, %d}, got {%d, %d, %d, %d}.
\n
"
,
fullscreen_rect
.
left
,
fullscreen_rect
.
top
,
fullscreen_rect
.
right
,
fullscreen_rect
.
bottom
,
r
.
left
,
r
.
top
,
r
.
right
,
r
.
bottom
);
GetWindowRect
(
device_window
,
&
r
);
ok
(
EqualRect
(
&
r
,
&
fullscreen_rect
),
"Expected {%d, %d, %d, %d}, got {%d, %d, %d, %d}.
\n
"
,
fullscreen_rect
.
left
,
fullscreen_rect
.
top
,
fullscreen_rect
.
right
,
fullscreen_rect
.
bottom
,
r
.
left
,
r
.
top
,
r
.
right
,
r
.
bottom
);
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
);
ref
=
IDirect3DDevice8_Release
(
device
);
ok
(
ref
==
0
,
"The device was not properly freed: refcount %u.
\n
"
,
ref
);
done:
IDirect3D8_Release
(
d3d8
);
DestroyWindow
(
device_window
);
DestroyWindow
(
focus_window
);
UnregisterClassA
(
"d3d8_test_wndproc_wc"
,
GetModuleHandleA
(
NULL
));
}
START_TEST
(
device
)
{
HMODULE
d3d8_handle
=
LoadLibraryA
(
"d3d8.dll"
);
...
...
@@ -3057,6 +3144,7 @@ START_TEST(device)
test_window_style
();
test_wrong_shader
();
test_mode_change
();
test_device_window_reset
();
}
UnregisterClassA
(
"d3d8_test_wc"
,
GetModuleHandleA
(
NULL
));
}
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