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
9cf25006
Commit
9cf25006
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: Extend the CreateSurface(NULL test), use own function.
parent
481e2f33
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
60 additions
and
4 deletions
+60
-4
dsurface.c
dlls/ddraw/tests/dsurface.c
+60
-4
No files found.
dlls/ddraw/tests/dsurface.c
View file @
9cf25006
...
...
@@ -29,6 +29,8 @@
#include "d3d.h"
#include "unknwn.h"
static
HRESULT
(
WINAPI
*
pDirectDrawCreateEx
)(
GUID
*
,
void
**
,
REFIID
,
IUnknown
*
);
static
LPDIRECTDRAW
lpDD
=
NULL
;
static
DDCAPS
ddcaps
;
...
...
@@ -4484,10 +4486,6 @@ static void set_surface_desc_test(void)
IDirectDrawSurface3
*
surface3
;
BYTE
data
[
16
*
16
*
4
];
hr
=
IDirectDraw_CreateSurface
(
lpDD
,
NULL
,
&
surface
,
NULL
);
ok
(
hr
==
DDERR_INVALIDPARAMS
,
"CreateSurface with a NULL DDSD returned %#x,"
" expected DDERR_INVALIDPARAMS(%#x)
\n
"
,
hr
,
DDERR_INVALIDPARAMS
);
reset_ddsd
(
&
ddsd
);
ddsd
.
dwFlags
=
DDSD_WIDTH
|
DDSD_HEIGHT
|
DDSD_CAPS
|
DDSD_PIXELFORMAT
;
ddsd
.
dwWidth
=
8
;
...
...
@@ -4909,11 +4907,68 @@ static void partial_block_lock_test(void)
IDirectDraw7_Release
(
dd7
);
}
static
void
create_surface_test
(
void
)
{
HRESULT
hr
;
IDirectDraw2
*
ddraw2
;
IDirectDraw4
*
ddraw4
;
IDirectDraw7
*
ddraw7
;
IDirectDrawSurface
*
surface
;
IDirectDrawSurface4
*
surface4
;
IDirectDrawSurface7
*
surface7
;
hr
=
IDirectDraw_CreateSurface
(
lpDD
,
NULL
,
&
surface
,
NULL
);
ok
(
hr
==
DDERR_INVALIDPARAMS
,
"CreateSurface(ddsd=NULL) returned %#x,"
" expected %#x.
\n
"
,
hr
,
DDERR_INVALIDPARAMS
);
hr
=
IDirectDraw_QueryInterface
(
lpDD
,
&
IID_IDirectDraw2
,
(
void
**
)
&
ddraw2
);
ok
(
SUCCEEDED
(
hr
),
"QueryInterface failed, hr %#x.
\n
"
,
hr
);
hr
=
IDirectDraw2_CreateSurface
(
ddraw2
,
NULL
,
&
surface
,
NULL
);
ok
(
hr
==
DDERR_INVALIDPARAMS
,
"CreateSurface(ddsd=NULL) returned %#x,"
" expected %#x.
\n
"
,
hr
,
DDERR_INVALIDPARAMS
);
IDirectDraw2_Release
(
ddraw2
);
hr
=
IDirectDraw_QueryInterface
(
lpDD
,
&
IID_IDirectDraw4
,
(
void
**
)
&
ddraw4
);
ok
(
SUCCEEDED
(
hr
),
"QueryInterface failed, hr %#x.
\n
"
,
hr
);
hr
=
IDirectDraw4_CreateSurface
(
ddraw4
,
NULL
,
&
surface4
,
NULL
);
ok
(
hr
==
DDERR_INVALIDPARAMS
,
"CreateSurface(ddsd=NULL) returned %#x,"
" expected %#x.
\n
"
,
hr
,
DDERR_INVALIDPARAMS
);
IDirectDraw4_Release
(
ddraw4
);
if
(
!
pDirectDrawCreateEx
)
{
skip
(
"DirectDrawCreateEx not available, skipping IDirectDraw7 tests.
\n
"
);
return
;
}
hr
=
pDirectDrawCreateEx
(
NULL
,
(
void
**
)
&
ddraw7
,
&
IID_IDirectDraw7
,
NULL
);
ok
(
SUCCEEDED
(
hr
),
"DirectDrawCreateEx failed, hr %#x.
\n
"
,
hr
);
hr
=
IDirectDraw7_CreateSurface
(
ddraw7
,
NULL
,
&
surface7
,
NULL
);
ok
(
hr
==
DDERR_NOCOOPERATIVELEVELSET
,
"CreateSurface(ddsd=NULL, pre-SCL) returned %#x,"
" expected %#x.
\n
"
,
hr
,
DDERR_NOCOOPERATIVELEVELSET
);
hr
=
IDirectDraw7_SetCooperativeLevel
(
ddraw7
,
NULL
,
DDSCL_NORMAL
);
ok
(
hr
==
DD_OK
,
"SetCooperativeLevel failed, hr %#x.
\n
"
,
hr
);
hr
=
IDirectDraw7_CreateSurface
(
ddraw7
,
NULL
,
&
surface7
,
NULL
);
ok
(
hr
==
DDERR_INVALIDPARAMS
,
"CreateSurface(ddsd=NULL) returned %#x,"
" expected %#x.
\n
"
,
hr
,
DDERR_INVALIDPARAMS
);
IDirectDraw7_Release
(
ddraw7
);
}
START_TEST
(
dsurface
)
{
HRESULT
ret
;
IDirectDraw4
*
dd4
;
HMODULE
ddraw_mod
=
GetModuleHandleA
(
"ddraw.dll"
);
pDirectDrawCreateEx
=
(
void
*
)
GetProcAddress
(
ddraw_mod
,
"DirectDrawCreateEx"
);
if
(
!
CreateDirectDraw
())
return
;
...
...
@@ -4970,5 +5025,6 @@ START_TEST(dsurface)
pixelformat_flag_test
();
set_surface_desc_test
();
partial_block_lock_test
();
create_surface_test
();
ReleaseDirectDraw
();
}
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