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
b2ca7e37
Commit
b2ca7e37
authored
Dec 08, 2011
by
Stefan Dösinger
Committed by
Alexandre Julliard
Dec 08, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw/tests: Make the SetSurfaceDesc test ok messages consistent.
parent
451f9b9c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
22 deletions
+20
-22
dsurface.c
dlls/ddraw/tests/dsurface.c
+20
-22
No files found.
dlls/ddraw/tests/dsurface.c
View file @
b2ca7e37
...
...
@@ -4502,29 +4502,27 @@ static void set_surface_desc_test(void)
ddsd
.
ddsCaps
.
dwCaps
=
DDSCAPS_SYSTEMMEMORY
;
hr
=
IDirectDraw_CreateSurface
(
lpDD
,
&
ddsd
,
&
surface
,
NULL
);
ok
(
SUCCEEDED
(
hr
),
"
IDirectDraw_
CreateSurface failed, hr %#x.
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"CreateSurface failed, hr %#x.
\n
"
,
hr
);
hr
=
IDirectDrawSurface_QueryInterface
(
surface
,
&
IID_IDirectDrawSurface3
,
(
void
**
)
&
surface3
);
ok
(
SUCCEEDED
(
hr
),
"
IDirectDrawSurface_
QueryInterface failed, hr %#x.
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"QueryInterface failed, hr %#x.
\n
"
,
hr
);
IDirectDrawSurface_Release
(
surface
);
reset_ddsd
(
&
ddsd
);
ddsd
.
dwFlags
=
DDSD_LPSURFACE
;
ddsd
.
lpSurface
=
data
;
hr
=
IDirectDrawSurface3_SetSurfaceDesc
(
surface3
,
&
ddsd
,
0
);
ok
(
SUCCEEDED
(
hr
),
"
IDirectDrawSurface3_
SetSurfaceDesc failed, hr %#x.
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"SetSurfaceDesc failed, hr %#x.
\n
"
,
hr
);
/* Redundantly setting the same lpSurface is not an error */
hr
=
IDirectDrawSurface3_SetSurfaceDesc
(
surface3
,
&
ddsd
,
0
);
ok
(
SUCCEEDED
(
hr
),
"
IDirectDrawSurface3_
SetSurfaceDesc failed, hr %#x.
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"SetSurfaceDesc failed, hr %#x.
\n
"
,
hr
);
hr
=
IDirectDrawSurface3_SetSurfaceDesc
(
surface3
,
&
ddsd
,
1
);
ok
(
hr
==
DDERR_INVALIDPARAMS
,
"IDirectDrawSurface3_SetSurfaceDesc returned %#x, expected"
" DDERR_INVALIDPARAMS(%#x)
\n
"
,
hr
,
DDERR_INVALIDPARAMS
);
ok
(
hr
==
DDERR_INVALIDPARAMS
,
"SetSurfaceDesc returned %#x, expected %#x.
\n
"
,
hr
,
DDERR_INVALIDPARAMS
);
hr
=
IDirectDrawSurface3_SetSurfaceDesc
(
surface3
,
NULL
,
0
);
ok
(
hr
==
DDERR_INVALIDPARAMS
,
"IDirectDrawSurface3_SetSurfaceDesc returned %#x, expected"
" DDERR_INVALIDPARAMS(%#x)
\n
"
,
hr
,
DDERR_INVALIDPARAMS
);
ok
(
hr
==
DDERR_INVALIDPARAMS
,
"SetSurfaceDesc returned %#x, expected %#x.
\n
"
,
hr
,
DDERR_INVALIDPARAMS
);
IDirectDrawSurface_Release
(
surface3
);
...
...
@@ -4541,12 +4539,12 @@ static void set_surface_desc_test(void)
ddsd
.
ddsCaps
.
dwCaps
=
DDSCAPS_SYSTEMMEMORY
;
hr
=
IDirectDraw_CreateSurface
(
lpDD
,
&
ddsd
,
&
surface
,
NULL
);
ok
(
SUCCEEDED
(
hr
),
"
IDirectDraw_
CreateSurface failed, hr %#x.
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"CreateSurface failed, hr %#x.
\n
"
,
hr
);
hr
=
IDirectDrawSurface_QueryInterface
(
surface
,
&
IID_IDirectDrawSurface3
,
(
void
**
)
&
surface3
);
ok
(
SUCCEEDED
(
hr
),
"
IDirectDrawSurface_
QueryInterface failed, hr %#x.
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"QueryInterface failed, hr %#x.
\n
"
,
hr
);
IDirectDrawSurface_Release
(
surface
);
hr
=
IDirectDrawSurface3_GetSurfaceDesc
(
surface3
,
&
ddsd
);
ok
(
SUCCEEDED
(
hr
),
"
IDirectDrawSurface3_
GetSurfaceDesc failed, hr %#x.
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"GetSurfaceDesc failed, hr %#x.
\n
"
,
hr
);
old_pitch
=
U1
(
ddsd
).
lPitch
;
/* Setting width and height is an error */
...
...
@@ -4555,31 +4553,31 @@ static void set_surface_desc_test(void)
ddsd
.
dwWidth
=
16
;
ddsd
.
dwHeight
=
16
;
hr
=
IDirectDrawSurface3_SetSurfaceDesc
(
surface3
,
&
ddsd
,
0
);
ok
(
hr
==
DDERR_INVALIDPARAMS
,
"SetSurfaceDesc returned %#x, expected %#x
\n
"
,
hr
,
DDERR_INVALIDPARAMS
);
ok
(
hr
==
DDERR_INVALIDPARAMS
,
"SetSurfaceDesc returned %#x, expected %#x
.
\n
"
,
hr
,
DDERR_INVALIDPARAMS
);
ddsd
.
lpSurface
=
data
;
ddsd
.
dwFlags
=
DDSD_WIDTH
|
DDSD_HEIGHT
|
DDSD_LPSURFACE
;
hr
=
IDirectDrawSurface3_SetSurfaceDesc
(
surface3
,
&
ddsd
,
0
);
ok
(
hr
==
DDERR_INVALIDPARAMS
,
"SetSurfaceDesc returned %#x, expected %#x
\n
"
,
hr
,
DDERR_INVALIDPARAMS
);
ok
(
hr
==
DDERR_INVALIDPARAMS
,
"SetSurfaceDesc returned %#x, expected %#x
.
\n
"
,
hr
,
DDERR_INVALIDPARAMS
);
reset_ddsd
(
&
ddsd
);
hr
=
IDirectDrawSurface3_GetSurfaceDesc
(
surface3
,
&
ddsd
);
ok
(
SUCCEEDED
(
hr
),
"
IDirectDrawSurface3_
GetSurfaceDesc failed, hr %#x.
\n
"
,
hr
);
ok
(
ddsd
.
dwWidth
==
8
,
"SetSurfaceDesc: Expected width 8, got %u
\n
"
,
ddsd
.
dwWidth
);
ok
(
ddsd
.
dwHeight
==
8
,
"SetSurfaceDesc: Expected height 8, got %u
\n
"
,
ddsd
.
dwHeight
);
ok
(
SUCCEEDED
(
hr
),
"GetSurfaceDesc failed, hr %#x.
\n
"
,
hr
);
ok
(
ddsd
.
dwWidth
==
8
,
"SetSurfaceDesc: Expected width 8, got %u
.
\n
"
,
ddsd
.
dwWidth
);
ok
(
ddsd
.
dwHeight
==
8
,
"SetSurfaceDesc: Expected height 8, got %u
.
\n
"
,
ddsd
.
dwHeight
);
/* Setting the pitch is an error */
reset_ddsd
(
&
ddsd
);
ddsd
.
dwFlags
=
DDSD_PITCH
;
U1
(
ddsd
).
lPitch
=
1024
;
hr
=
IDirectDrawSurface3_SetSurfaceDesc
(
surface3
,
&
ddsd
,
0
);
ok
(
hr
==
DDERR_INVALIDPARAMS
,
"SetSurfaceDesc returned %#x, expected %#x
\n
"
,
hr
,
DDERR_INVALIDPARAMS
);
ok
(
hr
==
DDERR_INVALIDPARAMS
,
"SetSurfaceDesc returned %#x, expected %#x
.
\n
"
,
hr
,
DDERR_INVALIDPARAMS
);
ddsd
.
dwFlags
=
DDSD_PITCH
|
DDSD_LPSURFACE
;
ddsd
.
lpSurface
=
data
;
hr
=
IDirectDrawSurface3_SetSurfaceDesc
(
surface3
,
&
ddsd
,
0
);
ok
(
hr
==
DDERR_INVALIDPARAMS
,
"SetSurfaceDesc returned %#x, expected %#x
\n
"
,
hr
,
DDERR_INVALIDPARAMS
);
ok
(
hr
==
DDERR_INVALIDPARAMS
,
"SetSurfaceDesc returned %#x, expected %#x
.
\n
"
,
hr
,
DDERR_INVALIDPARAMS
);
U1
(
ddsd
).
lPitch
=
old_pitch
;
hr
=
IDirectDrawSurface3_SetSurfaceDesc
(
surface3
,
&
ddsd
,
0
);
ok
(
hr
==
DDERR_INVALIDPARAMS
,
"SetSurfaceDesc returned %#x, expected %#x
\n
"
,
hr
,
DDERR_INVALIDPARAMS
);
ok
(
hr
==
DDERR_INVALIDPARAMS
,
"SetSurfaceDesc returned %#x, expected %#x
.
\n
"
,
hr
,
DDERR_INVALIDPARAMS
);
/* Setting the pixelformat without lpsurface is an error, but with LPSURFACE it works */
reset_ddsd
(
&
ddsd
);
...
...
@@ -4591,11 +4589,11 @@ static void set_surface_desc_test(void)
U3
(
ddsd
.
ddpfPixelFormat
).
dwGBitMask
=
0x0000ff00
;
U4
(
ddsd
.
ddpfPixelFormat
).
dwBBitMask
=
0x000000ff
;
hr
=
IDirectDrawSurface3_SetSurfaceDesc
(
surface3
,
&
ddsd
,
0
);
ok
(
hr
==
DDERR_INVALIDPARAMS
,
"SetSurfaceDesc returned %#x, expected %#x
\n
"
,
hr
,
DDERR_INVALIDPARAMS
);
ok
(
hr
==
DDERR_INVALIDPARAMS
,
"SetSurfaceDesc returned %#x, expected %#x
.
\n
"
,
hr
,
DDERR_INVALIDPARAMS
);
ddsd
.
dwFlags
=
DDSD_PIXELFORMAT
|
DDSD_LPSURFACE
;
ddsd
.
lpSurface
=
data
;
hr
=
IDirectDrawSurface3_SetSurfaceDesc
(
surface3
,
&
ddsd
,
0
);
ok
(
hr
==
DD_OK
,
"SetSurfaceDesc returned %#x, expected %#x
\n
"
,
hr
,
DD_OK
);
ok
(
hr
==
DD_OK
,
"SetSurfaceDesc returned %#x, expected %#x
.
\n
"
,
hr
,
DD_OK
);
/* Can't set color keys */
reset_ddsd
(
&
ddsd
);
...
...
@@ -4603,7 +4601,7 @@ static void set_surface_desc_test(void)
ddsd
.
ddckCKSrcBlt
.
dwColorSpaceLowValue
=
0x00ff0000
;
ddsd
.
ddckCKSrcBlt
.
dwColorSpaceHighValue
=
0x00ff0000
;
hr
=
IDirectDrawSurface3_SetSurfaceDesc
(
surface3
,
&
ddsd
,
0
);
ok
(
hr
==
DDERR_INVALIDPARAMS
,
"SetSurfaceDesc returned %#x, expected %#x
\n
"
,
hr
,
DDERR_INVALIDPARAMS
);
ok
(
hr
==
DDERR_INVALIDPARAMS
,
"SetSurfaceDesc returned %#x, expected %#x
.
\n
"
,
hr
,
DDERR_INVALIDPARAMS
);
IDirectDrawSurface_Release
(
surface3
);
}
...
...
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