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
7b44caa7
Commit
7b44caa7
authored
May 02, 2011
by
Henri Verbeet
Committed by
Alexandre Julliard
May 03, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d8/tests: Add a test for window styles on device creation.
parent
65272a4f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
75 additions
and
0 deletions
+75
-0
device.c
dlls/d3d8/tests/device.c
+75
-0
No files found.
dlls/d3d8/tests/device.c
View file @
7b44caa7
...
...
@@ -2182,6 +2182,80 @@ cleanup:
DestroyWindow
(
hwnd
);
}
static
void
test_window_style
(
void
)
{
RECT
focus_rect
,
fullscreen_rect
,
r
;
LONG
device_style
,
device_exstyle
;
LONG
focus_style
,
focus_exstyle
;
LONG
style
,
expected_style
;
IDirect3DDevice8
*
device
;
IDirect3D8
*
d3d8
;
ULONG
ref
;
if
(
!
(
d3d8
=
pDirect3DCreate8
(
D3D_SDK_VERSION
)))
{
skip
(
"Failed to create IDirect3D8 object, skipping tests.
\n
"
);
return
;
}
focus_window
=
CreateWindowA
(
"d3d8_test_wc"
,
"d3d8_test"
,
WS_OVERLAPPEDWINDOW
,
0
,
0
,
screen_width
/
2
,
screen_height
/
2
,
0
,
0
,
0
,
0
);
device_window
=
CreateWindowA
(
"d3d8_test_wc"
,
"d3d8_test"
,
WS_OVERLAPPEDWINDOW
,
0
,
0
,
screen_width
/
2
,
screen_height
/
2
,
0
,
0
,
0
,
0
);
device_style
=
GetWindowLongA
(
device_window
,
GWL_STYLE
);
device_exstyle
=
GetWindowLongA
(
device_window
,
GWL_EXSTYLE
);
focus_style
=
GetWindowLongA
(
focus_window
,
GWL_STYLE
);
focus_exstyle
=
GetWindowLongA
(
focus_window
,
GWL_EXSTYLE
);
SetRect
(
&
fullscreen_rect
,
0
,
0
,
screen_width
,
screen_height
);
GetWindowRect
(
focus_window
,
&
focus_rect
);
device
=
create_device
(
d3d8
,
device_window
,
focus_window
,
FALSE
);
if
(
!
device
)
{
skip
(
"Failed to create a D3D device, skipping tests.
\n
"
);
goto
done
;
}
style
=
GetWindowLongA
(
device_window
,
GWL_STYLE
);
expected_style
=
device_style
|
WS_VISIBLE
;
todo_wine
ok
(
style
==
expected_style
,
"Expected device window style %#x, got %#x.
\n
"
,
expected_style
,
style
);
style
=
GetWindowLongA
(
device_window
,
GWL_EXSTYLE
);
expected_style
=
device_exstyle
|
WS_EX_TOPMOST
;
todo_wine
ok
(
style
==
expected_style
,
"Expected device window extended style %#x, got %#x.
\n
"
,
expected_style
,
style
);
style
=
GetWindowLongA
(
focus_window
,
GWL_STYLE
);
ok
(
style
==
focus_style
,
"Expected focus window style %#x, got %#x.
\n
"
,
focus_style
,
style
);
style
=
GetWindowLongA
(
focus_window
,
GWL_EXSTYLE
);
ok
(
style
==
focus_exstyle
,
"Expected focus window extended style %#x, got %#x.
\n
"
,
focus_exstyle
,
style
);
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
);
GetClientRect
(
device_window
,
&
r
);
todo_wine
ok
(
!
EqualRect
(
&
r
,
&
fullscreen_rect
),
"Client rect and window rect are equal.
\n
"
);
GetWindowRect
(
focus_window
,
&
r
);
ok
(
EqualRect
(
&
r
,
&
focus_rect
),
"Expected {%d, %d, %d, %d}, got {%d, %d, %d, %d}.
\n
"
,
focus_rect
.
left
,
focus_rect
.
top
,
focus_rect
.
right
,
focus_rect
.
bottom
,
r
.
left
,
r
.
top
,
r
.
right
,
r
.
bottom
);
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
);
}
START_TEST
(
device
)
{
HMODULE
d3d8_handle
=
LoadLibraryA
(
"d3d8.dll"
);
...
...
@@ -2230,6 +2304,7 @@ START_TEST(device)
test_wndproc
();
test_wndproc_windowed
();
test_depth_stencil_size
();
test_window_style
();
}
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