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
99da74fe
Commit
99da74fe
authored
Sep 10, 2013
by
Stefan Dösinger
Committed by
Alexandre Julliard
Sep 10, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d8/tests: Test the behavior of failing surface creation calls.
parent
1cbdb2af
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
51 additions
and
0 deletions
+51
-0
device.c
dlls/d3d8/tests/device.c
+51
-0
No files found.
dlls/d3d8/tests/device.c
View file @
99da74fe
...
...
@@ -5320,6 +5320,56 @@ out:
IDirect3D8_Release
(
d3d8
);
DestroyWindow
(
window
);
}
static
void
test_create_rt_ds_fail
(
void
)
{
IDirect3DDevice8
*
device
;
HWND
window
;
HRESULT
hr
;
ULONG
refcount
;
IDirect3D8
*
d3d8
;
IDirect3DSurface8
*
surface
;
if
(
!
(
d3d8
=
pDirect3DCreate8
(
D3D_SDK_VERSION
)))
{
skip
(
"Failed to create IDirect3D8 object, skipping tests.
\n
"
);
return
;
}
window
=
CreateWindowA
(
"static"
,
"d3d8_test"
,
WS_OVERLAPPEDWINDOW
,
0
,
0
,
640
,
480
,
0
,
0
,
0
,
0
);
if
(
!
(
device
=
create_device
(
d3d8
,
window
,
window
,
TRUE
)))
{
skip
(
"Failed to create a D3D device, skipping tests.
\n
"
);
IDirect3D8_Release
(
d3d8
);
DestroyWindow
(
window
);
return
;
}
/* Output pointer == NULL segfaults on Windows. */
surface
=
(
IDirect3DSurface8
*
)
0xdeadbeef
;
hr
=
IDirect3DDevice8_CreateRenderTarget
(
device
,
4
,
4
,
D3DFMT_D16
,
D3DMULTISAMPLE_NONE
,
FALSE
,
&
surface
);
ok
(
hr
==
D3DERR_INVALIDCALL
,
"Creating a D16 render target returned hr %#x.
\n
"
,
hr
);
ok
(
surface
==
NULL
,
"Got pointer %p, expected NULL.
\n
"
,
surface
);
if
(
SUCCEEDED
(
hr
))
IDirect3DSurface8_Release
(
surface
);
surface
=
(
IDirect3DSurface8
*
)
0xdeadbeef
;
hr
=
IDirect3DDevice8_CreateDepthStencilSurface
(
device
,
4
,
4
,
D3DFMT_A8R8G8B8
,
D3DMULTISAMPLE_NONE
,
&
surface
);
ok
(
hr
==
D3DERR_INVALIDCALL
,
"Creating a A8R8G8B8 depth stencil returned hr %#x.
\n
"
,
hr
);
ok
(
surface
==
NULL
,
"Got pointer %p, expected NULL.
\n
"
,
surface
);
if
(
SUCCEEDED
(
hr
))
IDirect3DSurface8_Release
(
surface
);
refcount
=
IDirect3DDevice8_Release
(
device
);
ok
(
!
refcount
,
"Device has %u references left.
\n
"
,
refcount
);
IDirect3D8_Release
(
d3d8
);
DestroyWindow
(
window
);
}
START_TEST
(
device
)
{
HMODULE
d3d8_handle
=
LoadLibraryA
(
"d3d8.dll"
);
...
...
@@ -5399,6 +5449,7 @@ START_TEST(device)
test_npot_textures
();
test_volume_locking
();
test_update_volumetexture
();
test_create_rt_ds_fail
();
}
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