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
f637c229
Commit
f637c229
authored
Dec 05, 2013
by
Henri Verbeet
Committed by
Alexandre Julliard
Dec 05, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw/tests: Add a test for primary surface capabilities.
parent
8797a9ed
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
628 additions
and
0 deletions
+628
-0
ddraw1.c
dlls/ddraw/tests/ddraw1.c
+157
-0
ddraw2.c
dlls/ddraw/tests/ddraw2.c
+157
-0
ddraw4.c
dlls/ddraw/tests/ddraw4.c
+157
-0
ddraw7.c
dlls/ddraw/tests/ddraw7.c
+157
-0
No files found.
dlls/ddraw/tests/ddraw1.c
View file @
f637c229
...
...
@@ -3322,6 +3322,162 @@ done:
DestroyWindow
(
window
);
}
static
void
test_primary_caps
(
void
)
{
const
DWORD
placement
=
DDSCAPS_LOCALVIDMEM
|
DDSCAPS_VIDEOMEMORY
|
DDSCAPS_SYSTEMMEMORY
;
IDirectDrawSurface
*
surface
;
DDSURFACEDESC
surface_desc
;
IDirectDraw
*
ddraw
;
unsigned
int
i
;
ULONG
refcount
;
HWND
window
;
HRESULT
hr
;
static
const
struct
{
DWORD
coop_level
;
DWORD
caps_in
;
DWORD
back_buffer_count
;
HRESULT
hr
;
DWORD
caps_out
;
}
test_data
[]
=
{
{
DDSCL_NORMAL
,
DDSCAPS_PRIMARYSURFACE
,
~
0u
,
DD_OK
,
DDSCAPS_VIS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SCAPS_FLIP
,
1
,
DD_OK
,
DDSCAPS_VISIBLE
|
DDSCAPS_PRIMARYSURFACE
|
DDSCAPS_FRONTBUFFER
|
DDSCAPS_FLIP
|
DDSCAPS_COMPLEX
,
},
{
DDSCL_EXCLUSIVE
|
DDSCL_FULLSCREEN
,
DDSCAPS_PRIMARYSURFACE
|
DDSCAPS_COMPLEX
|
DDSCAPS_FLIP
|
DDSCAPS_FRONTBUFFER
,
1
,
DDERR_INVALIDCAPS
,
~
0u
,
},
{
DDSCL_EXCLUSIVE
|
DDSCL_FULLSCREEN
,
DDSCAPS_PRIMARYSURFACE
|
DDSCAPS_COMPLEX
|
DDSCAPS_FLIP
|
DDSCAPS_BACKBUFFER
,
1
,
DDERR_INVALIDCAPS
,
~
0u
,
},
};
if
(
!
(
ddraw
=
create_ddraw
()))
{
skip
(
"Failed to create a ddraw object, skipping test.
\n
"
);
return
;
}
window
=
CreateWindowA
(
"static"
,
"ddraw_test"
,
WS_OVERLAPPEDWINDOW
,
0
,
0
,
640
,
480
,
0
,
0
,
0
,
0
);
for
(
i
=
0
;
i
<
sizeof
(
test_data
)
/
sizeof
(
*
test_data
);
++
i
)
{
hr
=
IDirectDraw_SetCooperativeLevel
(
ddraw
,
window
,
test_data
[
i
].
coop_level
);
ok
(
SUCCEEDED
(
hr
),
"Failed to set cooperative level, hr %#x.
\n
"
,
hr
);
memset
(
&
surface_desc
,
0
,
sizeof
(
surface_desc
));
surface_desc
.
dwSize
=
sizeof
(
surface_desc
);
surface_desc
.
dwFlags
=
DDSD_CAPS
;
if
(
test_data
[
i
].
back_buffer_count
!=
~
0u
)
surface_desc
.
dwFlags
|=
DDSD_BACKBUFFERCOUNT
;
surface_desc
.
ddsCaps
.
dwCaps
=
test_data
[
i
].
caps_in
;
surface_desc
.
dwBackBufferCount
=
test_data
[
i
].
back_buffer_count
;
hr
=
IDirectDraw_CreateSurface
(
ddraw
,
&
surface_desc
,
&
surface
,
NULL
);
ok
(
hr
==
test_data
[
i
].
hr
,
"Test %u: Got unexpected hr %#x, expected %#x.
\n
"
,
i
,
hr
,
test_data
[
i
].
hr
);
if
(
FAILED
(
hr
))
continue
;
memset
(
&
surface_desc
,
0
,
sizeof
(
surface_desc
));
surface_desc
.
dwSize
=
sizeof
(
surface_desc
);
hr
=
IDirectDrawSurface_GetSurfaceDesc
(
surface
,
&
surface_desc
);
ok
(
SUCCEEDED
(
hr
),
"Test %u: Failed to get surface desc, hr %#x.
\n
"
,
i
,
hr
);
ok
((
surface_desc
.
ddsCaps
.
dwCaps
&
~
placement
)
==
test_data
[
i
].
caps_out
,
"Test %u: Got unexpected caps %#x, expected %#x.
\n
"
,
i
,
surface_desc
.
ddsCaps
.
dwCaps
,
test_data
[
i
].
caps_out
);
IDirectDrawSurface_Release
(
surface
);
}
refcount
=
IDirectDraw_Release
(
ddraw
);
ok
(
refcount
==
0
,
"The ddraw object was not properly freed, refcount %u.
\n
"
,
refcount
);
DestroyWindow
(
window
);
}
static
void
test_surface_lock
(
void
)
{
IDirectDraw
*
ddraw
;
...
...
@@ -3741,6 +3897,7 @@ START_TEST(ddraw1)
test_coop_level_activateapp
();
test_unsupported_formats
();
test_rt_caps
();
test_primary_caps
();
test_surface_lock
();
test_surface_discard
();
test_flip
();
...
...
dlls/ddraw/tests/ddraw2.c
View file @
f637c229
...
...
@@ -4004,6 +4004,162 @@ done:
DestroyWindow
(
window
);
}
static
void
test_primary_caps
(
void
)
{
const
DWORD
placement
=
DDSCAPS_LOCALVIDMEM
|
DDSCAPS_VIDEOMEMORY
|
DDSCAPS_SYSTEMMEMORY
;
IDirectDrawSurface
*
surface
;
DDSURFACEDESC
surface_desc
;
IDirectDraw2
*
ddraw
;
unsigned
int
i
;
ULONG
refcount
;
HWND
window
;
HRESULT
hr
;
static
const
struct
{
DWORD
coop_level
;
DWORD
caps_in
;
DWORD
back_buffer_count
;
HRESULT
hr
;
DWORD
caps_out
;
}
test_data
[]
=
{
{
DDSCL_NORMAL
,
DDSCAPS_PRIMARYS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,
1
,
DD_OK
,
DDSCAPS_VISIBLE
|
DDSCAPS_PRIMARYSURFACE
|
DDSCAPS_FRONTBUFFER
|
DDSCAPS_FLIP
|
DDSCAPS_COMPLEX
,
},
{
DDSCL_EXCLUSIVE
|
DDSCL_FULLSCREEN
,
DDSCAPS_PRIMARYSURFACE
|
DDSCAPS_COMPLEX
|
DDSCAPS_FLIP
|
DDSCAPS_FRONTBUFFER
,
1
,
DDERR_INVALIDCAPS
,
~
0u
,
},
{
DDSCL_EXCLUSIVE
|
DDSCL_FULLSCREEN
,
DDSCAPS_PRIMARYSURFACE
|
DDSCAPS_COMPLEX
|
DDSCAPS_FLIP
|
DDSCAPS_BACKBUFFER
,
1
,
DDERR_INVALIDCAPS
,
~
0u
,
},
};
if
(
!
(
ddraw
=
create_ddraw
()))
{
skip
(
"Failed to create a ddraw object, skipping test.
\n
"
);
return
;
}
window
=
CreateWindowA
(
"static"
,
"ddraw_test"
,
WS_OVERLAPPEDWINDOW
,
0
,
0
,
640
,
480
,
0
,
0
,
0
,
0
);
for
(
i
=
0
;
i
<
sizeof
(
test_data
)
/
sizeof
(
*
test_data
);
++
i
)
{
hr
=
IDirectDraw2_SetCooperativeLevel
(
ddraw
,
window
,
test_data
[
i
].
coop_level
);
ok
(
SUCCEEDED
(
hr
),
"Failed to set cooperative level, hr %#x.
\n
"
,
hr
);
memset
(
&
surface_desc
,
0
,
sizeof
(
surface_desc
));
surface_desc
.
dwSize
=
sizeof
(
surface_desc
);
surface_desc
.
dwFlags
=
DDSD_CAPS
;
if
(
test_data
[
i
].
back_buffer_count
!=
~
0u
)
surface_desc
.
dwFlags
|=
DDSD_BACKBUFFERCOUNT
;
surface_desc
.
ddsCaps
.
dwCaps
=
test_data
[
i
].
caps_in
;
surface_desc
.
dwBackBufferCount
=
test_data
[
i
].
back_buffer_count
;
hr
=
IDirectDraw2_CreateSurface
(
ddraw
,
&
surface_desc
,
&
surface
,
NULL
);
ok
(
hr
==
test_data
[
i
].
hr
,
"Test %u: Got unexpected hr %#x, expected %#x.
\n
"
,
i
,
hr
,
test_data
[
i
].
hr
);
if
(
FAILED
(
hr
))
continue
;
memset
(
&
surface_desc
,
0
,
sizeof
(
surface_desc
));
surface_desc
.
dwSize
=
sizeof
(
surface_desc
);
hr
=
IDirectDrawSurface_GetSurfaceDesc
(
surface
,
&
surface_desc
);
ok
(
SUCCEEDED
(
hr
),
"Test %u: Failed to get surface desc, hr %#x.
\n
"
,
i
,
hr
);
ok
((
surface_desc
.
ddsCaps
.
dwCaps
&
~
placement
)
==
test_data
[
i
].
caps_out
,
"Test %u: Got unexpected caps %#x, expected %#x.
\n
"
,
i
,
surface_desc
.
ddsCaps
.
dwCaps
,
test_data
[
i
].
caps_out
);
IDirectDrawSurface_Release
(
surface
);
}
refcount
=
IDirectDraw2_Release
(
ddraw
);
ok
(
refcount
==
0
,
"The ddraw object was not properly freed, refcount %u.
\n
"
,
refcount
);
DestroyWindow
(
window
);
}
static
void
test_surface_lock
(
void
)
{
IDirectDraw2
*
ddraw
;
...
...
@@ -4735,6 +4891,7 @@ START_TEST(ddraw2)
test_coop_level_activateapp
();
test_unsupported_formats
();
test_rt_caps
();
test_primary_caps
();
test_surface_lock
();
test_surface_discard
();
test_flip
();
...
...
dlls/ddraw/tests/ddraw4.c
View file @
f637c229
...
...
@@ -4569,6 +4569,162 @@ done:
DestroyWindow
(
window
);
}
static
void
test_primary_caps
(
void
)
{
const
DWORD
placement
=
DDSCAPS_LOCALVIDMEM
|
DDSCAPS_VIDEOMEMORY
|
DDSCAPS_SYSTEMMEMORY
;
IDirectDrawSurface4
*
surface
;
DDSURFACEDESC2
surface_desc
;
IDirectDraw4
*
ddraw
;
unsigned
int
i
;
ULONG
refcount
;
HWND
window
;
HRESULT
hr
;
static
const
struct
{
DWORD
coop_level
;
DWORD
caps_in
;
DWORD
back_buffer_count
;
HRESULT
hr
;
DWORD
caps_out
;
}
test_data
[]
=
{
{
DDSCL_NORMAL
,
DDSCAPS_PRIMARYSURFACE
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
DD_OK
,
DDSCAPS_VISIBLE
|
DDSCAPS_PRIMARYSURFACE
|
DDSCAPS_FRONTBUFFER
|
DDSCAPS_FLIP
|
DDSCAPS_COMPLEX
,
},
{
DDSCL_EXCLUSIVE
|
DDSCL_FULLSCREEN
,
DDSCAPS_PRIMARYSURFACE
|
DDSCAPS_COMPLEX
|
DDSCAPS_FLIP
|
DDSCAPS_FRONTBUFFER
,
1
,
DDERR_INVALIDCAPS
,
~
0u
,
},
{
DDSCL_EXCLUSIVE
|
DDSCL_FULLSCREEN
,
DDSCAPS_PRIMARYSURFACE
|
DDSCAPS_COMPLEX
|
DDSCAPS_FLIP
|
DDSCAPS_BACKBUFFER
,
1
,
DDERR_INVALIDCAPS
,
~
0u
,
},
};
if
(
!
(
ddraw
=
create_ddraw
()))
{
skip
(
"Failed to create a ddraw object, skipping test.
\n
"
);
return
;
}
window
=
CreateWindowA
(
"static"
,
"ddraw_test"
,
WS_OVERLAPPEDWINDOW
,
0
,
0
,
640
,
480
,
0
,
0
,
0
,
0
);
for
(
i
=
0
;
i
<
sizeof
(
test_data
)
/
sizeof
(
*
test_data
);
++
i
)
{
hr
=
IDirectDraw4_SetCooperativeLevel
(
ddraw
,
window
,
test_data
[
i
].
coop_level
);
ok
(
SUCCEEDED
(
hr
),
"Failed to set cooperative level, hr %#x.
\n
"
,
hr
);
memset
(
&
surface_desc
,
0
,
sizeof
(
surface_desc
));
surface_desc
.
dwSize
=
sizeof
(
surface_desc
);
surface_desc
.
dwFlags
=
DDSD_CAPS
;
if
(
test_data
[
i
].
back_buffer_count
!=
~
0u
)
surface_desc
.
dwFlags
|=
DDSD_BACKBUFFERCOUNT
;
surface_desc
.
ddsCaps
.
dwCaps
=
test_data
[
i
].
caps_in
;
surface_desc
.
dwBackBufferCount
=
test_data
[
i
].
back_buffer_count
;
hr
=
IDirectDraw4_CreateSurface
(
ddraw
,
&
surface_desc
,
&
surface
,
NULL
);
ok
(
hr
==
test_data
[
i
].
hr
,
"Test %u: Got unexpected hr %#x, expected %#x.
\n
"
,
i
,
hr
,
test_data
[
i
].
hr
);
if
(
FAILED
(
hr
))
continue
;
memset
(
&
surface_desc
,
0
,
sizeof
(
surface_desc
));
surface_desc
.
dwSize
=
sizeof
(
surface_desc
);
hr
=
IDirectDrawSurface4_GetSurfaceDesc
(
surface
,
&
surface_desc
);
ok
(
SUCCEEDED
(
hr
),
"Test %u: Failed to get surface desc, hr %#x.
\n
"
,
i
,
hr
);
ok
((
surface_desc
.
ddsCaps
.
dwCaps
&
~
placement
)
==
test_data
[
i
].
caps_out
,
"Test %u: Got unexpected caps %#x, expected %#x.
\n
"
,
i
,
surface_desc
.
ddsCaps
.
dwCaps
,
test_data
[
i
].
caps_out
);
IDirectDrawSurface4_Release
(
surface
);
}
refcount
=
IDirectDraw4_Release
(
ddraw
);
ok
(
refcount
==
0
,
"The ddraw object was not properly freed, refcount %u.
\n
"
,
refcount
);
DestroyWindow
(
window
);
}
static
void
test_surface_lock
(
void
)
{
IDirectDraw4
*
ddraw
;
...
...
@@ -5342,6 +5498,7 @@ START_TEST(ddraw4)
test_block_formats_creation
();
test_unsupported_formats
();
test_rt_caps
();
test_primary_caps
();
test_surface_lock
();
test_surface_discard
();
test_flip
();
...
...
dlls/ddraw/tests/ddraw7.c
View file @
f637c229
...
...
@@ -4390,6 +4390,162 @@ done:
DestroyWindow
(
window
);
}
static
void
test_primary_caps
(
void
)
{
const
DWORD
placement
=
DDSCAPS_LOCALVIDMEM
|
DDSCAPS_VIDEOMEMORY
|
DDSCAPS_SYSTEMMEMORY
;
IDirectDrawSurface7
*
surface
;
DDSURFACEDESC2
surface_desc
;
IDirectDraw7
*
ddraw
;
unsigned
int
i
;
ULONG
refcount
;
HWND
window
;
HRESULT
hr
;
static
const
struct
{
DWORD
coop_level
;
DWORD
caps_in
;
DWORD
back_buffer_count
;
HRESULT
hr
;
DWORD
caps_out
;
}
test_data
[]
=
{
{
DDSCL_NORMAL
,
DDSCAPS_PRIMARYSURFACE
,
~
0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K
,
DDSCAPS_VISIBLE
|
DDSCAPS_PRIMARYSURFACE
|
DDSCAPS_FRONTBUFFER
|
DDSCAPS_FLIP
|
DDSCAPS_COMPLEX
,
},
{
DDSCL_EXCLUSIVE
|
DDSCL_FULLSCREEN
,
DDSCAPS_PRIMARYSURFACE
|
DDSCAPS_COMPLEX
|
DDSCAPS_FLIP
|
DDSCAPS_FRONTBUFFER
,
1
,
DDERR_INVALIDCAPS
,
~
0u
,
},
{
DDSCL_EXCLUSIVE
|
DDSCL_FULLSCREEN
,
DDSCAPS_PRIMARYSURFACE
|
DDSCAPS_COMPLEX
|
DDSCAPS_FLIP
|
DDSCAPS_BACKBUFFER
,
1
,
DDERR_INVALIDCAPS
,
~
0u
,
},
};
if
(
!
(
ddraw
=
create_ddraw
()))
{
skip
(
"Failed to create a ddraw object, skipping test.
\n
"
);
return
;
}
window
=
CreateWindowA
(
"static"
,
"ddraw_test"
,
WS_OVERLAPPEDWINDOW
,
0
,
0
,
640
,
480
,
0
,
0
,
0
,
0
);
for
(
i
=
0
;
i
<
sizeof
(
test_data
)
/
sizeof
(
*
test_data
);
++
i
)
{
hr
=
IDirectDraw7_SetCooperativeLevel
(
ddraw
,
window
,
test_data
[
i
].
coop_level
);
ok
(
SUCCEEDED
(
hr
),
"Failed to set cooperative level, hr %#x.
\n
"
,
hr
);
memset
(
&
surface_desc
,
0
,
sizeof
(
surface_desc
));
surface_desc
.
dwSize
=
sizeof
(
surface_desc
);
surface_desc
.
dwFlags
=
DDSD_CAPS
;
if
(
test_data
[
i
].
back_buffer_count
!=
~
0u
)
surface_desc
.
dwFlags
|=
DDSD_BACKBUFFERCOUNT
;
surface_desc
.
ddsCaps
.
dwCaps
=
test_data
[
i
].
caps_in
;
surface_desc
.
dwBackBufferCount
=
test_data
[
i
].
back_buffer_count
;
hr
=
IDirectDraw7_CreateSurface
(
ddraw
,
&
surface_desc
,
&
surface
,
NULL
);
ok
(
hr
==
test_data
[
i
].
hr
,
"Test %u: Got unexpected hr %#x, expected %#x.
\n
"
,
i
,
hr
,
test_data
[
i
].
hr
);
if
(
FAILED
(
hr
))
continue
;
memset
(
&
surface_desc
,
0
,
sizeof
(
surface_desc
));
surface_desc
.
dwSize
=
sizeof
(
surface_desc
);
hr
=
IDirectDrawSurface7_GetSurfaceDesc
(
surface
,
&
surface_desc
);
ok
(
SUCCEEDED
(
hr
),
"Test %u: Failed to get surface desc, hr %#x.
\n
"
,
i
,
hr
);
ok
((
surface_desc
.
ddsCaps
.
dwCaps
&
~
placement
)
==
test_data
[
i
].
caps_out
,
"Test %u: Got unexpected caps %#x, expected %#x.
\n
"
,
i
,
surface_desc
.
ddsCaps
.
dwCaps
,
test_data
[
i
].
caps_out
);
IDirectDrawSurface7_Release
(
surface
);
}
refcount
=
IDirectDraw7_Release
(
ddraw
);
ok
(
refcount
==
0
,
"The ddraw object was not properly freed, refcount %u.
\n
"
,
refcount
);
DestroyWindow
(
window
);
}
static
void
test_surface_lock
(
void
)
{
IDirectDraw7
*
ddraw
;
...
...
@@ -5238,6 +5394,7 @@ START_TEST(ddraw7)
test_block_formats_creation
();
test_unsupported_formats
();
test_rt_caps
();
test_primary_caps
();
test_surface_lock
();
test_surface_discard
();
test_flip
();
...
...
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