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
e806b5ba
Commit
e806b5ba
authored
Feb 11, 2014
by
Henri Verbeet
Committed by
Alexandre Julliard
Feb 11, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dxgi/tests: Add tests for CreateDXGIFactory().
parent
a13a5465
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
68 additions
and
0 deletions
+68
-0
device.c
dlls/dxgi/tests/device.c
+68
-0
No files found.
dlls/dxgi/tests/device.c
View file @
e806b5ba
...
...
@@ -21,6 +21,8 @@
#include "d3d10.h"
#include "wine/test.h"
static
HRESULT
(
WINAPI
*
pCreateDXGIFactory1
)(
REFIID
iid
,
void
**
factory
);
static
IDXGIDevice
*
create_device
(
void
)
{
IDXGIDevice
*
dxgi_device
;
...
...
@@ -499,12 +501,78 @@ static void test_createswapchain(void)
ok
(
!
refcount
,
"Device has %u references left.
\n
"
,
refcount
);
}
static
void
test_create_factory
(
void
)
{
IDXGIFactory1
*
factory
;
IUnknown
*
iface
;
HRESULT
hr
;
iface
=
(
void
*
)
0xdeadbeef
;
hr
=
CreateDXGIFactory
(
&
IID_IDXGIDevice
,
(
void
**
)
&
iface
);
ok
(
hr
==
E_NOINTERFACE
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
!
iface
,
"Got unexpected iface %p.
\n
"
,
iface
);
hr
=
CreateDXGIFactory
(
&
IID_IUnknown
,
(
void
**
)
&
iface
);
ok
(
SUCCEEDED
(
hr
),
"Failed to create factory with IID_IUnknown, hr %#x.
\n
"
,
hr
);
IUnknown_Release
(
iface
);
hr
=
CreateDXGIFactory
(
&
IID_IDXGIObject
,
(
void
**
)
&
iface
);
ok
(
SUCCEEDED
(
hr
),
"Failed to create factory with IID_IDXGIObject, hr %#x.
\n
"
,
hr
);
IUnknown_Release
(
iface
);
factory
=
(
void
*
)
0xdeadbeef
;
hr
=
CreateDXGIFactory
(
&
IID_IDXGIFactory
,
(
void
**
)
&
iface
);
ok
(
SUCCEEDED
(
hr
),
"Failed to create factory with IID_IDXGIFactory, hr %#x.
\n
"
,
hr
);
hr
=
IUnknown_QueryInterface
(
iface
,
&
IID_IDXGIFactory1
,
(
void
**
)
&
factory
);
ok
(
hr
==
E_NOINTERFACE
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
!
factory
,
"Got unexpected factory %p.
\n
"
,
factory
);
IUnknown_Release
(
iface
);
iface
=
(
void
*
)
0xdeadbeef
;
hr
=
CreateDXGIFactory
(
&
IID_IDXGIFactory1
,
(
void
**
)
&
iface
);
ok
(
hr
==
E_NOINTERFACE
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
!
iface
,
"Got unexpected iface %p.
\n
"
,
iface
);
if
(
!
pCreateDXGIFactory1
)
{
win_skip
(
"CreateDXGIFactory1 not available, skipping tests.
\n
"
);
return
;
}
iface
=
(
void
*
)
0xdeadbeef
;
hr
=
pCreateDXGIFactory1
(
&
IID_IDXGIDevice
,
(
void
**
)
&
iface
);
ok
(
hr
==
E_NOINTERFACE
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
!
iface
,
"Got unexpected iface %p.
\n
"
,
iface
);
hr
=
pCreateDXGIFactory1
(
&
IID_IUnknown
,
(
void
**
)
&
iface
);
ok
(
SUCCEEDED
(
hr
),
"Failed to create factory with IID_IUnknown, hr %#x.
\n
"
,
hr
);
IUnknown_Release
(
iface
);
hr
=
pCreateDXGIFactory1
(
&
IID_IDXGIObject
,
(
void
**
)
&
iface
);
ok
(
SUCCEEDED
(
hr
),
"Failed to create factory with IID_IDXGIObject, hr %#x.
\n
"
,
hr
);
IUnknown_Release
(
iface
);
hr
=
pCreateDXGIFactory1
(
&
IID_IDXGIFactory
,
(
void
**
)
&
iface
);
ok
(
SUCCEEDED
(
hr
),
"Failed to create factory with IID_IDXGIFactory, hr %#x.
\n
"
,
hr
);
hr
=
IUnknown_QueryInterface
(
iface
,
&
IID_IDXGIFactory1
,
(
void
**
)
&
factory
);
ok
(
SUCCEEDED
(
hr
),
"Failed to query IDXGIFactory1 interface, hr %#x.
\n
"
,
hr
);
IDXGIFactory1_Release
(
factory
);
IUnknown_Release
(
iface
);
hr
=
pCreateDXGIFactory1
(
&
IID_IDXGIFactory1
,
(
void
**
)
&
iface
);
ok
(
SUCCEEDED
(
hr
),
"Failed to create factory with IID_IDXGIFactory1, hr %#x.
\n
"
,
hr
);
IUnknown_Release
(
iface
);
}
START_TEST
(
device
)
{
pCreateDXGIFactory1
=
(
void
*
)
GetProcAddress
(
GetModuleHandleA
(
"dxgi.dll"
),
"CreateDXGIFactory1"
);
test_adapter_desc
();
test_device_interfaces
();
test_create_surface
();
test_parents
();
test_output
();
test_createswapchain
();
test_create_factory
();
}
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