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
5582e1c9
Commit
5582e1c9
authored
May 30, 2012
by
Henri Verbeet
Committed by
Alexandre Julliard
May 30, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw/tests: Move test_redundant_mode_set() to ddraw7.c.
parent
1a93983b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
54 additions
and
61 deletions
+54
-61
d3d.c
dlls/ddraw/tests/d3d.c
+0
-61
ddraw7.c
dlls/ddraw/tests/ddraw7.c
+54
-0
No files found.
dlls/ddraw/tests/d3d.c
View file @
5582e1c9
...
...
@@ -3527,66 +3527,6 @@ static void BackBuffer3DAttachmentTest(void)
DestroyWindow
(
window
);
}
static
void
test_redundant_mode_set
(
void
)
{
DDSURFACEDESC2
surface_desc
=
{
0
};
IDirectDraw7
*
ddraw7
;
HWND
window
;
HRESULT
hr
;
RECT
r
,
s
;
ULONG
ref
;
hr
=
pDirectDrawCreateEx
(
NULL
,
(
void
**
)
&
ddraw7
,
&
IID_IDirectDraw7
,
NULL
);
if
(
FAILED
(
hr
))
{
skip
(
"Failed to create IDirectDraw7 object (%#x), skipping tests.
\n
"
,
hr
);
return
;
}
window
=
CreateWindowA
(
"static"
,
"d3d7_test"
,
WS_OVERLAPPEDWINDOW
,
0
,
0
,
100
,
100
,
0
,
0
,
0
,
0
);
hr
=
IDirectDraw7_SetCooperativeLevel
(
ddraw7
,
window
,
DDSCL_EXCLUSIVE
|
DDSCL_FULLSCREEN
);
ok
(
SUCCEEDED
(
hr
),
"SetCooperativeLevel failed, hr %#x.
\n
"
,
hr
);
if
(
FAILED
(
hr
))
{
IDirectDraw7_Release
(
ddraw7
);
DestroyWindow
(
window
);
return
;
}
surface_desc
.
dwSize
=
sizeof
(
surface_desc
);
hr
=
IDirectDraw7_GetDisplayMode
(
ddraw7
,
&
surface_desc
);
ok
(
SUCCEEDED
(
hr
),
"GetDipslayMode failed, hr %#x.
\n
"
,
hr
);
hr
=
IDirectDraw7_SetDisplayMode
(
ddraw7
,
surface_desc
.
dwWidth
,
surface_desc
.
dwHeight
,
U1
(
U4
(
surface_desc
).
ddpfPixelFormat
).
dwRGBBitCount
,
0
,
0
);
ok
(
SUCCEEDED
(
hr
),
"SetDipslayMode failed, hr %#x.
\n
"
,
hr
);
GetWindowRect
(
window
,
&
r
);
r
.
right
/=
2
;
r
.
bottom
/=
2
;
SetWindowPos
(
window
,
HWND_TOP
,
r
.
left
,
r
.
top
,
r
.
right
,
r
.
bottom
,
0
);
GetWindowRect
(
window
,
&
s
);
ok
(
EqualRect
(
&
r
,
&
s
),
"Expected {%d, %d, %d, %d}, got {%d, %d, %d, %d}.
\n
"
,
r
.
left
,
r
.
top
,
r
.
right
,
r
.
bottom
,
s
.
left
,
s
.
top
,
s
.
right
,
s
.
bottom
);
hr
=
IDirectDraw7_SetDisplayMode
(
ddraw7
,
surface_desc
.
dwWidth
,
surface_desc
.
dwHeight
,
U1
(
U4
(
surface_desc
).
ddpfPixelFormat
).
dwRGBBitCount
,
0
,
0
);
ok
(
SUCCEEDED
(
hr
),
"SetDipslayMode failed, hr %#x.
\n
"
,
hr
);
GetWindowRect
(
window
,
&
s
);
ok
(
EqualRect
(
&
r
,
&
s
),
"Expected {%d, %d, %d, %d}, got {%d, %d, %d, %d}.
\n
"
,
r
.
left
,
r
.
top
,
r
.
right
,
r
.
bottom
,
s
.
left
,
s
.
top
,
s
.
right
,
s
.
bottom
);
ref
=
IDirectDraw7_Release
(
ddraw7
);
ok
(
ref
==
0
,
"The ddraw object was not properly freed: refcount %u.
\n
"
,
ref
);
DestroyWindow
(
window
);
}
static
SIZE
screen_size
;
static
LRESULT
CALLBACK
mode_set_proc
(
HWND
hwnd
,
UINT
message
,
WPARAM
wparam
,
LPARAM
lparam
)
...
...
@@ -4690,7 +4630,6 @@ START_TEST(d3d)
D3D1_releaseObjects
();
}
test_redundant_mode_set
();
test_coop_level_mode_set
();
test_initialize
();
test_coop_level_surf_create
();
...
...
dlls/ddraw/tests/ddraw7.c
View file @
5582e1c9
...
...
@@ -1947,6 +1947,59 @@ static void test_window_style(void)
DestroyWindow
(
window
);
}
static
void
test_redundant_mode_set
(
void
)
{
DDSURFACEDESC2
surface_desc
=
{
0
};
IDirectDraw7
*
ddraw
;
HWND
window
;
HRESULT
hr
;
RECT
r
,
s
;
ULONG
ref
;
window
=
CreateWindowA
(
"static"
,
"ddraw_test"
,
WS_OVERLAPPEDWINDOW
,
0
,
0
,
100
,
100
,
0
,
0
,
0
,
0
);
if
(
!
(
ddraw
=
create_ddraw
()))
{
skip
(
"Failed to create a ddraw object, skipping test.
\n
"
);
DestroyWindow
(
window
);
return
;
}
hr
=
IDirectDraw7_SetCooperativeLevel
(
ddraw
,
window
,
DDSCL_EXCLUSIVE
|
DDSCL_FULLSCREEN
);
ok
(
SUCCEEDED
(
hr
),
"SetCooperativeLevel failed, hr %#x.
\n
"
,
hr
);
surface_desc
.
dwSize
=
sizeof
(
surface_desc
);
hr
=
IDirectDraw7_GetDisplayMode
(
ddraw
,
&
surface_desc
);
ok
(
SUCCEEDED
(
hr
),
"GetDipslayMode failed, hr %#x.
\n
"
,
hr
);
hr
=
IDirectDraw7_SetDisplayMode
(
ddraw
,
surface_desc
.
dwWidth
,
surface_desc
.
dwHeight
,
U1
(
U4
(
surface_desc
).
ddpfPixelFormat
).
dwRGBBitCount
,
0
,
0
);
ok
(
SUCCEEDED
(
hr
),
"SetDipslayMode failed, hr %#x.
\n
"
,
hr
);
GetWindowRect
(
window
,
&
r
);
r
.
right
/=
2
;
r
.
bottom
/=
2
;
SetWindowPos
(
window
,
HWND_TOP
,
r
.
left
,
r
.
top
,
r
.
right
,
r
.
bottom
,
0
);
GetWindowRect
(
window
,
&
s
);
ok
(
EqualRect
(
&
r
,
&
s
),
"Expected {%d, %d, %d, %d}, got {%d, %d, %d, %d}.
\n
"
,
r
.
left
,
r
.
top
,
r
.
right
,
r
.
bottom
,
s
.
left
,
s
.
top
,
s
.
right
,
s
.
bottom
);
hr
=
IDirectDraw7_SetDisplayMode
(
ddraw
,
surface_desc
.
dwWidth
,
surface_desc
.
dwHeight
,
U1
(
U4
(
surface_desc
).
ddpfPixelFormat
).
dwRGBBitCount
,
0
,
0
);
ok
(
SUCCEEDED
(
hr
),
"SetDipslayMode failed, hr %#x.
\n
"
,
hr
);
GetWindowRect
(
window
,
&
s
);
ok
(
EqualRect
(
&
r
,
&
s
),
"Expected {%d, %d, %d, %d}, got {%d, %d, %d, %d}.
\n
"
,
r
.
left
,
r
.
top
,
r
.
right
,
r
.
bottom
,
s
.
left
,
s
.
top
,
s
.
right
,
s
.
bottom
);
ref
=
IDirectDraw7_Release
(
ddraw
);
ok
(
ref
==
0
,
"The ddraw object was not properly freed: refcount %u.
\n
"
,
ref
);
DestroyWindow
(
window
);
}
START_TEST
(
ddraw7
)
{
HMODULE
module
=
GetModuleHandleA
(
"ddraw.dll"
);
...
...
@@ -1972,4 +2025,5 @@ START_TEST(ddraw7)
test_device_qi
();
test_wndproc
();
test_window_style
();
test_redundant_mode_set
();
}
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