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
9804ebcd
Commit
9804ebcd
authored
Apr 05, 2012
by
Henri Verbeet
Committed by
Alexandre Julliard
Apr 06, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw/tests: Add some QueryInterface() tests for devices.
parent
cf30899f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
285 additions
and
0 deletions
+285
-0
ddraw1.c
dlls/ddraw/tests/ddraw1.c
+76
-0
ddraw2.c
dlls/ddraw/tests/ddraw2.c
+75
-0
ddraw4.c
dlls/ddraw/tests/ddraw4.c
+67
-0
ddraw7.c
dlls/ddraw/tests/ddraw7.c
+67
-0
No files found.
dlls/ddraw/tests/ddraw1.c
View file @
9804ebcd
...
...
@@ -1459,6 +1459,81 @@ static void test_surface_qi(void)
DestroyWindow
(
window
);
}
static
void
test_device_qi
(
void
)
{
static
const
struct
qi_test
tests
[]
=
{
{
&
IID_IDirect3DTexture2
,
&
IID_IDirectDrawSurface
,
S_OK
},
{
&
IID_IDirect3DTexture
,
&
IID_IDirectDrawSurface
,
S_OK
},
{
&
IID_IDirectDrawGammaControl
,
&
IID_IDirectDrawGammaControl
,
S_OK
},
{
&
IID_IDirectDrawColorControl
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirectDrawSurface7
,
&
IID_IDirectDrawSurface7
,
S_OK
},
{
&
IID_IDirectDrawSurface4
,
&
IID_IDirectDrawSurface4
,
S_OK
},
{
&
IID_IDirectDrawSurface3
,
&
IID_IDirectDrawSurface3
,
S_OK
},
{
&
IID_IDirectDrawSurface2
,
&
IID_IDirectDrawSurface2
,
S_OK
},
{
&
IID_IDirectDrawSurface
,
&
IID_IDirectDrawSurface
,
S_OK
},
{
&
IID_IDirect3DDevice7
,
NULL
,
E_INVALIDARG
},
{
&
IID_IDirect3DDevice3
,
NULL
,
E_INVALIDARG
},
{
&
IID_IDirect3DDevice2
,
NULL
,
E_INVALIDARG
},
{
&
IID_IDirect3DDevice
,
NULL
,
E_INVALIDARG
},
{
&
IID_IDirect3DHALDevice
,
&
IID_IDirectDrawSurface
,
S_OK
},
{
&
IID_IDirect3D7
,
NULL
,
E_INVALIDARG
},
{
&
IID_IDirect3D3
,
NULL
,
E_INVALIDARG
},
{
&
IID_IDirect3D2
,
NULL
,
E_INVALIDARG
},
{
&
IID_IDirect3D
,
NULL
,
E_INVALIDARG
},
{
&
IID_IDirectDraw7
,
NULL
,
E_INVALIDARG
},
{
&
IID_IDirectDraw4
,
NULL
,
E_INVALIDARG
},
{
&
IID_IDirectDraw3
,
NULL
,
E_INVALIDARG
},
{
&
IID_IDirectDraw2
,
NULL
,
E_INVALIDARG
},
{
&
IID_IDirectDraw
,
NULL
,
E_INVALIDARG
},
{
&
IID_IDirect3DLight
,
NULL
,
E_INVALIDARG
},
{
&
IID_IDirect3DMaterial
,
NULL
,
E_INVALIDARG
},
{
&
IID_IDirect3DMaterial2
,
NULL
,
E_INVALIDARG
},
{
&
IID_IDirect3DMaterial3
,
NULL
,
E_INVALIDARG
},
{
&
IID_IDirect3DExecuteBuffer
,
NULL
,
E_INVALIDARG
},
{
&
IID_IDirect3DViewport
,
NULL
,
E_INVALIDARG
},
{
&
IID_IDirect3DViewport2
,
NULL
,
E_INVALIDARG
},
{
&
IID_IDirect3DViewport3
,
NULL
,
E_INVALIDARG
},
{
&
IID_IDirect3DVertexBuffer
,
NULL
,
E_INVALIDARG
},
{
&
IID_IDirect3DVertexBuffer7
,
NULL
,
E_INVALIDARG
},
{
&
IID_IDirectDrawPalette
,
NULL
,
E_INVALIDARG
},
{
&
IID_IDirectDrawClipper
,
NULL
,
E_INVALIDARG
},
{
&
IID_IUnknown
,
&
IID_IDirectDrawSurface
,
S_OK
},
};
IDirect3DDevice
*
device
;
IDirectDraw
*
ddraw
;
HWND
window
;
if
(
!
GetProcAddress
(
GetModuleHandleA
(
"ddraw.dll"
),
"DirectDrawCreateEx"
))
{
win_skip
(
"DirectDrawCreateEx not available, skipping test.
\n
"
);
return
;
}
window
=
CreateWindowA
(
"static"
,
"ddraw_test"
,
WS_OVERLAPPEDWINDOW
,
0
,
0
,
640
,
480
,
0
,
0
,
0
,
0
);
if
(
!
(
ddraw
=
create_ddraw
()))
{
skip
(
"Failed to create ddraw object, skipping test.
\n
"
);
DestroyWindow
(
window
);
return
;
}
if
(
!
(
device
=
create_device
(
ddraw
,
window
,
DDSCL_NORMAL
)))
{
skip
(
"Failed to create D3D device, skipping test.
\n
"
);
DestroyWindow
(
window
);
return
;
}
test_qi
(
"device_qi"
,
(
IUnknown
*
)
device
,
&
IID_IDirectDrawSurface
,
tests
,
sizeof
(
tests
)
/
sizeof
(
*
tests
));
IDirect3DDevice_Release
(
device
);
IDirectDraw_Release
(
ddraw
);
DestroyWindow
(
window
);
}
START_TEST
(
ddraw1
)
{
test_coop_level_create_device_window
();
...
...
@@ -1470,4 +1545,5 @@ START_TEST(ddraw1)
test_zenable
();
test_ck_rgba
();
test_surface_qi
();
test_device_qi
();
}
dlls/ddraw/tests/ddraw2.c
View file @
9804ebcd
...
...
@@ -1669,6 +1669,80 @@ static void test_surface_qi(void)
DestroyWindow
(
window
);
}
static
void
test_device_qi
(
void
)
{
static
const
struct
qi_test
tests
[]
=
{
{
&
IID_IDirect3DTexture2
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirect3DTexture
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirectDrawGammaControl
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirectDrawColorControl
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirectDrawSurface7
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirectDrawSurface4
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirectDrawSurface3
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirectDrawSurface2
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirectDrawSurface
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirect3DDevice7
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirect3DDevice3
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirect3DDevice2
,
&
IID_IDirect3DDevice2
,
S_OK
},
{
&
IID_IDirect3DDevice
,
&
IID_IDirect3DDevice2
,
S_OK
},
{
&
IID_IDirect3DRampDevice
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirect3DRGBDevice
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirect3DHALDevice
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirect3DMMXDevice
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirect3DRefDevice
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirect3DTnLHalDevice
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirect3DNullDevice
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirect3D7
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirect3D3
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirect3D2
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirect3D
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirectDraw7
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirectDraw4
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirectDraw3
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirectDraw2
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirectDraw
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirect3DLight
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirect3DMaterial
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirect3DMaterial2
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirect3DMaterial3
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirect3DExecuteBuffer
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirect3DViewport
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirect3DViewport2
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirect3DViewport3
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirect3DVertexBuffer
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirect3DVertexBuffer7
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirectDrawPalette
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirectDrawClipper
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IUnknown
,
&
IID_IDirect3DDevice2
,
S_OK
},
};
IDirect3DDevice2
*
device
;
IDirectDraw2
*
ddraw
;
HWND
window
;
window
=
CreateWindowA
(
"static"
,
"ddraw_test"
,
WS_OVERLAPPEDWINDOW
,
0
,
0
,
640
,
480
,
0
,
0
,
0
,
0
);
if
(
!
(
ddraw
=
create_ddraw
()))
{
skip
(
"Failed to create ddraw object, skipping test.
\n
"
);
DestroyWindow
(
window
);
return
;
}
if
(
!
(
device
=
create_device
(
ddraw
,
window
,
DDSCL_NORMAL
)))
{
skip
(
"Failed to create D3D device, skipping test.
\n
"
);
DestroyWindow
(
window
);
return
;
}
test_qi
(
"device_qi"
,
(
IUnknown
*
)
device
,
&
IID_IDirect3DDevice2
,
tests
,
sizeof
(
tests
)
/
sizeof
(
*
tests
));
IDirect3DDevice2_Release
(
device
);
IDirectDraw2_Release
(
ddraw
);
DestroyWindow
(
window
);
}
START_TEST
(
ddraw2
)
{
test_coop_level_create_device_window
();
...
...
@@ -1682,4 +1756,5 @@ START_TEST(ddraw2)
test_zenable
();
test_ck_rgba
();
test_surface_qi
();
test_device_qi
();
}
dlls/ddraw/tests/ddraw4.c
View file @
9804ebcd
...
...
@@ -1755,6 +1755,72 @@ static void test_surface_qi(void)
DestroyWindow
(
window
);
}
static
void
test_device_qi
(
void
)
{
static
const
struct
qi_test
tests
[]
=
{
{
&
IID_IDirect3DTexture2
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirect3DTexture
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirectDrawGammaControl
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirectDrawColorControl
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirectDrawSurface7
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirectDrawSurface4
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirectDrawSurface3
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirectDrawSurface2
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirectDrawSurface
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirect3DDevice7
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirect3DDevice3
,
&
IID_IDirect3DDevice3
,
S_OK
},
{
&
IID_IDirect3DDevice2
,
&
IID_IDirect3DDevice3
,
S_OK
},
{
&
IID_IDirect3DDevice
,
&
IID_IDirect3DDevice3
,
S_OK
},
{
&
IID_IDirect3DRampDevice
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirect3DRGBDevice
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirect3DHALDevice
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirect3DMMXDevice
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirect3DRefDevice
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirect3DTnLHalDevice
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirect3DNullDevice
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirect3D7
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirect3D3
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirect3D2
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirect3D
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirectDraw7
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirectDraw4
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirectDraw3
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirectDraw2
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirectDraw
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirect3DLight
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirect3DMaterial
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirect3DMaterial2
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirect3DMaterial3
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirect3DExecuteBuffer
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirect3DViewport
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirect3DViewport2
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirect3DViewport3
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirect3DVertexBuffer
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirect3DVertexBuffer7
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirectDrawPalette
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirectDrawClipper
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IUnknown
,
&
IID_IDirect3DDevice3
,
S_OK
},
};
IDirect3DDevice3
*
device
;
HWND
window
;
window
=
CreateWindowA
(
"static"
,
"ddraw_test"
,
WS_OVERLAPPEDWINDOW
,
0
,
0
,
640
,
480
,
0
,
0
,
0
,
0
);
if
(
!
(
device
=
create_device
(
window
,
DDSCL_NORMAL
)))
{
skip
(
"Failed to create D3D device, skipping test.
\n
"
);
DestroyWindow
(
window
);
return
;
}
test_qi
(
"device_qi"
,
(
IUnknown
*
)
device
,
&
IID_IDirect3DDevice3
,
tests
,
sizeof
(
tests
)
/
sizeof
(
*
tests
));
IDirect3DDevice3_Release
(
device
);
DestroyWindow
(
window
);
}
START_TEST
(
ddraw4
)
{
test_process_vertices
();
...
...
@@ -1769,4 +1835,5 @@ START_TEST(ddraw4)
test_zenable
();
test_ck_rgba
();
test_surface_qi
();
test_device_qi
();
}
dlls/ddraw/tests/ddraw7.c
View file @
9804ebcd
...
...
@@ -1575,6 +1575,72 @@ static void test_surface_qi(void)
DestroyWindow
(
window
);
}
static
void
test_device_qi
(
void
)
{
static
const
struct
qi_test
tests
[]
=
{
{
&
IID_IDirect3DTexture2
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirect3DTexture
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirectDrawGammaControl
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirectDrawColorControl
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirectDrawSurface7
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirectDrawSurface4
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirectDrawSurface3
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirectDrawSurface2
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirectDrawSurface
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirect3DDevice7
,
&
IID_IDirect3DDevice7
,
S_OK
},
{
&
IID_IDirect3DDevice3
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirect3DDevice2
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirect3DDevice
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirect3DRampDevice
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirect3DRGBDevice
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirect3DHALDevice
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirect3DMMXDevice
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirect3DRefDevice
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirect3DTnLHalDevice
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirect3DNullDevice
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirect3D7
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirect3D3
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirect3D2
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirect3D
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirectDraw7
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirectDraw4
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirectDraw3
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirectDraw2
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirectDraw
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirect3DLight
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirect3DMaterial
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirect3DMaterial2
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirect3DMaterial3
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirect3DExecuteBuffer
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirect3DViewport
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirect3DViewport2
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirect3DViewport3
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirect3DVertexBuffer
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirect3DVertexBuffer7
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirectDrawPalette
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IDirectDrawClipper
,
NULL
,
E_NOINTERFACE
},
{
&
IID_IUnknown
,
&
IID_IDirect3DDevice7
,
S_OK
},
};
IDirect3DDevice7
*
device
;
HWND
window
;
window
=
CreateWindowA
(
"static"
,
"ddraw_test"
,
WS_OVERLAPPEDWINDOW
,
0
,
0
,
640
,
480
,
0
,
0
,
0
,
0
);
if
(
!
(
device
=
create_device
(
window
,
DDSCL_NORMAL
)))
{
skip
(
"Failed to create D3D device, skipping test.
\n
"
);
DestroyWindow
(
window
);
return
;
}
test_qi
(
"device_qi"
,
(
IUnknown
*
)
device
,
&
IID_IDirect3DDevice7
,
tests
,
sizeof
(
tests
)
/
sizeof
(
*
tests
));
IDirect3DDevice7_Release
(
device
);
DestroyWindow
(
window
);
}
START_TEST
(
ddraw7
)
{
HMODULE
module
=
GetModuleHandleA
(
"ddraw.dll"
);
...
...
@@ -1596,4 +1662,5 @@ START_TEST(ddraw7)
test_zenable
();
test_ck_rgba
();
test_surface_qi
();
test_device_qi
();
}
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