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
d61d8426
Commit
d61d8426
authored
Jun 01, 2012
by
Henri Verbeet
Committed by
Alexandre Julliard
Jun 01, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw/tests: Split up test_initialize().
parent
4f85b377
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
126 additions
and
130 deletions
+126
-130
d3d.c
dlls/ddraw/tests/d3d.c
+0
-130
ddraw1.c
dlls/ddraw/tests/ddraw1.c
+45
-0
ddraw2.c
dlls/ddraw/tests/ddraw2.c
+27
-0
ddraw4.c
dlls/ddraw/tests/ddraw4.c
+27
-0
ddraw7.c
dlls/ddraw/tests/ddraw7.c
+27
-0
No files found.
dlls/ddraw/tests/d3d.c
View file @
d61d8426
...
...
@@ -3626,135 +3626,6 @@ static void z_format_test(void)
ok
(
count
,
"Expected at least one supported Z Buffer format
\n
"
);
}
static
void
test_initialize
(
void
)
{
IDirectDraw7
*
ddraw7
;
IDirectDraw4
*
ddraw4
;
IDirectDraw2
*
ddraw2
;
IDirectDraw
*
ddraw1
;
IDirect3D
*
d3d1
;
HRESULT
hr
;
/* IDirectDraw */
if
(
FAILED
(
hr
=
DirectDrawCreate
(
NULL
,
&
ddraw1
,
NULL
)))
{
skip
(
"Failed to create IDirectDraw object (%#x), skipping tests.
\n
"
,
hr
);
return
;
}
hr
=
IDirectDraw_Initialize
(
ddraw1
,
NULL
);
ok
(
hr
==
DDERR_ALREADYINITIALIZED
,
"Initialize returned hr %#x.
\n
"
,
hr
);
IDirectDraw_Release
(
ddraw1
);
CoInitialize
(
NULL
);
hr
=
CoCreateInstance
(
&
CLSID_DirectDraw
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IDirectDraw
,
(
void
**
)
&
ddraw1
);
ok
(
SUCCEEDED
(
hr
),
"Failed to create IDirectDraw instance, hr %#x.
\n
"
,
hr
);
hr
=
IDirectDraw_Initialize
(
ddraw1
,
NULL
);
ok
(
hr
==
DD_OK
,
"Initialize returned hr %#x, expected DD_OK.
\n
"
,
hr
);
hr
=
IDirectDraw_Initialize
(
ddraw1
,
NULL
);
ok
(
hr
==
DDERR_ALREADYINITIALIZED
,
"Initialize returned hr %#x, expected DDERR_ALREADYINITIALIZED.
\n
"
,
hr
);
IDirectDraw_Release
(
ddraw1
);
CoUninitialize
();
hr
=
DirectDrawCreate
(
NULL
,
&
ddraw1
,
NULL
);
ok
(
SUCCEEDED
(
hr
),
"Failed to create IDirectDraw object, hr %#x.
\n
"
,
hr
);
/* IDirectDraw2 */
if
(
SUCCEEDED
(
IDirectDraw_QueryInterface
(
ddraw1
,
&
IID_IDirectDraw2
,
(
void
**
)
&
ddraw2
)))
{
hr
=
IDirectDraw2_Initialize
(
ddraw2
,
NULL
);
ok
(
hr
==
DDERR_ALREADYINITIALIZED
,
"Initialize returned hr %#x.
\n
"
,
hr
);
IDirectDraw2_Release
(
ddraw2
);
CoInitialize
(
NULL
);
hr
=
CoCreateInstance
(
&
CLSID_DirectDraw
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IDirectDraw2
,
(
void
**
)
&
ddraw2
);
ok
(
SUCCEEDED
(
hr
),
"Failed to create IDirectDraw2 instance, hr %#x.
\n
"
,
hr
);
hr
=
IDirectDraw2_Initialize
(
ddraw2
,
NULL
);
ok
(
hr
==
DD_OK
,
"Initialize returned hr %#x, expected DD_OK.
\n
"
,
hr
);
hr
=
IDirectDraw2_Initialize
(
ddraw2
,
NULL
);
ok
(
hr
==
DDERR_ALREADYINITIALIZED
,
"Initialize returned hr %#x, expected DDERR_ALREADYINITIALIZED.
\n
"
,
hr
);
IDirectDraw2_Release
(
ddraw2
);
CoUninitialize
();
}
else
skip
(
"Failed to query IDirectDraw2 interface, skipping tests.
\n
"
);
/* IDirectDraw4 */
if
(
SUCCEEDED
(
IDirectDraw_QueryInterface
(
ddraw1
,
&
IID_IDirectDraw4
,
(
void
**
)
&
ddraw4
)))
{
hr
=
IDirectDraw4_Initialize
(
ddraw4
,
NULL
);
ok
(
hr
==
DDERR_ALREADYINITIALIZED
,
"Initialize returned hr %#x.
\n
"
,
hr
);
IDirectDraw4_Release
(
ddraw4
);
CoInitialize
(
NULL
);
hr
=
CoCreateInstance
(
&
CLSID_DirectDraw
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IDirectDraw4
,
(
void
**
)
&
ddraw4
);
ok
(
SUCCEEDED
(
hr
),
"Failed to create IDirectDraw4 instance, hr %#x.
\n
"
,
hr
);
hr
=
IDirectDraw4_Initialize
(
ddraw4
,
NULL
);
ok
(
hr
==
DD_OK
,
"Initialize returned hr %#x, expected DD_OK.
\n
"
,
hr
);
hr
=
IDirectDraw4_Initialize
(
ddraw4
,
NULL
);
ok
(
hr
==
DDERR_ALREADYINITIALIZED
,
"Initialize returned hr %#x, expected DDERR_ALREADYINITIALIZED.
\n
"
,
hr
);
IDirectDraw4_Release
(
ddraw4
);
CoUninitialize
();
}
else
skip
(
"Failed to query IDirectDraw4 interface, skipping tests.
\n
"
);
/* IDirect3D */
if
(
SUCCEEDED
(
IDirectDraw_QueryInterface
(
ddraw1
,
&
IID_IDirect3D
,
(
void
**
)
&
d3d1
)))
{
IDirectDraw
*
ddraw
;
hr
=
IDirect3D_Initialize
(
d3d1
,
NULL
);
ok
(
hr
==
DDERR_ALREADYINITIALIZED
,
"Initialize returned hr %#x.
\n
"
,
hr
);
IDirect3D_Release
(
d3d1
);
if
(
0
)
/* This crashes on the W2KPROSP4 testbot. */
{
CoInitialize
(
NULL
);
hr
=
CoCreateInstance
(
&
CLSID_DirectDraw
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IDirect3D
,
(
void
**
)
&
d3d1
);
ok
(
hr
==
E_NOINTERFACE
,
"CoCreateInstance returned hr %#x, expected E_NOINTERFACE.
\n
"
,
hr
);
CoUninitialize
();
}
CoInitialize
(
NULL
);
hr
=
CoCreateInstance
(
&
CLSID_DirectDraw
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IDirectDraw
,
(
void
**
)
&
ddraw
);
ok
(
SUCCEEDED
(
hr
),
"Failed to create IDirectDraw instance, hr %#x.
\n
"
,
hr
);
hr
=
IDirectDraw_QueryInterface
(
ddraw
,
&
IID_IDirect3D
,
(
void
**
)
&
d3d1
);
ok
(
SUCCEEDED
(
hr
),
"Failed to query IDirect3D interface, hr %#x.
\n
"
,
hr
);
IDirectDraw_Release
(
ddraw
);
/* IDirect3D_Initialize() just returns DDERR_ALREADYINITIALIZED. */
hr
=
IDirect3D_Initialize
(
d3d1
,
NULL
);
ok
(
hr
==
DDERR_ALREADYINITIALIZED
,
"Initialize returned hr %#x, expected DDERR_ALREADYINITIALIZED.
\n
"
,
hr
);
hr
=
IDirectDraw_Initialize
(
ddraw
,
NULL
);
ok
(
hr
==
DD_OK
,
"Initialize returned hr %#x, expected DD_OK.
\n
"
,
hr
);
hr
=
IDirectDraw_Initialize
(
ddraw
,
NULL
);
ok
(
hr
==
DDERR_ALREADYINITIALIZED
,
"Initialize returned hr %#x, expected DDERR_ALREADYINITIALIZED.
\n
"
,
hr
);
IDirect3D_Release
(
d3d1
);
CoUninitialize
();
}
else
skip
(
"Failed to query IDirect3D interface, skipping tests.
\n
"
);
IDirectDraw_Release
(
ddraw1
);
/* IDirectDraw7 */
if
(
FAILED
(
hr
=
pDirectDrawCreateEx
(
NULL
,
(
void
**
)
&
ddraw7
,
&
IID_IDirectDraw7
,
NULL
)))
{
skip
(
"Failed to create IDirectDraw7 object (%#x), skipping tests.
\n
"
,
hr
);
return
;
}
hr
=
IDirectDraw7_Initialize
(
ddraw7
,
NULL
);
ok
(
hr
==
DDERR_ALREADYINITIALIZED
,
"Initialize returned hr %#x.
\n
"
,
hr
);
IDirectDraw7_Release
(
ddraw7
);
CoInitialize
(
NULL
);
hr
=
CoCreateInstance
(
&
CLSID_DirectDraw
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IDirectDraw7
,
(
void
**
)
&
ddraw7
);
ok
(
SUCCEEDED
(
hr
),
"Failed to create IDirectDraw7 instance, hr %#x.
\n
"
,
hr
);
hr
=
IDirectDraw7_Initialize
(
ddraw7
,
NULL
);
ok
(
hr
==
DD_OK
,
"Initialize returned hr %#x, expected DD_OK.
\n
"
,
hr
);
hr
=
IDirectDraw7_Initialize
(
ddraw7
,
NULL
);
ok
(
hr
==
DDERR_ALREADYINITIALIZED
,
"Initialize returned hr %#x, expected DDERR_ALREADYINITIALIZED.
\n
"
,
hr
);
IDirectDraw7_Release
(
ddraw7
);
CoUninitialize
();
}
static
void
test_coop_level_surf_create
(
void
)
{
IDirectDrawSurface7
*
surface7
;
...
...
@@ -4183,6 +4054,5 @@ START_TEST(d3d)
D3D1_releaseObjects
();
}
test_initialize
();
test_coop_level_surf_create
();
}
dlls/ddraw/tests/ddraw1.c
View file @
d61d8426
...
...
@@ -2370,6 +2370,50 @@ done:
UnregisterClassA
(
"ddraw_test_wndproc_wc"
,
GetModuleHandleA
(
NULL
));
}
static
void
test_initialize
(
void
)
{
IDirectDraw
*
ddraw
;
IDirect3D
*
d3d
;
HRESULT
hr
;
if
(
!
(
ddraw
=
create_ddraw
()))
{
skip
(
"Failed to create a ddraw object, skipping test.
\n
"
);
return
;
}
hr
=
IDirectDraw_Initialize
(
ddraw
,
NULL
);
ok
(
hr
==
DDERR_ALREADYINITIALIZED
,
"Initialize returned hr %#x.
\n
"
,
hr
);
IDirectDraw_Release
(
ddraw
);
CoInitialize
(
NULL
);
hr
=
CoCreateInstance
(
&
CLSID_DirectDraw
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IDirectDraw
,
(
void
**
)
&
ddraw
);
ok
(
SUCCEEDED
(
hr
),
"Failed to create IDirectDraw instance, hr %#x.
\n
"
,
hr
);
hr
=
IDirectDraw_QueryInterface
(
ddraw
,
&
IID_IDirect3D
,
(
void
**
)
&
d3d
);
if
(
SUCCEEDED
(
hr
))
{
/* IDirect3D_Initialize() just returns DDERR_ALREADYINITIALIZED. */
hr
=
IDirect3D_Initialize
(
d3d
,
NULL
);
ok
(
hr
==
DDERR_ALREADYINITIALIZED
,
"Initialize returned hr %#x, expected DDERR_ALREADYINITIALIZED.
\n
"
,
hr
);
IDirect3D_Release
(
d3d
);
}
else
skip
(
"Failed to query IDirect3D interface, skipping tests.
\n
"
);
hr
=
IDirectDraw_Initialize
(
ddraw
,
NULL
);
ok
(
hr
==
DD_OK
,
"Initialize returned hr %#x, expected DD_OK.
\n
"
,
hr
);
hr
=
IDirectDraw_Initialize
(
ddraw
,
NULL
);
ok
(
hr
==
DDERR_ALREADYINITIALIZED
,
"Initialize returned hr %#x, expected DDERR_ALREADYINITIALIZED.
\n
"
,
hr
);
IDirectDraw_Release
(
ddraw
);
CoUninitialize
();
if
(
0
)
/* This crashes on the W2KPROSP4 testbot. */
{
CoInitialize
(
NULL
);
hr
=
CoCreateInstance
(
&
CLSID_DirectDraw
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IDirect3D
,
(
void
**
)
&
d3d
);
ok
(
hr
==
E_NOINTERFACE
,
"CoCreateInstance returned hr %#x, expected E_NOINTERFACE.
\n
"
,
hr
);
CoUninitialize
();
}
}
START_TEST
(
ddraw1
)
{
test_coop_level_create_device_window
();
...
...
@@ -2387,4 +2431,5 @@ START_TEST(ddraw1)
test_window_style
();
test_redundant_mode_set
();
test_coop_level_mode_set
();
test_initialize
();
}
dlls/ddraw/tests/ddraw2.c
View file @
d61d8426
...
...
@@ -2507,6 +2507,32 @@ done:
UnregisterClassA
(
"ddraw_test_wndproc_wc"
,
GetModuleHandleA
(
NULL
));
}
static
void
test_initialize
(
void
)
{
IDirectDraw2
*
ddraw
;
HRESULT
hr
;
if
(
!
(
ddraw
=
create_ddraw
()))
{
skip
(
"Failed to create a ddraw object, skipping test.
\n
"
);
return
;
}
hr
=
IDirectDraw2_Initialize
(
ddraw
,
NULL
);
ok
(
hr
==
DDERR_ALREADYINITIALIZED
,
"Initialize returned hr %#x.
\n
"
,
hr
);
IDirectDraw2_Release
(
ddraw
);
CoInitialize
(
NULL
);
hr
=
CoCreateInstance
(
&
CLSID_DirectDraw
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IDirectDraw2
,
(
void
**
)
&
ddraw
);
ok
(
SUCCEEDED
(
hr
),
"Failed to create IDirectDraw2 instance, hr %#x.
\n
"
,
hr
);
hr
=
IDirectDraw2_Initialize
(
ddraw
,
NULL
);
ok
(
hr
==
DD_OK
,
"Initialize returned hr %#x, expected DD_OK.
\n
"
,
hr
);
hr
=
IDirectDraw2_Initialize
(
ddraw
,
NULL
);
ok
(
hr
==
DDERR_ALREADYINITIALIZED
,
"Initialize returned hr %#x, expected DDERR_ALREADYINITIALIZED.
\n
"
,
hr
);
IDirectDraw2_Release
(
ddraw
);
CoUninitialize
();
}
START_TEST
(
ddraw2
)
{
test_coop_level_create_device_window
();
...
...
@@ -2526,4 +2552,5 @@ START_TEST(ddraw2)
test_window_style
();
test_redundant_mode_set
();
test_coop_level_mode_set
();
test_initialize
();
}
dlls/ddraw/tests/ddraw4.c
View file @
d61d8426
...
...
@@ -2622,6 +2622,32 @@ static void test_coop_level_mode_set(void)
UnregisterClassA
(
"ddraw_test_wndproc_wc"
,
GetModuleHandleA
(
NULL
));
}
static
void
test_initialize
(
void
)
{
IDirectDraw4
*
ddraw
;
HRESULT
hr
;
if
(
!
(
ddraw
=
create_ddraw
()))
{
skip
(
"Failed to create a ddraw object, skipping test.
\n
"
);
return
;
}
hr
=
IDirectDraw4_Initialize
(
ddraw
,
NULL
);
ok
(
hr
==
DDERR_ALREADYINITIALIZED
,
"Initialize returned hr %#x.
\n
"
,
hr
);
IDirectDraw4_Release
(
ddraw
);
CoInitialize
(
NULL
);
hr
=
CoCreateInstance
(
&
CLSID_DirectDraw
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IDirectDraw4
,
(
void
**
)
&
ddraw
);
ok
(
SUCCEEDED
(
hr
),
"Failed to create IDirectDraw4 instance, hr %#x.
\n
"
,
hr
);
hr
=
IDirectDraw4_Initialize
(
ddraw
,
NULL
);
ok
(
hr
==
DD_OK
,
"Initialize returned hr %#x, expected DD_OK.
\n
"
,
hr
);
hr
=
IDirectDraw4_Initialize
(
ddraw
,
NULL
);
ok
(
hr
==
DDERR_ALREADYINITIALIZED
,
"Initialize returned hr %#x, expected DDERR_ALREADYINITIALIZED.
\n
"
,
hr
);
IDirectDraw4_Release
(
ddraw
);
CoUninitialize
();
}
START_TEST
(
ddraw4
)
{
test_process_vertices
();
...
...
@@ -2642,4 +2668,5 @@ START_TEST(ddraw4)
test_window_style
();
test_redundant_mode_set
();
test_coop_level_mode_set
();
test_initialize
();
}
dlls/ddraw/tests/ddraw7.c
View file @
d61d8426
...
...
@@ -2431,6 +2431,32 @@ static void test_coop_level_mode_set(void)
UnregisterClassA
(
"ddraw_test_wndproc_wc"
,
GetModuleHandleA
(
NULL
));
}
static
void
test_initialize
(
void
)
{
IDirectDraw7
*
ddraw
;
HRESULT
hr
;
if
(
!
(
ddraw
=
create_ddraw
()))
{
skip
(
"Failed to create a ddraw object, skipping test.
\n
"
);
return
;
}
hr
=
IDirectDraw7_Initialize
(
ddraw
,
NULL
);
ok
(
hr
==
DDERR_ALREADYINITIALIZED
,
"Initialize returned hr %#x.
\n
"
,
hr
);
IDirectDraw7_Release
(
ddraw
);
CoInitialize
(
NULL
);
hr
=
CoCreateInstance
(
&
CLSID_DirectDraw
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IDirectDraw7
,
(
void
**
)
&
ddraw
);
ok
(
SUCCEEDED
(
hr
),
"Failed to create IDirectDraw7 instance, hr %#x.
\n
"
,
hr
);
hr
=
IDirectDraw7_Initialize
(
ddraw
,
NULL
);
ok
(
hr
==
DD_OK
,
"Initialize returned hr %#x, expected DD_OK.
\n
"
,
hr
);
hr
=
IDirectDraw7_Initialize
(
ddraw
,
NULL
);
ok
(
hr
==
DDERR_ALREADYINITIALIZED
,
"Initialize returned hr %#x, expected DDERR_ALREADYINITIALIZED.
\n
"
,
hr
);
IDirectDraw7_Release
(
ddraw
);
CoUninitialize
();
}
START_TEST
(
ddraw7
)
{
HMODULE
module
=
GetModuleHandleA
(
"ddraw.dll"
);
...
...
@@ -2458,4 +2484,5 @@ START_TEST(ddraw7)
test_window_style
();
test_redundant_mode_set
();
test_coop_level_mode_set
();
test_initialize
();
}
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