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
100038df
Commit
100038df
authored
Nov 10, 2006
by
Markus Amsler
Committed by
Alexandre Julliard
Nov 10, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d8: Add GetContainer tests for implicit surfaces.
parent
2c40b823
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
0 deletions
+16
-0
device.c
dlls/d3d8/tests/device.c
+16
-0
No files found.
dlls/d3d8/tests/device.c
View file @
100038df
...
...
@@ -37,6 +37,7 @@ static int get_refcount(IUnknown *object)
} else {\
trace("%s failed: %s\n", c, DXGetErrorString8(r)); \
}
#define CHECK_RELEASE(obj,d,rc) \
if (obj) { \
int tmp1, rc_new = rc; \
...
...
@@ -44,6 +45,7 @@ static int get_refcount(IUnknown *object)
tmp1 = get_refcount( (IUnknown *)d ); \
ok(tmp1 == rc_new, "Invalid refcount. Expected %d got %d\n", rc_new, tmp1); \
}
#define CHECK_REFCOUNT(obj,rc) \
{ \
int rc_new = rc; \
...
...
@@ -58,6 +60,15 @@ static int get_refcount(IUnknown *object)
ok(count == rc_new, "Invalid refcount. Expected %d got %d\n", rc_new, count); \
}
#define CHECK_SURFACE_CONTAINER(obj,iid,expected) \
{ \
void *container_ptr = (void *)0x1337c0d3; \
hr = IDirect3DSurface8_GetContainer(obj, &iid, &container_ptr); \
ok(SUCCEEDED(hr) && container_ptr == expected, "GetContainer returned: hr %#x, container_ptr %p. " \
"Expected hr %#x, container_ptr %p\n", hr, container_ptr, S_OK, expected); \
if (container_ptr && container_ptr != (void *)0x1337c0d3) IUnknown_Release((IUnknown *)container_ptr); \
}
static
void
check_mipmap_levels
(
IDirect3DDevice8
*
device
,
int
width
,
int
height
,
int
count
)
...
...
@@ -301,6 +312,7 @@ static void test_refcount(void)
/**
* Check refcount of implicit surfaces. Findings:
* - the container is the device
* - they hold a refernce to the device
* - they are created with a refcount of 0 (Get/Release returns orignial refcount)
*/
...
...
@@ -308,6 +320,7 @@ static void test_refcount(void)
todo_wine
CHECK_CALL
(
hr
,
"GetRenderTarget"
,
pDevice
,
++
refcount
);
if
(
pRenderTarget
)
{
todo_wine
CHECK_SURFACE_CONTAINER
(
pRenderTarget
,
IID_IDirect3DDevice8
,
pDevice
);
todo_wine
CHECK_REFCOUNT
(
pRenderTarget
,
1
);
hr
=
IDirect3DDevice8_GetRenderTarget
(
pDevice
,
&
pRenderTarget
);
todo_wine
CHECK_CALL
(
hr
,
"GetRenderTarget"
,
pDevice
,
refcount
);
...
...
@@ -322,6 +335,7 @@ static void test_refcount(void)
todo_wine
CHECK_CALL
(
hr
,
"GetDepthStencilSurface"
,
pDevice
,
++
refcount
);
if
(
pStencilSurface
)
{
CHECK_SURFACE_CONTAINER
(
pStencilSurface
,
IID_IDirect3DDevice8
,
pDevice
);
todo_wine
CHECK_REFCOUNT
(
pStencilSurface
,
1
);
todo_wine
CHECK_RELEASE_REFCOUNT
(
pStencilSurface
,
0
);
pStencilSurface
=
NULL
;
...
...
@@ -332,6 +346,7 @@ static void test_refcount(void)
todo_wine
CHECK_CALL
(
hr
,
"GetBackBuffer"
,
pDevice
,
++
refcount
);
if
(
pBackBuffer
)
{
todo_wine
CHECK_SURFACE_CONTAINER
(
pBackBuffer
,
IID_IDirect3DDevice8
,
pDevice
);
todo_wine
CHECK_REFCOUNT
(
pBackBuffer
,
1
);
todo_wine
CHECK_RELEASE_REFCOUNT
(
pBackBuffer
,
0
);
pBackBuffer
=
NULL
;
...
...
@@ -410,6 +425,7 @@ static void test_refcount(void)
todo_wine
CHECK_REFCOUNT
(
pSwapChain
,
1
);
if
(
pBackBuffer
)
{
todo_wine
CHECK_SURFACE_CONTAINER
(
pBackBuffer
,
IID_IDirect3DDevice8
,
pDevice
);
todo_wine
CHECK_REFCOUNT
(
pBackBuffer
,
1
);
todo_wine
CHECK_RELEASE_REFCOUNT
(
pBackBuffer
,
0
);
pBackBuffer
=
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