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
6038e2ab
Commit
6038e2ab
authored
Aug 24, 2015
by
Józef Kucia
Committed by
Alexandre Julliard
Aug 24, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d11/tests: Add test for D3D11CreateDevice.
parent
4cf1bb92
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
53 additions
and
0 deletions
+53
-0
d3d11.c
dlls/d3d11/tests/d3d11.c
+53
-0
No files found.
dlls/d3d11/tests/d3d11.c
View file @
6038e2ab
...
...
@@ -21,6 +21,12 @@
#include "d3d11.h"
#include "wine/test.h"
static
ULONG
get_refcount
(
IUnknown
*
iface
)
{
IUnknown_AddRef
(
iface
);
return
IUnknown_Release
(
iface
);
}
static
ID3D11Device
*
create_device
(
D3D_FEATURE_LEVEL
feature_level
)
{
ID3D11Device
*
device
;
...
...
@@ -38,6 +44,52 @@ static ID3D11Device *create_device(D3D_FEATURE_LEVEL feature_level)
return
NULL
;
}
static
void
test_create_device
(
void
)
{
D3D_FEATURE_LEVEL
feature_level
,
supported_feature_level
;
ID3D11DeviceContext
*
immediate_context
=
NULL
;
ID3D11Device
*
device
;
ULONG
refcount
;
HRESULT
hr
;
hr
=
D3D11CreateDevice
(
NULL
,
D3D_DRIVER_TYPE_HARDWARE
,
NULL
,
0
,
NULL
,
0
,
D3D11_SDK_VERSION
,
&
device
,
NULL
,
NULL
);
if
(
FAILED
(
hr
))
{
skip
(
"Failed to create HAL device, skipping tests.
\n
"
);
return
;
}
supported_feature_level
=
ID3D11Device_GetFeatureLevel
(
device
);
ID3D11Device_Release
(
device
);
hr
=
D3D11CreateDevice
(
NULL
,
D3D_DRIVER_TYPE_HARDWARE
,
NULL
,
0
,
NULL
,
0
,
D3D11_SDK_VERSION
,
NULL
,
NULL
,
NULL
);
ok
(
SUCCEEDED
(
hr
),
"D3D11CreateDevice failed %#x.
\n
"
,
hr
);
hr
=
D3D11CreateDevice
(
NULL
,
D3D_DRIVER_TYPE_HARDWARE
,
NULL
,
0
,
NULL
,
0
,
D3D11_SDK_VERSION
,
NULL
,
&
feature_level
,
NULL
);
ok
(
SUCCEEDED
(
hr
),
"D3D11CreateDevice failed %#x.
\n
"
,
hr
);
ok
(
feature_level
==
supported_feature_level
,
"Got feature level %#x, expected %#x.
\n
"
,
feature_level
,
supported_feature_level
);
hr
=
D3D11CreateDevice
(
NULL
,
D3D_DRIVER_TYPE_HARDWARE
,
NULL
,
0
,
NULL
,
0
,
D3D11_SDK_VERSION
,
NULL
,
NULL
,
&
immediate_context
);
ok
(
SUCCEEDED
(
hr
),
"D3D11CreateDevice failed %#x.
\n
"
,
hr
);
todo_wine
ok
(
!!
immediate_context
,
"Immediate context is NULL.
\n
"
);
if
(
!
immediate_context
)
return
;
refcount
=
get_refcount
((
IUnknown
*
)
immediate_context
);
ok
(
refcount
==
1
,
"Got refcount %u, expected 1.
\n
"
,
refcount
);
ID3D11DeviceContext_GetDevice
(
immediate_context
,
&
device
);
refcount
=
ID3D11Device_Release
(
device
);
ok
(
refcount
==
1
,
"Got refcount %u, expected 1.
\n
"
,
refcount
);
refcount
=
ID3D11DeviceContext_Release
(
immediate_context
);
ok
(
!
refcount
,
"ID3D11DeviceContext has %u references left.
\n
"
,
refcount
);
}
static
void
test_device_interfaces
(
void
)
{
static
const
D3D_FEATURE_LEVEL
feature_levels
[]
=
...
...
@@ -96,5 +148,6 @@ static void test_device_interfaces(void)
START_TEST
(
d3d11
)
{
test_create_device
();
test_device_interfaces
();
}
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