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
1d26724d
Commit
1d26724d
authored
Aug 11, 2019
by
Henri Verbeet
Committed by
Alexandre Julliard
Aug 12, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw/tests: Add a test for reported surface caps.
Signed-off-by:
Henri Verbeet
<
hverbeet@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
eeed9346
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
410 additions
and
0 deletions
+410
-0
ddraw1.c
dlls/ddraw/tests/ddraw1.c
+99
-0
ddraw2.c
dlls/ddraw/tests/ddraw2.c
+106
-0
ddraw4.c
dlls/ddraw/tests/ddraw4.c
+106
-0
ddraw7.c
dlls/ddraw/tests/ddraw7.c
+99
-0
No files found.
dlls/ddraw/tests/ddraw1.c
View file @
1d26724d
...
@@ -12890,9 +12890,44 @@ static void test_clipper_refcount(void)
...
@@ -12890,9 +12890,44 @@ static void test_clipper_refcount(void)
static
void
test_caps
(
void
)
static
void
test_caps
(
void
)
{
{
DWORD
caps_never
,
caps_always
,
caps_hal
;
DDCAPS
hal_caps
,
hel_caps
;
DDCAPS
hal_caps
,
hel_caps
;
IDirectDraw
*
ddraw
;
IDirectDraw
*
ddraw
;
HRESULT
hr
;
HRESULT
hr
;
BOOL
no3d
;
caps_never
=
DDSCAPS_RESERVED1
|
DDSCAPS_ALPHA
|
DDSCAPS_PRIMARYSURFACELEFT
|
DDSCAPS_SYSTEMMEMORY
|
DDSCAPS_VISIBLE
|
DDSCAPS_WRITEONLY
|
DDSCAPS_LIVEVIDEO
|
DDSCAPS_HWCODEC
|
DDSCAPS_MODEX
|
DDSCAPS_RESERVED2
|
0x01000000u
|
0x02000000u
|
DDSCAPS_ALLOCONLOAD
|
DDSCAPS_VIDEOPORT
|
DDSCAPS_STANDARDVGAMODE
|
DDSCAPS_OPTIMIZED
;
caps_always
=
DDSCAPS_FLIP
|
DDSCAPS_OFFSCREENPLAIN
|
DDSCAPS_PRIMARYSURFACE
|
DDSCAPS_TEXTURE
|
DDSCAPS_ZBUFFER
|
DDSCAPS_MIPMAP
;
caps_hal
=
DDSCAPS_BACKBUFFER
|
DDSCAPS_COMPLEX
|
DDSCAPS_FRONTBUFFER
|
DDSCAPS_3DDEVICE
|
DDSCAPS_VIDEOMEMORY
|
DDSCAPS_OWNDC
|
DDSCAPS_LOCALVIDMEM
|
DDSCAPS_NONLOCALVIDMEM
;
ddraw
=
create_ddraw
();
ddraw
=
create_ddraw
();
ok
(
!!
ddraw
,
"Failed to create a ddraw object.
\n
"
);
ok
(
!!
ddraw
,
"Failed to create a ddraw object.
\n
"
);
...
@@ -12910,6 +12945,70 @@ static void test_caps(void)
...
@@ -12910,6 +12945,70 @@ static void test_caps(void)
"Got unexpected caps %#x, expected %#x.
\n
"
,
"Got unexpected caps %#x, expected %#x.
\n
"
,
hel_caps
.
ddsOldCaps
.
dwCaps
,
hel_caps
.
ddsCaps
.
dwCaps
);
hel_caps
.
ddsOldCaps
.
dwCaps
,
hel_caps
.
ddsCaps
.
dwCaps
);
no3d
=
!
(
hal_caps
.
ddsCaps
.
dwCaps
&
DDSCAPS_3DDEVICE
);
if
(
hal_caps
.
ddsCaps
.
dwCaps
)
{
todo_wine
ok
(
!
(
hal_caps
.
ddsCaps
.
dwCaps
&
caps_never
),
"Got unexpected caps %#x.
\n
"
,
hal_caps
.
ddsCaps
.
dwCaps
);
todo_wine_if
(
no3d
)
ok
(
!
(
~
hal_caps
.
ddsCaps
.
dwCaps
&
caps_always
),
"Got unexpected caps %#x.
\n
"
,
hal_caps
.
ddsCaps
.
dwCaps
);
todo_wine
ok
(
!
(
~
hal_caps
.
ddsCaps
.
dwCaps
&
caps_hal
),
"Got unexpected caps %#x.
\n
"
,
hal_caps
.
ddsCaps
.
dwCaps
);
}
todo_wine
ok
(
!
(
hel_caps
.
ddsCaps
.
dwCaps
&
caps_never
),
"Got unexpected caps %#x.
\n
"
,
hel_caps
.
ddsCaps
.
dwCaps
);
todo_wine_if
(
no3d
)
ok
(
!
(
~
hel_caps
.
ddsCaps
.
dwCaps
&
caps_always
),
"Got unexpected caps %#x.
\n
"
,
hel_caps
.
ddsCaps
.
dwCaps
);
todo_wine
ok
(
!
(
hel_caps
.
ddsCaps
.
dwCaps
&
caps_hal
),
"Got unexpected caps %#x.
\n
"
,
hel_caps
.
ddsCaps
.
dwCaps
);
IDirectDraw_Release
(
ddraw
);
if
(
hal_caps
.
ddsCaps
.
dwCaps
)
{
hr
=
DirectDrawCreate
((
GUID
*
)
DDCREATE_HARDWAREONLY
,
&
ddraw
,
NULL
);
ok
(
hr
==
DD_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
memset
(
&
hal_caps
,
0
,
sizeof
(
hal_caps
));
memset
(
&
hel_caps
,
0
,
sizeof
(
hel_caps
));
hal_caps
.
dwSize
=
sizeof
(
hal_caps
);
hel_caps
.
dwSize
=
sizeof
(
hel_caps
);
hr
=
IDirectDraw_GetCaps
(
ddraw
,
&
hal_caps
,
&
hel_caps
);
ok
(
hr
==
DD_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
hal_caps
.
ddsOldCaps
.
dwCaps
==
hal_caps
.
ddsCaps
.
dwCaps
,
"Got unexpected caps %#x, expected %#x.
\n
"
,
hal_caps
.
ddsOldCaps
.
dwCaps
,
hal_caps
.
ddsCaps
.
dwCaps
);
ok
(
hel_caps
.
ddsOldCaps
.
dwCaps
==
hel_caps
.
ddsCaps
.
dwCaps
,
"Got unexpected caps %#x, expected %#x.
\n
"
,
hel_caps
.
ddsOldCaps
.
dwCaps
,
hel_caps
.
ddsCaps
.
dwCaps
);
todo_wine
ok
(
!
(
hal_caps
.
ddsCaps
.
dwCaps
&
caps_never
),
"Got unexpected caps %#x.
\n
"
,
hal_caps
.
ddsCaps
.
dwCaps
);
todo_wine_if
(
no3d
)
ok
(
!
(
~
hal_caps
.
ddsCaps
.
dwCaps
&
caps_always
),
"Got unexpected caps %#x.
\n
"
,
hal_caps
.
ddsCaps
.
dwCaps
);
todo_wine
ok
(
!
(
~
hal_caps
.
ddsCaps
.
dwCaps
&
caps_hal
),
"Got unexpected caps %#x.
\n
"
,
hal_caps
.
ddsCaps
.
dwCaps
);
todo_wine
ok
(
!
hel_caps
.
ddsCaps
.
dwCaps
,
"Got unexpected caps %#x.
\n
"
,
hel_caps
.
ddsCaps
.
dwCaps
);
IDirectDraw_Release
(
ddraw
);
}
hr
=
DirectDrawCreate
((
GUID
*
)
DDCREATE_EMULATIONONLY
,
&
ddraw
,
NULL
);
ok
(
hr
==
DD_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
memset
(
&
hal_caps
,
0
,
sizeof
(
hal_caps
));
memset
(
&
hel_caps
,
0
,
sizeof
(
hel_caps
));
hal_caps
.
dwSize
=
sizeof
(
hal_caps
);
hel_caps
.
dwSize
=
sizeof
(
hel_caps
);
hr
=
IDirectDraw_GetCaps
(
ddraw
,
&
hal_caps
,
&
hel_caps
);
ok
(
hr
==
DD_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
hal_caps
.
ddsOldCaps
.
dwCaps
==
hal_caps
.
ddsCaps
.
dwCaps
,
"Got unexpected caps %#x, expected %#x.
\n
"
,
hal_caps
.
ddsOldCaps
.
dwCaps
,
hal_caps
.
ddsCaps
.
dwCaps
);
ok
(
hel_caps
.
ddsOldCaps
.
dwCaps
==
hel_caps
.
ddsCaps
.
dwCaps
,
"Got unexpected caps %#x, expected %#x.
\n
"
,
hel_caps
.
ddsOldCaps
.
dwCaps
,
hel_caps
.
ddsCaps
.
dwCaps
);
todo_wine
ok
(
!
hal_caps
.
ddsCaps
.
dwCaps
,
"Got unexpected caps %#x.
\n
"
,
hal_caps
.
ddsCaps
.
dwCaps
);
todo_wine
ok
(
!
(
hel_caps
.
ddsCaps
.
dwCaps
&
caps_never
),
"Got unexpected caps %#x.
\n
"
,
hel_caps
.
ddsCaps
.
dwCaps
);
todo_wine_if
(
no3d
)
ok
(
!
(
~
hel_caps
.
ddsCaps
.
dwCaps
&
caps_always
),
"Got unexpected caps %#x.
\n
"
,
hel_caps
.
ddsCaps
.
dwCaps
);
todo_wine
ok
(
!
(
hel_caps
.
ddsCaps
.
dwCaps
&
caps_hal
),
"Got unexpected caps %#x.
\n
"
,
hel_caps
.
ddsCaps
.
dwCaps
);
IDirectDraw_Release
(
ddraw
);
IDirectDraw_Release
(
ddraw
);
}
}
...
...
dlls/ddraw/tests/ddraw2.c
View file @
1d26724d
...
@@ -13766,9 +13766,45 @@ static void test_clipper_refcount(void)
...
@@ -13766,9 +13766,45 @@ static void test_clipper_refcount(void)
static
void
test_caps
(
void
)
static
void
test_caps
(
void
)
{
{
DWORD
caps_never
,
caps_always
,
caps_hal
;
DDCAPS
hal_caps
,
hel_caps
;
DDCAPS
hal_caps
,
hel_caps
;
IDirectDraw2
*
ddraw
;
IDirectDraw2
*
ddraw
;
IDirectDraw
*
ddraw1
;
HRESULT
hr
;
HRESULT
hr
;
BOOL
no3d
;
caps_never
=
DDSCAPS_RESERVED1
|
DDSCAPS_ALPHA
|
DDSCAPS_PRIMARYSURFACELEFT
|
DDSCAPS_SYSTEMMEMORY
|
DDSCAPS_VISIBLE
|
DDSCAPS_WRITEONLY
|
DDSCAPS_LIVEVIDEO
|
DDSCAPS_HWCODEC
|
DDSCAPS_MODEX
|
DDSCAPS_RESERVED2
|
0x01000000u
|
0x02000000u
|
DDSCAPS_ALLOCONLOAD
|
DDSCAPS_VIDEOPORT
|
DDSCAPS_STANDARDVGAMODE
|
DDSCAPS_OPTIMIZED
;
caps_always
=
DDSCAPS_FLIP
|
DDSCAPS_OFFSCREENPLAIN
|
DDSCAPS_PRIMARYSURFACE
|
DDSCAPS_TEXTURE
|
DDSCAPS_ZBUFFER
|
DDSCAPS_MIPMAP
;
caps_hal
=
DDSCAPS_BACKBUFFER
|
DDSCAPS_COMPLEX
|
DDSCAPS_FRONTBUFFER
|
DDSCAPS_3DDEVICE
|
DDSCAPS_VIDEOMEMORY
|
DDSCAPS_OWNDC
|
DDSCAPS_LOCALVIDMEM
|
DDSCAPS_NONLOCALVIDMEM
;
ddraw
=
create_ddraw
();
ddraw
=
create_ddraw
();
ok
(
!!
ddraw
,
"Failed to create a ddraw object.
\n
"
);
ok
(
!!
ddraw
,
"Failed to create a ddraw object.
\n
"
);
...
@@ -13786,6 +13822,76 @@ static void test_caps(void)
...
@@ -13786,6 +13822,76 @@ static void test_caps(void)
"Got unexpected caps %#x, expected %#x.
\n
"
,
"Got unexpected caps %#x, expected %#x.
\n
"
,
hel_caps
.
ddsOldCaps
.
dwCaps
,
hel_caps
.
ddsCaps
.
dwCaps
);
hel_caps
.
ddsOldCaps
.
dwCaps
,
hel_caps
.
ddsCaps
.
dwCaps
);
no3d
=
!
(
hal_caps
.
ddsCaps
.
dwCaps
&
DDSCAPS_3DDEVICE
);
if
(
hal_caps
.
ddsCaps
.
dwCaps
)
{
todo_wine
ok
(
!
(
hal_caps
.
ddsCaps
.
dwCaps
&
caps_never
),
"Got unexpected caps %#x.
\n
"
,
hal_caps
.
ddsCaps
.
dwCaps
);
todo_wine_if
(
no3d
)
ok
(
!
(
~
hal_caps
.
ddsCaps
.
dwCaps
&
caps_always
),
"Got unexpected caps %#x.
\n
"
,
hal_caps
.
ddsCaps
.
dwCaps
);
todo_wine
ok
(
!
(
~
hal_caps
.
ddsCaps
.
dwCaps
&
caps_hal
),
"Got unexpected caps %#x.
\n
"
,
hal_caps
.
ddsCaps
.
dwCaps
);
}
todo_wine
ok
(
!
(
hel_caps
.
ddsCaps
.
dwCaps
&
caps_never
),
"Got unexpected caps %#x.
\n
"
,
hel_caps
.
ddsCaps
.
dwCaps
);
todo_wine_if
(
no3d
)
ok
(
!
(
~
hel_caps
.
ddsCaps
.
dwCaps
&
caps_always
),
"Got unexpected caps %#x.
\n
"
,
hel_caps
.
ddsCaps
.
dwCaps
);
todo_wine
ok
(
!
(
hel_caps
.
ddsCaps
.
dwCaps
&
caps_hal
),
"Got unexpected caps %#x.
\n
"
,
hel_caps
.
ddsCaps
.
dwCaps
);
IDirectDraw2_Release
(
ddraw
);
if
(
hal_caps
.
ddsCaps
.
dwCaps
)
{
hr
=
DirectDrawCreate
((
GUID
*
)
DDCREATE_HARDWAREONLY
,
&
ddraw1
,
NULL
);
ok
(
hr
==
DD_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
hr
=
IDirectDraw_QueryInterface
(
ddraw1
,
&
IID_IDirectDraw2
,
(
void
**
)
&
ddraw
);
ok
(
hr
==
DD_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
IDirectDraw_Release
(
ddraw1
);
memset
(
&
hal_caps
,
0
,
sizeof
(
hal_caps
));
memset
(
&
hel_caps
,
0
,
sizeof
(
hel_caps
));
hal_caps
.
dwSize
=
sizeof
(
hal_caps
);
hel_caps
.
dwSize
=
sizeof
(
hel_caps
);
hr
=
IDirectDraw2_GetCaps
(
ddraw
,
&
hal_caps
,
&
hel_caps
);
ok
(
hr
==
DD_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
hal_caps
.
ddsOldCaps
.
dwCaps
==
hal_caps
.
ddsCaps
.
dwCaps
,
"Got unexpected caps %#x, expected %#x.
\n
"
,
hal_caps
.
ddsOldCaps
.
dwCaps
,
hal_caps
.
ddsCaps
.
dwCaps
);
ok
(
hel_caps
.
ddsOldCaps
.
dwCaps
==
hel_caps
.
ddsCaps
.
dwCaps
,
"Got unexpected caps %#x, expected %#x.
\n
"
,
hel_caps
.
ddsOldCaps
.
dwCaps
,
hel_caps
.
ddsCaps
.
dwCaps
);
todo_wine
ok
(
!
(
hal_caps
.
ddsCaps
.
dwCaps
&
caps_never
),
"Got unexpected caps %#x.
\n
"
,
hal_caps
.
ddsCaps
.
dwCaps
);
todo_wine_if
(
no3d
)
ok
(
!
(
~
hal_caps
.
ddsCaps
.
dwCaps
&
caps_always
),
"Got unexpected caps %#x.
\n
"
,
hal_caps
.
ddsCaps
.
dwCaps
);
todo_wine
ok
(
!
(
~
hal_caps
.
ddsCaps
.
dwCaps
&
caps_hal
),
"Got unexpected caps %#x.
\n
"
,
hal_caps
.
ddsCaps
.
dwCaps
);
todo_wine
ok
(
!
hel_caps
.
ddsCaps
.
dwCaps
,
"Got unexpected caps %#x.
\n
"
,
hel_caps
.
ddsCaps
.
dwCaps
);
IDirectDraw2_Release
(
ddraw
);
}
hr
=
DirectDrawCreate
((
GUID
*
)
DDCREATE_EMULATIONONLY
,
&
ddraw1
,
NULL
);
ok
(
hr
==
DD_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
hr
=
IDirectDraw_QueryInterface
(
ddraw1
,
&
IID_IDirectDraw2
,
(
void
**
)
&
ddraw
);
ok
(
hr
==
DD_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
IDirectDraw_Release
(
ddraw1
);
memset
(
&
hal_caps
,
0
,
sizeof
(
hal_caps
));
memset
(
&
hel_caps
,
0
,
sizeof
(
hel_caps
));
hal_caps
.
dwSize
=
sizeof
(
hal_caps
);
hel_caps
.
dwSize
=
sizeof
(
hel_caps
);
hr
=
IDirectDraw2_GetCaps
(
ddraw
,
&
hal_caps
,
&
hel_caps
);
ok
(
hr
==
DD_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
hal_caps
.
ddsOldCaps
.
dwCaps
==
hal_caps
.
ddsCaps
.
dwCaps
,
"Got unexpected caps %#x, expected %#x.
\n
"
,
hal_caps
.
ddsOldCaps
.
dwCaps
,
hal_caps
.
ddsCaps
.
dwCaps
);
ok
(
hel_caps
.
ddsOldCaps
.
dwCaps
==
hel_caps
.
ddsCaps
.
dwCaps
,
"Got unexpected caps %#x, expected %#x.
\n
"
,
hel_caps
.
ddsOldCaps
.
dwCaps
,
hel_caps
.
ddsCaps
.
dwCaps
);
todo_wine
ok
(
!
hal_caps
.
ddsCaps
.
dwCaps
,
"Got unexpected caps %#x.
\n
"
,
hal_caps
.
ddsCaps
.
dwCaps
);
todo_wine
ok
(
!
(
hel_caps
.
ddsCaps
.
dwCaps
&
caps_never
),
"Got unexpected caps %#x.
\n
"
,
hel_caps
.
ddsCaps
.
dwCaps
);
todo_wine_if
(
no3d
)
ok
(
!
(
~
hel_caps
.
ddsCaps
.
dwCaps
&
caps_always
),
"Got unexpected caps %#x.
\n
"
,
hel_caps
.
ddsCaps
.
dwCaps
);
todo_wine
ok
(
!
(
hel_caps
.
ddsCaps
.
dwCaps
&
caps_hal
),
"Got unexpected caps %#x.
\n
"
,
hel_caps
.
ddsCaps
.
dwCaps
);
IDirectDraw2_Release
(
ddraw
);
IDirectDraw2_Release
(
ddraw
);
}
}
...
...
dlls/ddraw/tests/ddraw4.c
View file @
1d26724d
...
@@ -16327,9 +16327,45 @@ static void test_clipper_refcount(void)
...
@@ -16327,9 +16327,45 @@ static void test_clipper_refcount(void)
static
void
test_caps
(
void
)
static
void
test_caps
(
void
)
{
{
DWORD
caps_never
,
caps_always
,
caps_hal
;
DDCAPS
hal_caps
,
hel_caps
;
DDCAPS
hal_caps
,
hel_caps
;
IDirectDraw4
*
ddraw
;
IDirectDraw4
*
ddraw
;
IDirectDraw
*
ddraw1
;
HRESULT
hr
;
HRESULT
hr
;
BOOL
no3d
;
caps_never
=
DDSCAPS_RESERVED1
|
DDSCAPS_ALPHA
|
DDSCAPS_PRIMARYSURFACELEFT
|
DDSCAPS_SYSTEMMEMORY
|
DDSCAPS_VISIBLE
|
DDSCAPS_WRITEONLY
|
DDSCAPS_LIVEVIDEO
|
DDSCAPS_HWCODEC
|
DDSCAPS_MODEX
|
DDSCAPS_RESERVED2
|
0x01000000u
|
0x02000000u
|
DDSCAPS_ALLOCONLOAD
|
DDSCAPS_VIDEOPORT
|
DDSCAPS_STANDARDVGAMODE
|
DDSCAPS_OPTIMIZED
;
caps_always
=
DDSCAPS_FLIP
|
DDSCAPS_OFFSCREENPLAIN
|
DDSCAPS_PRIMARYSURFACE
|
DDSCAPS_TEXTURE
|
DDSCAPS_ZBUFFER
|
DDSCAPS_MIPMAP
;
caps_hal
=
DDSCAPS_BACKBUFFER
|
DDSCAPS_COMPLEX
|
DDSCAPS_FRONTBUFFER
|
DDSCAPS_3DDEVICE
|
DDSCAPS_VIDEOMEMORY
|
DDSCAPS_OWNDC
|
DDSCAPS_LOCALVIDMEM
|
DDSCAPS_NONLOCALVIDMEM
;
ddraw
=
create_ddraw
();
ddraw
=
create_ddraw
();
ok
(
!!
ddraw
,
"Failed to create a ddraw object.
\n
"
);
ok
(
!!
ddraw
,
"Failed to create a ddraw object.
\n
"
);
...
@@ -16347,6 +16383,76 @@ static void test_caps(void)
...
@@ -16347,6 +16383,76 @@ static void test_caps(void)
"Got unexpected caps %#x, expected %#x.
\n
"
,
"Got unexpected caps %#x, expected %#x.
\n
"
,
hel_caps
.
ddsOldCaps
.
dwCaps
,
hel_caps
.
ddsCaps
.
dwCaps
);
hel_caps
.
ddsOldCaps
.
dwCaps
,
hel_caps
.
ddsCaps
.
dwCaps
);
no3d
=
!
(
hal_caps
.
ddsCaps
.
dwCaps
&
DDSCAPS_3DDEVICE
);
if
(
hal_caps
.
ddsCaps
.
dwCaps
)
{
todo_wine
ok
(
!
(
hal_caps
.
ddsCaps
.
dwCaps
&
caps_never
),
"Got unexpected caps %#x.
\n
"
,
hal_caps
.
ddsCaps
.
dwCaps
);
todo_wine_if
(
no3d
)
ok
(
!
(
~
hal_caps
.
ddsCaps
.
dwCaps
&
caps_always
),
"Got unexpected caps %#x.
\n
"
,
hal_caps
.
ddsCaps
.
dwCaps
);
todo_wine
ok
(
!
(
~
hal_caps
.
ddsCaps
.
dwCaps
&
caps_hal
),
"Got unexpected caps %#x.
\n
"
,
hal_caps
.
ddsCaps
.
dwCaps
);
}
todo_wine
ok
(
!
(
hel_caps
.
ddsCaps
.
dwCaps
&
caps_never
),
"Got unexpected caps %#x.
\n
"
,
hel_caps
.
ddsCaps
.
dwCaps
);
todo_wine_if
(
no3d
)
ok
(
!
(
~
hel_caps
.
ddsCaps
.
dwCaps
&
caps_always
),
"Got unexpected caps %#x.
\n
"
,
hel_caps
.
ddsCaps
.
dwCaps
);
todo_wine
ok
(
!
(
hel_caps
.
ddsCaps
.
dwCaps
&
caps_hal
),
"Got unexpected caps %#x.
\n
"
,
hel_caps
.
ddsCaps
.
dwCaps
);
IDirectDraw4_Release
(
ddraw
);
if
(
hal_caps
.
ddsCaps
.
dwCaps
)
{
hr
=
DirectDrawCreate
((
GUID
*
)
DDCREATE_HARDWAREONLY
,
&
ddraw1
,
NULL
);
ok
(
hr
==
DD_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
hr
=
IDirectDraw_QueryInterface
(
ddraw1
,
&
IID_IDirectDraw4
,
(
void
**
)
&
ddraw
);
ok
(
hr
==
DD_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
IDirectDraw_Release
(
ddraw1
);
memset
(
&
hal_caps
,
0
,
sizeof
(
hal_caps
));
memset
(
&
hel_caps
,
0
,
sizeof
(
hel_caps
));
hal_caps
.
dwSize
=
sizeof
(
hal_caps
);
hel_caps
.
dwSize
=
sizeof
(
hel_caps
);
hr
=
IDirectDraw4_GetCaps
(
ddraw
,
&
hal_caps
,
&
hel_caps
);
ok
(
hr
==
DD_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
hal_caps
.
ddsOldCaps
.
dwCaps
==
hal_caps
.
ddsCaps
.
dwCaps
,
"Got unexpected caps %#x, expected %#x.
\n
"
,
hal_caps
.
ddsOldCaps
.
dwCaps
,
hal_caps
.
ddsCaps
.
dwCaps
);
ok
(
hel_caps
.
ddsOldCaps
.
dwCaps
==
hel_caps
.
ddsCaps
.
dwCaps
,
"Got unexpected caps %#x, expected %#x.
\n
"
,
hel_caps
.
ddsOldCaps
.
dwCaps
,
hel_caps
.
ddsCaps
.
dwCaps
);
todo_wine
ok
(
!
(
hal_caps
.
ddsCaps
.
dwCaps
&
caps_never
),
"Got unexpected caps %#x.
\n
"
,
hal_caps
.
ddsCaps
.
dwCaps
);
todo_wine_if
(
no3d
)
ok
(
!
(
~
hal_caps
.
ddsCaps
.
dwCaps
&
caps_always
),
"Got unexpected caps %#x.
\n
"
,
hal_caps
.
ddsCaps
.
dwCaps
);
todo_wine
ok
(
!
(
~
hal_caps
.
ddsCaps
.
dwCaps
&
caps_hal
),
"Got unexpected caps %#x.
\n
"
,
hal_caps
.
ddsCaps
.
dwCaps
);
todo_wine
ok
(
!
hel_caps
.
ddsCaps
.
dwCaps
,
"Got unexpected caps %#x.
\n
"
,
hel_caps
.
ddsCaps
.
dwCaps
);
IDirectDraw4_Release
(
ddraw
);
}
hr
=
DirectDrawCreate
((
GUID
*
)
DDCREATE_EMULATIONONLY
,
&
ddraw1
,
NULL
);
ok
(
hr
==
DD_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
hr
=
IDirectDraw_QueryInterface
(
ddraw1
,
&
IID_IDirectDraw4
,
(
void
**
)
&
ddraw
);
ok
(
hr
==
DD_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
IDirectDraw_Release
(
ddraw1
);
memset
(
&
hal_caps
,
0
,
sizeof
(
hal_caps
));
memset
(
&
hel_caps
,
0
,
sizeof
(
hel_caps
));
hal_caps
.
dwSize
=
sizeof
(
hal_caps
);
hel_caps
.
dwSize
=
sizeof
(
hel_caps
);
hr
=
IDirectDraw4_GetCaps
(
ddraw
,
&
hal_caps
,
&
hel_caps
);
ok
(
hr
==
DD_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
hal_caps
.
ddsOldCaps
.
dwCaps
==
hal_caps
.
ddsCaps
.
dwCaps
,
"Got unexpected caps %#x, expected %#x.
\n
"
,
hal_caps
.
ddsOldCaps
.
dwCaps
,
hal_caps
.
ddsCaps
.
dwCaps
);
ok
(
hel_caps
.
ddsOldCaps
.
dwCaps
==
hel_caps
.
ddsCaps
.
dwCaps
,
"Got unexpected caps %#x, expected %#x.
\n
"
,
hel_caps
.
ddsOldCaps
.
dwCaps
,
hel_caps
.
ddsCaps
.
dwCaps
);
todo_wine
ok
(
!
hal_caps
.
ddsCaps
.
dwCaps
,
"Got unexpected caps %#x.
\n
"
,
hal_caps
.
ddsCaps
.
dwCaps
);
todo_wine
ok
(
!
(
hel_caps
.
ddsCaps
.
dwCaps
&
caps_never
),
"Got unexpected caps %#x.
\n
"
,
hel_caps
.
ddsCaps
.
dwCaps
);
todo_wine_if
(
no3d
)
ok
(
!
(
~
hel_caps
.
ddsCaps
.
dwCaps
&
caps_always
),
"Got unexpected caps %#x.
\n
"
,
hel_caps
.
ddsCaps
.
dwCaps
);
todo_wine
ok
(
!
(
hel_caps
.
ddsCaps
.
dwCaps
&
caps_hal
),
"Got unexpected caps %#x.
\n
"
,
hel_caps
.
ddsCaps
.
dwCaps
);
IDirectDraw4_Release
(
ddraw
);
IDirectDraw4_Release
(
ddraw
);
}
}
...
...
dlls/ddraw/tests/ddraw7.c
View file @
1d26724d
...
@@ -16300,9 +16300,44 @@ static void test_begin_end_state_block(void)
...
@@ -16300,9 +16300,44 @@ static void test_begin_end_state_block(void)
static
void
test_caps
(
void
)
static
void
test_caps
(
void
)
{
{
DWORD
caps_never
,
caps_always
,
caps_hal
;
DDCAPS
hal_caps
,
hel_caps
;
DDCAPS
hal_caps
,
hel_caps
;
IDirectDraw7
*
ddraw
;
IDirectDraw7
*
ddraw
;
HRESULT
hr
;
HRESULT
hr
;
BOOL
no3d
;
caps_never
=
DDSCAPS_RESERVED1
|
DDSCAPS_ALPHA
|
DDSCAPS_PRIMARYSURFACELEFT
|
DDSCAPS_SYSTEMMEMORY
|
DDSCAPS_VISIBLE
|
DDSCAPS_WRITEONLY
|
DDSCAPS_LIVEVIDEO
|
DDSCAPS_HWCODEC
|
DDSCAPS_MODEX
|
DDSCAPS_RESERVED2
|
0x01000000u
|
0x02000000u
|
DDSCAPS_ALLOCONLOAD
|
DDSCAPS_VIDEOPORT
|
DDSCAPS_STANDARDVGAMODE
|
DDSCAPS_OPTIMIZED
;
caps_always
=
DDSCAPS_FLIP
|
DDSCAPS_OFFSCREENPLAIN
|
DDSCAPS_PRIMARYSURFACE
|
DDSCAPS_TEXTURE
|
DDSCAPS_ZBUFFER
|
DDSCAPS_MIPMAP
;
caps_hal
=
DDSCAPS_BACKBUFFER
|
DDSCAPS_COMPLEX
|
DDSCAPS_FRONTBUFFER
|
DDSCAPS_3DDEVICE
|
DDSCAPS_VIDEOMEMORY
|
DDSCAPS_OWNDC
|
DDSCAPS_LOCALVIDMEM
|
DDSCAPS_NONLOCALVIDMEM
;
ddraw
=
create_ddraw
();
ddraw
=
create_ddraw
();
ok
(
!!
ddraw
,
"Failed to create a ddraw object.
\n
"
);
ok
(
!!
ddraw
,
"Failed to create a ddraw object.
\n
"
);
...
@@ -16320,6 +16355,70 @@ static void test_caps(void)
...
@@ -16320,6 +16355,70 @@ static void test_caps(void)
"Got unexpected caps %#x, expected %#x.
\n
"
,
"Got unexpected caps %#x, expected %#x.
\n
"
,
hel_caps
.
ddsOldCaps
.
dwCaps
,
hel_caps
.
ddsCaps
.
dwCaps
);
hel_caps
.
ddsOldCaps
.
dwCaps
,
hel_caps
.
ddsCaps
.
dwCaps
);
no3d
=
!
(
hal_caps
.
ddsCaps
.
dwCaps
&
DDSCAPS_3DDEVICE
);
if
(
hal_caps
.
ddsCaps
.
dwCaps
)
{
todo_wine
ok
(
!
(
hal_caps
.
ddsCaps
.
dwCaps
&
caps_never
),
"Got unexpected caps %#x.
\n
"
,
hal_caps
.
ddsCaps
.
dwCaps
);
todo_wine_if
(
no3d
)
ok
(
!
(
~
hal_caps
.
ddsCaps
.
dwCaps
&
caps_always
),
"Got unexpected caps %#x.
\n
"
,
hal_caps
.
ddsCaps
.
dwCaps
);
todo_wine
ok
(
!
(
~
hal_caps
.
ddsCaps
.
dwCaps
&
caps_hal
),
"Got unexpected caps %#x.
\n
"
,
hal_caps
.
ddsCaps
.
dwCaps
);
}
todo_wine
ok
(
!
(
hel_caps
.
ddsCaps
.
dwCaps
&
caps_never
),
"Got unexpected caps %#x.
\n
"
,
hel_caps
.
ddsCaps
.
dwCaps
);
todo_wine_if
(
no3d
)
ok
(
!
(
~
hel_caps
.
ddsCaps
.
dwCaps
&
caps_always
),
"Got unexpected caps %#x.
\n
"
,
hel_caps
.
ddsCaps
.
dwCaps
);
todo_wine
ok
(
!
(
hel_caps
.
ddsCaps
.
dwCaps
&
caps_hal
),
"Got unexpected caps %#x.
\n
"
,
hel_caps
.
ddsCaps
.
dwCaps
);
IDirectDraw7_Release
(
ddraw
);
if
(
hal_caps
.
ddsCaps
.
dwCaps
)
{
hr
=
pDirectDrawCreateEx
((
GUID
*
)
DDCREATE_HARDWAREONLY
,
(
void
**
)
&
ddraw
,
&
IID_IDirectDraw7
,
NULL
);
ok
(
hr
==
DD_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
memset
(
&
hal_caps
,
0
,
sizeof
(
hal_caps
));
memset
(
&
hel_caps
,
0
,
sizeof
(
hel_caps
));
hal_caps
.
dwSize
=
sizeof
(
hal_caps
);
hel_caps
.
dwSize
=
sizeof
(
hel_caps
);
hr
=
IDirectDraw7_GetCaps
(
ddraw
,
&
hal_caps
,
&
hel_caps
);
ok
(
hr
==
DD_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
hal_caps
.
ddsOldCaps
.
dwCaps
==
hal_caps
.
ddsCaps
.
dwCaps
,
"Got unexpected caps %#x, expected %#x.
\n
"
,
hal_caps
.
ddsOldCaps
.
dwCaps
,
hal_caps
.
ddsCaps
.
dwCaps
);
ok
(
hel_caps
.
ddsOldCaps
.
dwCaps
==
hel_caps
.
ddsCaps
.
dwCaps
,
"Got unexpected caps %#x, expected %#x.
\n
"
,
hel_caps
.
ddsOldCaps
.
dwCaps
,
hel_caps
.
ddsCaps
.
dwCaps
);
todo_wine
ok
(
!
(
hal_caps
.
ddsCaps
.
dwCaps
&
caps_never
),
"Got unexpected caps %#x.
\n
"
,
hal_caps
.
ddsCaps
.
dwCaps
);
todo_wine_if
(
no3d
)
ok
(
!
(
~
hal_caps
.
ddsCaps
.
dwCaps
&
caps_always
),
"Got unexpected caps %#x.
\n
"
,
hal_caps
.
ddsCaps
.
dwCaps
);
todo_wine
ok
(
!
(
~
hal_caps
.
ddsCaps
.
dwCaps
&
caps_hal
),
"Got unexpected caps %#x.
\n
"
,
hal_caps
.
ddsCaps
.
dwCaps
);
todo_wine
ok
(
!
hel_caps
.
ddsCaps
.
dwCaps
,
"Got unexpected caps %#x.
\n
"
,
hel_caps
.
ddsCaps
.
dwCaps
);
IDirectDraw7_Release
(
ddraw
);
}
hr
=
pDirectDrawCreateEx
((
GUID
*
)
DDCREATE_EMULATIONONLY
,
(
void
**
)
&
ddraw
,
&
IID_IDirectDraw7
,
NULL
);
ok
(
hr
==
DD_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
memset
(
&
hal_caps
,
0
,
sizeof
(
hal_caps
));
memset
(
&
hel_caps
,
0
,
sizeof
(
hel_caps
));
hal_caps
.
dwSize
=
sizeof
(
hal_caps
);
hel_caps
.
dwSize
=
sizeof
(
hel_caps
);
hr
=
IDirectDraw7_GetCaps
(
ddraw
,
&
hal_caps
,
&
hel_caps
);
ok
(
hr
==
DD_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
hal_caps
.
ddsOldCaps
.
dwCaps
==
hal_caps
.
ddsCaps
.
dwCaps
,
"Got unexpected caps %#x, expected %#x.
\n
"
,
hal_caps
.
ddsOldCaps
.
dwCaps
,
hal_caps
.
ddsCaps
.
dwCaps
);
ok
(
hel_caps
.
ddsOldCaps
.
dwCaps
==
hel_caps
.
ddsCaps
.
dwCaps
,
"Got unexpected caps %#x, expected %#x.
\n
"
,
hel_caps
.
ddsOldCaps
.
dwCaps
,
hel_caps
.
ddsCaps
.
dwCaps
);
todo_wine
ok
(
!
hal_caps
.
ddsCaps
.
dwCaps
,
"Got unexpected caps %#x.
\n
"
,
hal_caps
.
ddsCaps
.
dwCaps
);
todo_wine
ok
(
!
(
hel_caps
.
ddsCaps
.
dwCaps
&
caps_never
),
"Got unexpected caps %#x.
\n
"
,
hel_caps
.
ddsCaps
.
dwCaps
);
todo_wine_if
(
no3d
)
ok
(
!
(
~
hel_caps
.
ddsCaps
.
dwCaps
&
caps_always
),
"Got unexpected caps %#x.
\n
"
,
hel_caps
.
ddsCaps
.
dwCaps
);
todo_wine
ok
(
!
(
hel_caps
.
ddsCaps
.
dwCaps
&
caps_hal
),
"Got unexpected caps %#x.
\n
"
,
hel_caps
.
ddsCaps
.
dwCaps
);
IDirectDraw7_Release
(
ddraw
);
IDirectDraw7_Release
(
ddraw
);
}
}
...
...
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