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
120ca8e7
Commit
120ca8e7
authored
Mar 12, 2014
by
Stefan Dösinger
Committed by
Alexandre Julliard
Mar 12, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d8/tests: Use a custom GUID for the private data tests.
parent
2a95fa68
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
20 deletions
+27
-20
device.c
dlls/d3d8/tests/device.c
+27
-20
No files found.
dlls/d3d8/tests/device.c
View file @
120ca8e7
...
@@ -3889,6 +3889,13 @@ static void test_private_data(void)
...
@@ -3889,6 +3889,13 @@ static void test_private_data(void)
HRESULT
hr
;
HRESULT
hr
;
DWORD
size
;
DWORD
size
;
DWORD
data
[
4
]
=
{
1
,
2
,
3
,
4
};
DWORD
data
[
4
]
=
{
1
,
2
,
3
,
4
};
static
const
GUID
d3d8_private_data_test_guid
=
{
0xfdb37466
,
0x428f
,
0x4edf
,
{
0xa3
,
0x7f
,
0x9b
,
0x1d
,
0xf4
,
0x88
,
0xc5
,
0xfc
}
};
window
=
CreateWindowA
(
"d3d8_test_wc"
,
"d3d8_test"
,
WS_OVERLAPPEDWINDOW
,
window
=
CreateWindowA
(
"d3d8_test_wc"
,
"d3d8_test"
,
WS_OVERLAPPEDWINDOW
,
0
,
0
,
640
,
480
,
0
,
0
,
0
,
0
);
0
,
0
,
640
,
480
,
0
,
0
,
0
,
0
);
...
@@ -3905,57 +3912,57 @@ static void test_private_data(void)
...
@@ -3905,57 +3912,57 @@ static void test_private_data(void)
hr
=
IDirect3DDevice8_CreateImageSurface
(
device
,
4
,
4
,
D3DFMT_A8R8G8B8
,
&
surface
);
hr
=
IDirect3DDevice8_CreateImageSurface
(
device
,
4
,
4
,
D3DFMT_A8R8G8B8
,
&
surface
);
ok
(
SUCCEEDED
(
hr
),
"Failed to create surface, hr %#x.
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"Failed to create surface, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DSurface8_SetPrivateData
(
surface
,
&
IID_IDirect3DSurface8
/* Abuse this tag */
,
hr
=
IDirect3DSurface8_SetPrivateData
(
surface
,
&
d3d8_private_data_test_guid
,
device
,
0
,
D3DSPD_IUNKNOWN
);
device
,
0
,
D3DSPD_IUNKNOWN
);
ok
(
hr
==
D3DERR_INVALIDCALL
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
hr
==
D3DERR_INVALIDCALL
,
"Got unexpected hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DSurface8_SetPrivateData
(
surface
,
&
IID_IDirect3DSurface8
/* Abuse this tag */
,
hr
=
IDirect3DSurface8_SetPrivateData
(
surface
,
&
d3d8_private_data_test_guid
,
device
,
5
,
D3DSPD_IUNKNOWN
);
device
,
5
,
D3DSPD_IUNKNOWN
);
ok
(
hr
==
D3DERR_INVALIDCALL
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
hr
==
D3DERR_INVALIDCALL
,
"Got unexpected hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DSurface8_SetPrivateData
(
surface
,
&
IID_IDirect3DSurface8
/* Abuse this tag */
,
hr
=
IDirect3DSurface8_SetPrivateData
(
surface
,
&
d3d8_private_data_test_guid
,
device
,
sizeof
(
IUnknown
*
)
*
2
,
D3DSPD_IUNKNOWN
);
device
,
sizeof
(
IUnknown
*
)
*
2
,
D3DSPD_IUNKNOWN
);
ok
(
hr
==
D3DERR_INVALIDCALL
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
hr
==
D3DERR_INVALIDCALL
,
"Got unexpected hr %#x.
\n
"
,
hr
);
/* A failing SetPrivateData call does not clear the old data with the same tag. */
/* A failing SetPrivateData call does not clear the old data with the same tag. */
hr
=
IDirect3DSurface8_SetPrivateData
(
surface
,
&
IID_IDirect3DVertexBuffer8
,
device
,
hr
=
IDirect3DSurface8_SetPrivateData
(
surface
,
&
d3d8_private_data_test_guid
,
device
,
sizeof
(
device
),
D3DSPD_IUNKNOWN
);
sizeof
(
device
),
D3DSPD_IUNKNOWN
);
ok
(
SUCCEEDED
(
hr
),
"Failed to set private data, hr %#x.
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"Failed to set private data, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DSurface8_SetPrivateData
(
surface
,
&
IID_IDirect3DVertexBuffer8
,
device
,
hr
=
IDirect3DSurface8_SetPrivateData
(
surface
,
&
d3d8_private_data_test_guid
,
device
,
sizeof
(
device
)
*
2
,
D3DSPD_IUNKNOWN
);
sizeof
(
device
)
*
2
,
D3DSPD_IUNKNOWN
);
ok
(
hr
==
D3DERR_INVALIDCALL
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
hr
==
D3DERR_INVALIDCALL
,
"Got unexpected hr %#x.
\n
"
,
hr
);
size
=
sizeof
(
ptr
);
size
=
sizeof
(
ptr
);
hr
=
IDirect3DSurface8_GetPrivateData
(
surface
,
&
IID_IDirect3DVertexBuffer8
,
&
ptr
,
&
size
);
hr
=
IDirect3DSurface8_GetPrivateData
(
surface
,
&
d3d8_private_data_test_guid
,
&
ptr
,
&
size
);
ok
(
SUCCEEDED
(
hr
),
"Failed to get private data, hr %#x.
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"Failed to get private data, hr %#x.
\n
"
,
hr
);
IUnknown_Release
(
ptr
);
IUnknown_Release
(
ptr
);
hr
=
IDirect3DSurface8_FreePrivateData
(
surface
,
&
IID_IDirect3DVertexBuffer8
);
hr
=
IDirect3DSurface8_FreePrivateData
(
surface
,
&
d3d8_private_data_test_guid
);
ok
(
SUCCEEDED
(
hr
),
"Failed to free private data, hr %#x.
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"Failed to free private data, hr %#x.
\n
"
,
hr
);
refcount
=
get_refcount
((
IUnknown
*
)
device
);
refcount
=
get_refcount
((
IUnknown
*
)
device
);
hr
=
IDirect3DSurface8_SetPrivateData
(
surface
,
&
IID_IDirect3DSurface8
/* Abuse this tag */
,
hr
=
IDirect3DSurface8_SetPrivateData
(
surface
,
&
d3d8_private_data_test_guid
,
device
,
sizeof
(
IUnknown
*
),
D3DSPD_IUNKNOWN
);
device
,
sizeof
(
IUnknown
*
),
D3DSPD_IUNKNOWN
);
ok
(
hr
==
D3D_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
hr
==
D3D_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
expected_refcount
=
refcount
+
1
;
expected_refcount
=
refcount
+
1
;
refcount
=
get_refcount
((
IUnknown
*
)
device
);
refcount
=
get_refcount
((
IUnknown
*
)
device
);
ok
(
refcount
==
expected_refcount
,
"Got unexpected refcount %u, expected %u.
\n
"
,
refcount
,
expected_refcount
);
ok
(
refcount
==
expected_refcount
,
"Got unexpected refcount %u, expected %u.
\n
"
,
refcount
,
expected_refcount
);
hr
=
IDirect3DSurface8_FreePrivateData
(
surface
,
&
IID_IDirect3DSurface8
);
hr
=
IDirect3DSurface8_FreePrivateData
(
surface
,
&
d3d8_private_data_test_guid
);
ok
(
hr
==
D3D_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
hr
==
D3D_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
expected_refcount
=
refcount
-
1
;
expected_refcount
=
refcount
-
1
;
refcount
=
get_refcount
((
IUnknown
*
)
device
);
refcount
=
get_refcount
((
IUnknown
*
)
device
);
ok
(
refcount
==
expected_refcount
,
"Got unexpected refcount %u, expected %u.
\n
"
,
refcount
,
expected_refcount
);
ok
(
refcount
==
expected_refcount
,
"Got unexpected refcount %u, expected %u.
\n
"
,
refcount
,
expected_refcount
);
hr
=
IDirect3DSurface8_SetPrivateData
(
surface
,
&
IID_IDirect3DSurface8
,
hr
=
IDirect3DSurface8_SetPrivateData
(
surface
,
&
d3d8_private_data_test_guid
,
device
,
sizeof
(
IUnknown
*
),
D3DSPD_IUNKNOWN
);
device
,
sizeof
(
IUnknown
*
),
D3DSPD_IUNKNOWN
);
ok
(
hr
==
D3D_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
hr
==
D3D_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DSurface8_SetPrivateData
(
surface
,
&
IID_IDirect3DSurface8
,
hr
=
IDirect3DSurface8_SetPrivateData
(
surface
,
&
d3d8_private_data_test_guid
,
surface
,
sizeof
(
IUnknown
*
),
D3DSPD_IUNKNOWN
);
surface
,
sizeof
(
IUnknown
*
),
D3DSPD_IUNKNOWN
);
ok
(
hr
==
D3D_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
hr
==
D3D_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
refcount
=
get_refcount
((
IUnknown
*
)
device
);
refcount
=
get_refcount
((
IUnknown
*
)
device
);
ok
(
refcount
==
expected_refcount
,
"Got unexpected refcount %u, expected %u.
\n
"
,
refcount
,
expected_refcount
);
ok
(
refcount
==
expected_refcount
,
"Got unexpected refcount %u, expected %u.
\n
"
,
refcount
,
expected_refcount
);
hr
=
IDirect3DSurface8_SetPrivateData
(
surface
,
&
IID_IDirect3DSurface8
,
hr
=
IDirect3DSurface8_SetPrivateData
(
surface
,
&
d3d8_private_data_test_guid
,
device
,
sizeof
(
IUnknown
*
),
D3DSPD_IUNKNOWN
);
device
,
sizeof
(
IUnknown
*
),
D3DSPD_IUNKNOWN
);
ok
(
hr
==
D3D_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
hr
==
D3D_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
size
=
sizeof
(
ptr
);
size
=
sizeof
(
ptr
);
hr
=
IDirect3DSurface8_GetPrivateData
(
surface
,
&
IID_IDirect3DSurface8
,
&
ptr
,
&
size
);
hr
=
IDirect3DSurface8_GetPrivateData
(
surface
,
&
d3d8_private_data_test_guid
,
&
ptr
,
&
size
);
ok
(
hr
==
D3D_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
hr
==
D3D_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
expected_refcount
=
refcount
+
2
;
expected_refcount
=
refcount
+
2
;
refcount
=
get_refcount
((
IUnknown
*
)
device
);
refcount
=
get_refcount
((
IUnknown
*
)
device
);
...
@@ -3976,26 +3983,26 @@ static void test_private_data(void)
...
@@ -3976,26 +3983,26 @@ static void test_private_data(void)
hr
=
IDirect3DTexture8_GetSurfaceLevel
(
texture
,
1
,
&
surface2
);
hr
=
IDirect3DTexture8_GetSurfaceLevel
(
texture
,
1
,
&
surface2
);
ok
(
SUCCEEDED
(
hr
),
"Failed to get texture level 1, hr %#x.
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"Failed to get texture level 1, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DTexture8_SetPrivateData
(
texture
,
&
IID_IDirect3DVertexBuffer8
,
data
,
sizeof
(
data
),
0
);
hr
=
IDirect3DTexture8_SetPrivateData
(
texture
,
&
d3d8_private_data_test_guid
,
data
,
sizeof
(
data
),
0
);
ok
(
SUCCEEDED
(
hr
),
"Failed to set private data, hr %#x.
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"Failed to set private data, hr %#x.
\n
"
,
hr
);
memset
(
data
,
0
,
sizeof
(
data
));
memset
(
data
,
0
,
sizeof
(
data
));
size
=
sizeof
(
data
);
size
=
sizeof
(
data
);
hr
=
IDirect3DSurface8_GetPrivateData
(
surface
,
&
IID_IDirect3DVertexBuffer8
,
data
,
&
size
);
hr
=
IDirect3DSurface8_GetPrivateData
(
surface
,
&
d3d8_private_data_test_guid
,
data
,
&
size
);
ok
(
hr
==
D3DERR_NOTFOUND
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
hr
==
D3DERR_NOTFOUND
,
"Got unexpected hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DTexture8_GetPrivateData
(
texture
,
&
IID_IDirect3DVertexBuffer8
,
data
,
&
size
);
hr
=
IDirect3DTexture8_GetPrivateData
(
texture
,
&
d3d8_private_data_test_guid
,
data
,
&
size
);
ok
(
SUCCEEDED
(
hr
),
"Failed to get private data, hr %#x.
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"Failed to get private data, hr %#x.
\n
"
,
hr
);
ok
(
data
[
0
]
==
1
&&
data
[
1
]
==
2
&&
data
[
2
]
==
3
&&
data
[
3
]
==
4
,
ok
(
data
[
0
]
==
1
&&
data
[
1
]
==
2
&&
data
[
2
]
==
3
&&
data
[
3
]
==
4
,
"Got unexpected private data: %u, %u, %u, %u.
\n
"
,
data
[
0
],
data
[
1
],
data
[
2
],
data
[
3
]);
"Got unexpected private data: %u, %u, %u, %u.
\n
"
,
data
[
0
],
data
[
1
],
data
[
2
],
data
[
3
]);
hr
=
IDirect3DTexture8_FreePrivateData
(
texture
,
&
IID_IDirect3DVertexBuffer8
);
hr
=
IDirect3DTexture8_FreePrivateData
(
texture
,
&
d3d8_private_data_test_guid
);
ok
(
SUCCEEDED
(
hr
),
"Failed to free private data, hr %#x.
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"Failed to free private data, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DSurface8_SetPrivateData
(
surface
,
&
IID_IDirect3DVertexBuffer8
,
data
,
sizeof
(
data
),
0
);
hr
=
IDirect3DSurface8_SetPrivateData
(
surface
,
&
d3d8_private_data_test_guid
,
data
,
sizeof
(
data
),
0
);
ok
(
SUCCEEDED
(
hr
),
"Failed to set private data, hr %#x.
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"Failed to set private data, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DSurface8_GetPrivateData
(
surface2
,
&
IID_IDirect3DVertexBuffer8
,
data
,
&
size
);
hr
=
IDirect3DSurface8_GetPrivateData
(
surface2
,
&
d3d8_private_data_test_guid
,
data
,
&
size
);
ok
(
hr
==
D3DERR_NOTFOUND
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
hr
==
D3DERR_NOTFOUND
,
"Got unexpected hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DSurface8_FreePrivateData
(
surface
,
&
IID_IDirect3DVertexBuffer8
);
hr
=
IDirect3DSurface8_FreePrivateData
(
surface
,
&
d3d8_private_data_test_guid
);
ok
(
SUCCEEDED
(
hr
),
"Failed to free private data, hr %#x.
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"Failed to free private data, hr %#x.
\n
"
,
hr
);
IDirect3DSurface8_Release
(
surface2
);
IDirect3DSurface8_Release
(
surface2
);
...
...
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