Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
d6160213
Commit
d6160213
authored
Aug 02, 2017
by
Henri Verbeet
Committed by
Alexandre Julliard
Aug 02, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d8/tests: Introduce a test for drawing with a destroyed window.
Signed-off-by:
Henri Verbeet
<
hverbeet@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
f7e37715
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
0 deletions
+38
-0
device.c
dlls/d3d8/tests/device.c
+38
-0
No files found.
dlls/d3d8/tests/device.c
View file @
d6160213
...
@@ -8277,6 +8277,43 @@ static void test_format_unknown(void)
...
@@ -8277,6 +8277,43 @@ static void test_format_unknown(void)
DestroyWindow
(
window
);
DestroyWindow
(
window
);
}
}
static
void
test_destroyed_window
(
void
)
{
IDirect3DDevice8
*
device
;
IDirect3D8
*
d3d8
;
ULONG
refcount
;
HWND
window
;
HRESULT
hr
;
/* No WS_VISIBLE. */
window
=
CreateWindowA
(
"static"
,
"d3d8_test"
,
WS_OVERLAPPEDWINDOW
,
0
,
0
,
640
,
480
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
!!
window
,
"Failed to create a window.
\n
"
);
d3d8
=
Direct3DCreate8
(
D3D_SDK_VERSION
);
ok
(
!!
d3d8
,
"Failed to create a D3D object.
\n
"
);
device
=
create_device
(
d3d8
,
window
,
NULL
);
IDirect3D8_Release
(
d3d8
);
DestroyWindow
(
window
);
if
(
!
device
)
{
skip
(
"Failed to create a 3D device, skipping test.
\n
"
);
return
;
}
hr
=
IDirect3DDevice8_BeginScene
(
device
);
ok
(
SUCCEEDED
(
hr
),
"Failed to begin scene, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice8_Clear
(
device
,
0
,
NULL
,
D3DCLEAR_TARGET
,
0x00000000
,
0
.
0
f
,
0
);
ok
(
SUCCEEDED
(
hr
),
"Failed to clear, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice8_EndScene
(
device
);
ok
(
SUCCEEDED
(
hr
),
"Failed to end scene, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice8_Present
(
device
,
NULL
,
NULL
,
NULL
,
NULL
);
todo_wine
ok
(
hr
==
D3DERR_INVALIDCALL
,
"Got unexpected hr %#x.
\n
"
,
hr
);
refcount
=
IDirect3DDevice8_Release
(
device
);
ok
(
!
refcount
,
"Device has %u references left.
\n
"
,
refcount
);
}
START_TEST
(
device
)
START_TEST
(
device
)
{
{
HMODULE
d3d8_handle
=
LoadLibraryA
(
"d3d8.dll"
);
HMODULE
d3d8_handle
=
LoadLibraryA
(
"d3d8.dll"
);
...
@@ -8383,6 +8420,7 @@ START_TEST(device)
...
@@ -8383,6 +8420,7 @@ START_TEST(device)
test_miptree_layout
();
test_miptree_layout
();
test_render_target_device_mismatch
();
test_render_target_device_mismatch
();
test_format_unknown
();
test_format_unknown
();
test_destroyed_window
();
UnregisterClassA
(
"d3d8_test_wc"
,
GetModuleHandleA
(
NULL
));
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