Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lorenzo Ferrillo
wine
Commits
9ad6f2e1
Commit
9ad6f2e1
authored
13 years ago
by
Henri Verbeet
Committed by
Alexandre Julliard
13 years ago
Browse files
Options
Downloads
Patches
Plain Diff
d3d9/tests: Add some tests for resetting the device window.
parent
6b0d878f
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dlls/d3d9/tests/device.c
+88
-0
88 additions, 0 deletions
dlls/d3d9/tests/device.c
with
88 additions
and
0 deletions
dlls/d3d9/tests/device.c
+
88
−
0
View file @
9ad6f2e1
...
...
@@ -3338,6 +3338,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
;
IDirect3DDevice9
*
device
;
WNDCLASSA
wc
=
{
0
};
IDirect3D9
*
d3d9
;
LONG_PTR
proc
;
HRESULT
hr
;
ULONG
ref
;
if
(
!
(
d3d9
=
pDirect3DCreate9
(
D3D_SDK_VERSION
)))
{
skip
(
"Failed to create IDirect3D9 object, skipping tests.
\n
"
);
return
;
}
wc
.
lpfnWndProc
=
test_proc
;
wc
.
lpszClassName
=
"d3d9_test_wndproc_wc"
;
ok
(
RegisterClassA
(
&
wc
),
"Failed to register window class.
\n
"
);
focus_window
=
CreateWindowA
(
"d3d9_test_wndproc_wc"
,
"d3d9_test"
,
WS_OVERLAPPEDWINDOW
,
0
,
0
,
screen_width
/
2
,
screen_height
/
2
,
0
,
0
,
0
,
0
);
device_window
=
CreateWindowA
(
"d3d9_test_wndproc_wc"
,
"d3d9_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
(
d3d9
,
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
=
IDirect3DDevice9_Release
(
device
);
ok
(
ref
==
0
,
"The device was not properly freed: refcount %u.
\n
"
,
ref
);
done:
IDirect3D9_Release
(
d3d9
);
DestroyWindow
(
device_window
);
DestroyWindow
(
focus_window
);
UnregisterClassA
(
"d3d9_test_wndproc_wc"
,
GetModuleHandleA
(
NULL
));
}
START_TEST
(
device
)
{
HMODULE
d3d9_handle
=
LoadLibraryA
(
"d3d9.dll"
);
...
...
@@ -3393,6 +3480,7 @@ START_TEST(device)
test_wndproc_windowed
();
test_window_style
();
test_mode_change
();
test_device_window_reset
();
}
out:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment