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
c672071d
Commit
c672071d
authored
Jun 23, 2009
by
Henri Verbeet
Committed by
Alexandre Julliard
Jun 23, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d9/tests: Make sure the device is released properly.
parent
ad05c39f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
91 additions
and
30 deletions
+91
-30
device.c
dlls/d3d9/tests/device.c
+79
-26
query.c
dlls/d3d9/tests/query.c
+12
-4
No files found.
dlls/d3d9/tests/device.c
View file @
c672071d
...
...
@@ -130,9 +130,13 @@ static void test_mipmap_levels(void)
check_mipmap_levels
(
pDevice
,
1
,
256
,
9
);
check_mipmap_levels
(
pDevice
,
1
,
1
,
1
);
cleanup:
if
(
pD3d
)
IUnknown_Release
(
pD3d
);
if
(
pDevice
)
IUnknown_Release
(
pDevice
);
cleanup:
if
(
pDevice
)
{
UINT
refcount
=
IUnknown_Release
(
pDevice
);
ok
(
!
refcount
,
"Device has %u references left.
\n
"
,
refcount
);
}
if
(
pD3d
)
IUnknown_Release
(
pD3d
);
DestroyWindow
(
hwnd
);
}
...
...
@@ -186,8 +190,12 @@ static void test_checkdevicemultisampletype(void)
ok
(
qualityLevels
==
1
,
"qualitylevel is not 1 but %d
\n
"
,
qualityLevels
);
cleanup:
if
(
pD3d
)
IUnknown_Release
(
pD3d
);
if
(
pDevice
)
IUnknown_Release
(
pDevice
);
if
(
pDevice
)
{
UINT
refcount
=
IUnknown_Release
(
pDevice
);
ok
(
!
refcount
,
"Device has %u references left.
\n
"
,
refcount
);
}
if
(
pD3d
)
IUnknown_Release
(
pD3d
);
DestroyWindow
(
hwnd
);
}
...
...
@@ -326,12 +334,16 @@ static void test_swapchain(void)
ok
(
swapchainX
==
NULL
,
"The swapchain pointer is %p
\n
"
,
swapchainX
);
if
(
swapchainX
&&
swapchainX
!=
(
void
*
)
0xdeadbeef
)
IDirect3DSwapChain9_Release
(
swapchainX
);
cleanup:
cleanup:
if
(
swapchain1
)
IDirect3DSwapChain9_Release
(
swapchain1
);
if
(
swapchain2
)
IDirect3DSwapChain9_Release
(
swapchain2
);
if
(
swapchain3
)
IDirect3DSwapChain9_Release
(
swapchain3
);
if
(
pDevice
)
IDirect3DDevice9_Release
(
pDevice
);
if
(
pD3d
)
IDirect3DDevice9_Release
(
pD3d
);
if
(
pDevice
)
{
UINT
refcount
=
IDirect3DDevice9_Release
(
pDevice
);
ok
(
!
refcount
,
"Device has %u references left.
\n
"
,
refcount
);
}
if
(
pD3d
)
IDirect3D9_Release
(
pD3d
);
DestroyWindow
(
hwnd
);
}
...
...
@@ -760,8 +772,12 @@ static void test_cursor(void)
ok
(
info
.
hCursor
==
cur
,
"The cursor handle is %p
\n
"
,
info
.
hCursor
);
/* unchanged */
cleanup:
if
(
pDevice
)
IDirect3D9_Release
(
pDevice
);
if
(
pD3d
)
IDirect3D9_Release
(
pD3d
);
if
(
pDevice
)
{
UINT
refcount
=
IDirect3DDevice9_Release
(
pDevice
);
ok
(
!
refcount
,
"Device has %u references left.
\n
"
,
refcount
);
}
if
(
pD3d
)
IDirect3D9_Release
(
pD3d
);
DestroyWindow
(
hwnd
);
}
...
...
@@ -1145,8 +1161,12 @@ static void test_reset(void)
cleanup:
HeapFree
(
GetProcessHeap
(),
0
,
modes
);
if
(
pD3d
)
IDirect3D9_Release
(
pD3d
);
if
(
pDevice
)
IDirect3D9_Release
(
pDevice
);
if
(
pDevice
)
{
UINT
refcount
=
IDirect3DDevice9_Release
(
pDevice
);
ok
(
!
refcount
,
"Device has %u references left.
\n
"
,
refcount
);
}
if
(
pD3d
)
IDirect3D9_Release
(
pD3d
);
}
/* Test adapter display modes */
...
...
@@ -1389,8 +1409,12 @@ cleanup:
if
(
pSurface1
)
IDirect3DSurface9_Release
(
pSurface1
);
if
(
pSurface2
)
IDirect3DSurface9_Release
(
pSurface2
);
if
(
pSurface3
)
IDirect3DSurface9_Release
(
pSurface3
);
if
(
pD3d
)
IDirect3D9_Release
(
pD3d
);
if
(
pDevice
)
IDirect3D9_Release
(
pDevice
);
if
(
pDevice
)
{
UINT
refcount
=
IDirect3DDevice9_Release
(
pDevice
);
ok
(
!
refcount
,
"Device has %u references left.
\n
"
,
refcount
);
}
if
(
pD3d
)
IDirect3D9_Release
(
pD3d
);
if
(
hwnd
)
DestroyWindow
(
hwnd
);
}
...
...
@@ -1456,8 +1480,12 @@ static void test_limits(void)
*/
cleanup:
if
(
pTexture
)
IDirect3DTexture9_Release
(
pTexture
);
if
(
pD3d
)
IDirect3D9_Release
(
pD3d
);
if
(
pDevice
)
IDirect3D9_Release
(
pDevice
);
if
(
pDevice
)
{
UINT
refcount
=
IDirect3D9_Release
(
pDevice
);
ok
(
!
refcount
,
"Device has %u references left.
\n
"
,
refcount
);
}
if
(
pD3d
)
IDirect3D9_Release
(
pD3d
);
if
(
hwnd
)
DestroyWindow
(
hwnd
);
}
...
...
@@ -1615,8 +1643,12 @@ static void test_depthstenciltest(void)
cleanup:
if
(
pDepthStencil
)
IDirect3DSurface9_Release
(
pDepthStencil
);
if
(
pD3d
)
IDirect3D9_Release
(
pD3d
);
if
(
pDevice
)
IDirect3D9_Release
(
pDevice
);
if
(
pDevice
)
{
UINT
refcount
=
IDirect3D9_Release
(
pDevice
);
ok
(
!
refcount
,
"Device has %u references left.
\n
"
,
refcount
);
}
if
(
pD3d
)
IDirect3D9_Release
(
pD3d
);
if
(
hwnd
)
DestroyWindow
(
hwnd
);
}
...
...
@@ -1739,8 +1771,12 @@ static void test_draw_indexed(void)
IDirect3DVertexDeclaration9_Release
(
vertex_declaration
);
cleanup:
if
(
device
)
{
UINT
refcount
=
IDirect3DDevice9_Release
(
device
);
ok
(
!
refcount
,
"Device has %u references left.
\n
"
,
refcount
);
}
if
(
d3d9
)
IDirect3D9_Release
(
d3d9
);
if
(
device
)
IDirect3DDevice9_Release
(
device
);
if
(
hwnd
)
DestroyWindow
(
hwnd
);
}
...
...
@@ -1831,7 +1867,11 @@ cleanup:
if
(
buffer
)
IDirect3DVertexBuffer9_Release
(
buffer
);
if
(
decl
)
IDirect3DVertexDeclaration9_Release
(
decl
);
if
(
shader
)
IDirect3DVertexShader9_Release
(
shader
);
if
(
device
)
IDirect3DDevice9_Release
(
device
);
if
(
device
)
{
UINT
refcount
=
IDirect3DDevice9_Release
(
device
);
ok
(
!
refcount
,
"Device has %u references left.
\n
"
,
refcount
);
}
if
(
d3d9
)
IDirect3D9_Release
(
d3d9
);
}
...
...
@@ -1901,8 +1941,13 @@ static void test_vertex_buffer_alignment(void)
}
}
cleanup:
if
(
d3d9
)
IDirect3D9_Release
(
d3d9
);
cleanup:
if
(
device
)
{
UINT
refcount
=
IDirect3DDevice9_Release
(
device
);
ok
(
!
refcount
,
"Device has %u references left.
\n
"
,
refcount
);
}
if
(
d3d9
)
IDirect3D9_Release
(
d3d9
);
}
static
void
test_lights
(
void
)
...
...
@@ -1963,8 +2008,12 @@ static void test_lights(void)
ok
(
hr
==
D3D_OK
,
"Disabling light %u failed with %08x
\n
"
,
i
,
hr
);
}
cleanup:
if
(
device
)
IDirect3DDevice9_Release
(
device
);
cleanup:
if
(
device
)
{
UINT
refcount
=
IDirect3DDevice9_Release
(
device
);
ok
(
!
refcount
,
"Device has %u references left.
\n
"
,
refcount
);
}
if
(
d3d9
)
IDirect3D9_Release
(
d3d9
);
}
...
...
@@ -2037,9 +2086,13 @@ static void test_set_stream_source(void)
hr
=
IDirect3DDevice9_SetStreamSource
(
device
,
0
,
NULL
,
0
,
0
);
ok
(
hr
==
D3D_OK
,
"Failed to set the stream source, offset 4, hr = %08x
\n
"
,
hr
);
if
(
pVertexBuffer
)
IDirect3DDevice9_Release
(
pVertexBuffer
);
cleanup:
if
(
device
)
IDirect3DDevice9_Release
(
device
);
if
(
pVertexBuffer
)
IDirect3DVertexBuffer9_Release
(
pVertexBuffer
);
if
(
device
)
{
UINT
refcount
=
IDirect3DDevice9_Release
(
device
);
ok
(
!
refcount
,
"Device has %u references left.
\n
"
,
refcount
);
}
if
(
d3d9
)
IDirect3D9_Release
(
d3d9
);
}
...
...
dlls/d3d9/tests/query.c
View file @
c672071d
...
...
@@ -130,8 +130,12 @@ static void test_query_support(IDirect3D9 *pD3d, HWND hwnd)
}
}
cleanup:
if
(
pDevice
)
IDirect3DDevice9_Release
(
pDevice
);
cleanup:
if
(
pDevice
)
{
UINT
refcount
=
IDirect3DDevice9_Release
(
pDevice
);
ok
(
!
refcount
,
"Device has %u references left.
\n
"
,
refcount
);
}
}
static
void
test_occlusion_query_states
(
IDirect3D9
*
pD3d
,
HWND
hwnd
)
...
...
@@ -226,10 +230,14 @@ static void test_occlusion_query_states(IDirect3D9 *pD3d, HWND hwnd)
hr
=
IDirect3DQuery9_Issue
(
pQuery
,
D3DISSUE_END
);
ok
(
hr
==
D3D_OK
,
"IDirect3DQuery9_Issue(D3DISSUE_END) on a ended query returned %08x
\n
"
,
hr
);
cleanup:
cleanup:
HeapFree
(
GetProcessHeap
(),
0
,
data
);
if
(
pQuery
)
IDirect3DQuery9_Release
(
pQuery
);
if
(
pDevice
)
IDirect3DDevice9_Release
(
pDevice
);
if
(
pDevice
)
{
UINT
refcount
=
IDirect3DDevice9_Release
(
pDevice
);
ok
(
!
refcount
,
"Device has %u references left.
\n
"
,
refcount
);
}
}
START_TEST
(
query
)
...
...
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