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
b28631f6
Commit
b28631f6
authored
Feb 09, 2017
by
Henri Verbeet
Committed by
Alexandre Julliard
Feb 09, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d9/tests: Add a test for resource creation with D3DFMT_UNKNOWN.
Signed-off-by:
Henri Verbeet
<
hverbeet@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
1b007ad3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
140 additions
and
0 deletions
+140
-0
d3d9ex.c
dlls/d3d9/tests/d3d9ex.c
+76
-0
device.c
dlls/d3d9/tests/device.c
+64
-0
No files found.
dlls/d3d9/tests/d3d9ex.c
View file @
b28631f6
...
...
@@ -3701,6 +3701,81 @@ static void test_backbuffer_resize(void)
DestroyWindow
(
window
);
}
static
void
test_format_unknown
(
void
)
{
IDirect3DDevice9Ex
*
device
;
UINT
refcount
;
HWND
window
;
void
*
iface
;
HRESULT
hr
;
window
=
create_window
();
if
(
!
(
device
=
create_device
(
window
,
NULL
)))
{
skip
(
"Failed to create a D3D device.
\n
"
);
DestroyWindow
(
window
);
return
;
}
iface
=
(
void
*
)
0xdeadbeef
;
hr
=
IDirect3DDevice9Ex_CreateRenderTarget
(
device
,
64
,
64
,
D3DFMT_UNKNOWN
,
D3DMULTISAMPLE_NONE
,
0
,
FALSE
,
(
IDirect3DSurface9
**
)
&
iface
,
NULL
);
ok
(
hr
==
D3DERR_INVALIDCALL
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
!
iface
,
"Got unexpected iface %p.
\n
"
,
iface
);
iface
=
(
void
*
)
0xdeadbeef
;
hr
=
IDirect3DDevice9Ex_CreateRenderTargetEx
(
device
,
64
,
64
,
D3DFMT_UNKNOWN
,
D3DMULTISAMPLE_NONE
,
0
,
FALSE
,
(
IDirect3DSurface9
**
)
&
iface
,
NULL
,
0
);
todo_wine
ok
(
hr
==
D3DERR_INVALIDCALL
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
!
iface
,
"Got unexpected iface %p.
\n
"
,
iface
);
iface
=
(
void
*
)
0xdeadbeef
;
hr
=
IDirect3DDevice9Ex_CreateDepthStencilSurface
(
device
,
64
,
64
,
D3DFMT_UNKNOWN
,
D3DMULTISAMPLE_NONE
,
0
,
TRUE
,
(
IDirect3DSurface9
**
)
&
iface
,
NULL
);
ok
(
hr
==
D3DERR_INVALIDCALL
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
!
iface
,
"Got unexpected iface %p.
\n
"
,
iface
);
iface
=
(
void
*
)
0xdeadbeef
;
hr
=
IDirect3DDevice9Ex_CreateDepthStencilSurfaceEx
(
device
,
64
,
64
,
D3DFMT_UNKNOWN
,
D3DMULTISAMPLE_NONE
,
0
,
TRUE
,
(
IDirect3DSurface9
**
)
&
iface
,
NULL
,
0
);
ok
(
hr
==
D3DERR_INVALIDCALL
,
"Got unexpected hr %#x.
\n
"
,
hr
);
todo_wine
ok
(
!
iface
,
"Got unexpected iface %p.
\n
"
,
iface
);
iface
=
(
void
*
)
0xdeadbeef
;
hr
=
IDirect3DDevice9Ex_CreateOffscreenPlainSurface
(
device
,
64
,
64
,
D3DFMT_UNKNOWN
,
D3DPOOL_DEFAULT
,
(
IDirect3DSurface9
**
)
&
iface
,
NULL
);
ok
(
hr
==
D3DERR_INVALIDCALL
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
!
iface
,
"Got unexpected iface %p.
\n
"
,
iface
);
iface
=
(
void
*
)
0xdeadbeef
;
hr
=
IDirect3DDevice9Ex_CreateOffscreenPlainSurfaceEx
(
device
,
64
,
64
,
D3DFMT_UNKNOWN
,
D3DPOOL_DEFAULT
,
(
IDirect3DSurface9
**
)
&
iface
,
NULL
,
9
);
todo_wine
ok
(
hr
==
D3DERR_INVALIDCALL
,
"Got unexpected hr %#x.
\n
"
,
hr
);
todo_wine
ok
(
!
iface
,
"Got unexpected iface %p.
\n
"
,
iface
);
iface
=
(
void
*
)
0xdeadbeef
;
hr
=
IDirect3DDevice9Ex_CreateTexture
(
device
,
64
,
64
,
1
,
0
,
D3DFMT_UNKNOWN
,
D3DPOOL_DEFAULT
,
(
IDirect3DTexture9
**
)
&
iface
,
NULL
);
ok
(
hr
==
D3DERR_INVALIDCALL
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
!
iface
,
"Got unexpected iface %p.
\n
"
,
iface
);
iface
=
(
void
*
)
0xdeadbeef
;
hr
=
IDirect3DDevice9Ex_CreateCubeTexture
(
device
,
64
,
1
,
0
,
D3DFMT_UNKNOWN
,
D3DPOOL_DEFAULT
,
(
IDirect3DCubeTexture9
**
)
&
iface
,
NULL
);
ok
(
hr
==
D3DERR_INVALIDCALL
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
!
iface
,
"Got unexpected iface %p.
\n
"
,
iface
);
iface
=
(
void
*
)
0xdeadbeef
;
hr
=
IDirect3DDevice9Ex_CreateVolumeTexture
(
device
,
64
,
64
,
1
,
1
,
0
,
D3DFMT_UNKNOWN
,
D3DPOOL_DEFAULT
,
(
IDirect3DVolumeTexture9
**
)
&
iface
,
NULL
);
ok
(
hr
==
D3DERR_INVALIDCALL
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
!
iface
,
"Got unexpected iface %p.
\n
"
,
iface
);
refcount
=
IDirect3DDevice9Ex_Release
(
device
);
ok
(
!
refcount
,
"Device has %u references left.
\n
"
,
refcount
);
DestroyWindow
(
window
);
}
START_TEST
(
d3d9ex
)
{
DEVMODEW
current_mode
;
...
...
@@ -3749,4 +3824,5 @@ START_TEST(d3d9ex)
test_window_style
();
test_swapchain_parameters
();
test_backbuffer_resize
();
test_format_unknown
();
}
dlls/d3d9/tests/device.c
View file @
b28631f6
...
...
@@ -11443,6 +11443,69 @@ static void test_render_target_device_mismatch(void)
DestroyWindow
(
window
);
}
static
void
test_format_unknown
(
void
)
{
IDirect3DDevice9
*
device
;
IDirect3D9
*
d3d
;
UINT
refcount
;
HWND
window
;
void
*
iface
;
HRESULT
hr
;
window
=
CreateWindowA
(
"static"
,
"d3d9_test"
,
WS_OVERLAPPEDWINDOW
,
0
,
0
,
640
,
480
,
NULL
,
NULL
,
NULL
,
NULL
);
d3d
=
Direct3DCreate9
(
D3D_SDK_VERSION
);
ok
(
!!
d3d
,
"Failed to create a D3D object.
\n
"
);
if
(
!
(
device
=
create_device
(
d3d
,
window
,
NULL
)))
{
skip
(
"Failed to create a D3D device.
\n
"
);
IDirect3D9_Release
(
d3d
);
DestroyWindow
(
window
);
return
;
}
iface
=
(
void
*
)
0xdeadbeef
;
hr
=
IDirect3DDevice9_CreateRenderTarget
(
device
,
64
,
64
,
D3DFMT_UNKNOWN
,
D3DMULTISAMPLE_NONE
,
0
,
FALSE
,
(
IDirect3DSurface9
**
)
&
iface
,
NULL
);
ok
(
hr
==
D3DERR_INVALIDCALL
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
!
iface
,
"Got unexpected iface %p.
\n
"
,
iface
);
iface
=
(
void
*
)
0xdeadbeef
;
hr
=
IDirect3DDevice9_CreateDepthStencilSurface
(
device
,
64
,
64
,
D3DFMT_UNKNOWN
,
D3DMULTISAMPLE_NONE
,
0
,
TRUE
,
(
IDirect3DSurface9
**
)
&
iface
,
NULL
);
ok
(
hr
==
D3DERR_INVALIDCALL
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
!
iface
,
"Got unexpected iface %p.
\n
"
,
iface
);
iface
=
(
void
*
)
0xdeadbeef
;
hr
=
IDirect3DDevice9_CreateOffscreenPlainSurface
(
device
,
64
,
64
,
D3DFMT_UNKNOWN
,
D3DPOOL_DEFAULT
,
(
IDirect3DSurface9
**
)
&
iface
,
NULL
);
ok
(
hr
==
D3DERR_INVALIDCALL
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
!
iface
,
"Got unexpected iface %p.
\n
"
,
iface
);
iface
=
(
void
*
)
0xdeadbeef
;
hr
=
IDirect3DDevice9_CreateTexture
(
device
,
64
,
64
,
1
,
0
,
D3DFMT_UNKNOWN
,
D3DPOOL_DEFAULT
,
(
IDirect3DTexture9
**
)
&
iface
,
NULL
);
ok
(
hr
==
D3DERR_INVALIDCALL
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
!
iface
,
"Got unexpected iface %p.
\n
"
,
iface
);
iface
=
(
void
*
)
0xdeadbeef
;
hr
=
IDirect3DDevice9_CreateCubeTexture
(
device
,
64
,
1
,
0
,
D3DFMT_UNKNOWN
,
D3DPOOL_DEFAULT
,
(
IDirect3DCubeTexture9
**
)
&
iface
,
NULL
);
ok
(
hr
==
D3DERR_INVALIDCALL
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
!
iface
,
"Got unexpected iface %p.
\n
"
,
iface
);
iface
=
(
void
*
)
0xdeadbeef
;
hr
=
IDirect3DDevice9_CreateVolumeTexture
(
device
,
64
,
64
,
1
,
1
,
0
,
D3DFMT_UNKNOWN
,
D3DPOOL_DEFAULT
,
(
IDirect3DVolumeTexture9
**
)
&
iface
,
NULL
);
ok
(
hr
==
D3DERR_INVALIDCALL
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
!
iface
,
"Got unexpected iface %p.
\n
"
,
iface
);
refcount
=
IDirect3DDevice9_Release
(
device
);
ok
(
!
refcount
,
"Device has %u references left.
\n
"
,
refcount
);
IDirect3D9_Release
(
d3d
);
DestroyWindow
(
window
);
}
START_TEST
(
device
)
{
WNDCLASSA
wc
=
{
0
};
...
...
@@ -11560,6 +11623,7 @@ START_TEST(device)
test_miptree_layout
();
test_get_render_target_data
();
test_render_target_device_mismatch
();
test_format_unknown
();
UnregisterClassA
(
"d3d9_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