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
4a62f81d
Commit
4a62f81d
authored
Mar 16, 2014
by
Stefan Dösinger
Committed by
Alexandre Julliard
Mar 17, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw/tests: Add mipmap private data tests.
parent
1d9ff5c4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
64 additions
and
2 deletions
+64
-2
ddraw4.c
dlls/ddraw/tests/ddraw4.c
+32
-1
ddraw7.c
dlls/ddraw/tests/ddraw7.c
+32
-1
No files found.
dlls/ddraw/tests/ddraw4.c
View file @
4a62f81d
...
...
@@ -6047,13 +6047,16 @@ static void test_surface_attachment(void)
static
void
test_private_data
(
void
)
{
IDirectDraw4
*
ddraw
;
IDirectDrawSurface4
*
surface
;
IDirectDrawSurface4
*
surface
,
*
surface2
;
DDSURFACEDESC2
surface_desc
;
ULONG
refcount
,
refcount2
,
refcount3
;
IUnknown
*
ptr
;
DWORD
size
=
sizeof
(
ptr
);
HRESULT
hr
;
HWND
window
;
DDSCAPS2
caps
=
{
DDSCAPS_COMPLEX
,
0
,
0
,
0
};
DWORD
data
[]
=
{
1
,
2
,
3
,
4
};
DDCAPS
hal_caps
;
window
=
CreateWindowA
(
"static"
,
"ddraw_test"
,
WS_OVERLAPPEDWINDOW
,
0
,
0
,
640
,
480
,
0
,
0
,
0
,
0
);
...
...
@@ -6163,6 +6166,34 @@ static void test_private_data(void)
refcount2
=
get_refcount
((
IUnknown
*
)
ddraw
);
ok
(
refcount2
==
refcount
-
1
,
"Got unexpected refcount %u.
\n
"
,
refcount2
);
memset
(
&
hal_caps
,
0
,
sizeof
(
hal_caps
));
hal_caps
.
dwSize
=
sizeof
(
hal_caps
);
hr
=
IDirectDraw7_GetCaps
(
ddraw
,
&
hal_caps
,
NULL
);
ok
(
SUCCEEDED
(
hr
),
"Failed to get caps, hr %#x.
\n
"
,
hr
);
if
((
hal_caps
.
ddsCaps
.
dwCaps
&
(
DDSCAPS_TEXTURE
|
DDSCAPS_MIPMAP
))
==
(
DDSCAPS_TEXTURE
|
DDSCAPS_MIPMAP
))
{
reset_ddsd
(
&
surface_desc
);
surface_desc
.
dwFlags
=
DDSD_CAPS
|
DDSD_HEIGHT
|
DDSD_WIDTH
|
DDSD_MIPMAPCOUNT
;
surface_desc
.
ddsCaps
.
dwCaps
=
DDSCAPS_TEXTURE
|
DDSCAPS_SYSTEMMEMORY
|
DDSCAPS_COMPLEX
|
DDSCAPS_MIPMAP
;
surface_desc
.
dwHeight
=
4
;
surface_desc
.
dwWidth
=
4
;
U2
(
surface_desc
).
dwMipMapCount
=
2
;
hr
=
IDirectDraw4_CreateSurface
(
ddraw
,
&
surface_desc
,
&
surface
,
NULL
);
ok
(
SUCCEEDED
(
hr
),
"Failed to create surface, hr %#x.
\n
"
,
hr
);
hr
=
IDirectDrawSurface4_GetAttachedSurface
(
surface
,
&
caps
,
&
surface2
);
ok
(
SUCCEEDED
(
hr
),
"Failed to get attached surface, hr %#x.
\n
"
,
hr
);
hr
=
IDirectDrawSurface4_SetPrivateData
(
surface
,
&
IID_IDirect3D
,
data
,
sizeof
(
data
),
0
);
ok
(
SUCCEEDED
(
hr
),
"Failed to set private data, hr %#x.
\n
"
,
hr
);
hr
=
IDirectDrawSurface4_GetPrivateData
(
surface2
,
&
IID_IDirect3D
,
NULL
,
NULL
);
ok
(
hr
==
DDERR_NOTFOUND
,
"Got unexpected hr %#x.
\n
"
,
hr
);
IDirectDrawSurface4_Release
(
surface2
);
IDirectDrawSurface4_Release
(
surface
);
}
else
skip
(
"Mipmapped textures not supported, skipping mipmap private data test.
\n
"
);
refcount
=
IDirectDraw4_Release
(
ddraw
);
ok
(
!
refcount
,
"Got unexpected refcount %u.
\n
"
,
refcount
);
DestroyWindow
(
window
);
...
...
dlls/ddraw/tests/ddraw7.c
View file @
4a62f81d
...
...
@@ -5902,13 +5902,16 @@ static void test_surface_attachment(void)
static
void
test_private_data
(
void
)
{
IDirectDraw7
*
ddraw
;
IDirectDrawSurface7
*
surface
;
IDirectDrawSurface7
*
surface
,
*
surface2
;
DDSURFACEDESC2
surface_desc
;
ULONG
refcount
,
refcount2
,
refcount3
;
IUnknown
*
ptr
;
DWORD
size
=
sizeof
(
ptr
);
HRESULT
hr
;
HWND
window
;
DDSCAPS2
caps
=
{
DDSCAPS_COMPLEX
,
0
,
0
,
0
};
DWORD
data
[]
=
{
1
,
2
,
3
,
4
};
DDCAPS
hal_caps
;
window
=
CreateWindowA
(
"static"
,
"ddraw_test"
,
WS_OVERLAPPEDWINDOW
,
0
,
0
,
640
,
480
,
0
,
0
,
0
,
0
);
...
...
@@ -6018,6 +6021,34 @@ static void test_private_data(void)
refcount2
=
get_refcount
((
IUnknown
*
)
ddraw
);
ok
(
refcount2
==
refcount
-
1
,
"Got unexpected refcount %u.
\n
"
,
refcount2
);
memset
(
&
hal_caps
,
0
,
sizeof
(
hal_caps
));
hal_caps
.
dwSize
=
sizeof
(
hal_caps
);
hr
=
IDirectDraw7_GetCaps
(
ddraw
,
&
hal_caps
,
NULL
);
ok
(
SUCCEEDED
(
hr
),
"Failed to get caps, hr %#x.
\n
"
,
hr
);
if
((
hal_caps
.
ddsCaps
.
dwCaps
&
(
DDSCAPS_TEXTURE
|
DDSCAPS_MIPMAP
))
==
(
DDSCAPS_TEXTURE
|
DDSCAPS_MIPMAP
))
{
reset_ddsd
(
&
surface_desc
);
surface_desc
.
dwFlags
=
DDSD_CAPS
|
DDSD_HEIGHT
|
DDSD_WIDTH
|
DDSD_MIPMAPCOUNT
;
surface_desc
.
ddsCaps
.
dwCaps
=
DDSCAPS_TEXTURE
|
DDSCAPS_SYSTEMMEMORY
|
DDSCAPS_COMPLEX
|
DDSCAPS_MIPMAP
;
surface_desc
.
dwHeight
=
4
;
surface_desc
.
dwWidth
=
4
;
U2
(
surface_desc
).
dwMipMapCount
=
2
;
hr
=
IDirectDraw7_CreateSurface
(
ddraw
,
&
surface_desc
,
&
surface
,
NULL
);
ok
(
SUCCEEDED
(
hr
),
"Failed to create surface, hr %#x.
\n
"
,
hr
);
hr
=
IDirectDrawSurface7_GetAttachedSurface
(
surface
,
&
caps
,
&
surface2
);
ok
(
SUCCEEDED
(
hr
),
"Failed to get attached surface, hr %#x.
\n
"
,
hr
);
hr
=
IDirectDrawSurface7_SetPrivateData
(
surface
,
&
IID_IDirect3D
,
data
,
sizeof
(
data
),
0
);
ok
(
SUCCEEDED
(
hr
),
"Failed to set private data, hr %#x.
\n
"
,
hr
);
hr
=
IDirectDrawSurface7_GetPrivateData
(
surface2
,
&
IID_IDirect3D
,
NULL
,
NULL
);
ok
(
hr
==
DDERR_NOTFOUND
,
"Got unexpected hr %#x.
\n
"
,
hr
);
IDirectDrawSurface7_Release
(
surface2
);
IDirectDrawSurface7_Release
(
surface
);
}
else
skip
(
"Mipmapped textures not supported, skipping mipmap private data test.
\n
"
);
refcount
=
IDirectDraw7_Release
(
ddraw
);
ok
(
!
refcount
,
"Got unexpected refcount %u.
\n
"
,
refcount
);
DestroyWindow
(
window
);
...
...
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