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
08c34e3f
Commit
08c34e3f
authored
Apr 19, 2024
by
Zebediah Figura
Committed by
Alexandre Julliard
May 07, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw/tests: Test GetVertexBufferDesc().
parent
4d289c0c
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
142 additions
and
0 deletions
+142
-0
ddraw4.c
dlls/ddraw/tests/ddraw4.c
+71
-0
ddraw7.c
dlls/ddraw/tests/ddraw7.c
+71
-0
No files found.
dlls/ddraw/tests/ddraw4.c
View file @
08c34e3f
...
...
@@ -19663,6 +19663,76 @@ static void test_multiple_devices(void)
DestroyWindow
(
window
);
}
static
void
test_vb_desc
(
void
)
{
IDirect3DVertexBuffer
*
vb
;
D3DVERTEXBUFFERDESC
desc
;
IDirectDraw4
*
ddraw
;
IDirect3D3
*
d3d
;
ULONG
refcount
;
HWND
window
;
HRESULT
hr
;
static
const
DWORD
caps_tests
[]
=
{
0
,
D3DVBCAPS_WRITEONLY
,
D3DVBCAPS_SYSTEMMEMORY
,
D3DVBCAPS_SYSTEMMEMORY
|
D3DVBCAPS_WRITEONLY
};
static
const
DWORD
fvf_tests
[]
=
{
D3DFVF_XYZ
,
D3DFVF_XYZRHW
};
ddraw
=
create_ddraw
();
ok
(
!!
ddraw
,
"Failed to create a ddraw object.
\n
"
);
window
=
create_window
();
ok
(
!!
window
,
"Failed to create a window.
\n
"
);
hr
=
IDirectDraw4_SetCooperativeLevel
(
ddraw
,
window
,
DDSCL_EXCLUSIVE
|
DDSCL_FULLSCREEN
);
ok
(
hr
==
DD_OK
,
"SetCooperativeLevel failed, hr %#lx.
\n
"
,
hr
);
hr
=
IDirectDraw4_QueryInterface
(
ddraw
,
&
IID_IDirect3D3
,
(
void
**
)
&
d3d
);
if
(
FAILED
(
hr
))
{
skip
(
"D3D interface is not available, skipping test.
\n
"
);
IDirectDraw4_Release
(
ddraw
);
return
;
}
for
(
unsigned
int
i
=
0
;
i
<
ARRAY_SIZE
(
caps_tests
);
++
i
)
{
for
(
unsigned
int
j
=
0
;
j
<
ARRAY_SIZE
(
fvf_tests
);
++
j
)
{
winetest_push_context
(
"caps %#lx, fvf %#lx"
,
caps_tests
[
i
],
fvf_tests
[
j
]);
desc
.
dwSize
=
sizeof
(
desc
);
desc
.
dwCaps
=
caps_tests
[
i
];
desc
.
dwFVF
=
fvf_tests
[
j
];
desc
.
dwNumVertices
=
256
;
hr
=
IDirect3D3_CreateVertexBuffer
(
d3d
,
&
desc
,
&
vb
,
0
,
NULL
);
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
memset
(
&
desc
,
0
,
sizeof
(
desc
));
hr
=
IDirect3DVertexBuffer_GetVertexBufferDesc
(
vb
,
&
desc
);
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
ok
(
!
desc
.
dwSize
,
"Got size %lu.
\n
"
,
desc
.
dwSize
);
ok
(
desc
.
dwCaps
==
caps_tests
[
i
],
"Got caps %#lx.
\n
"
,
desc
.
dwCaps
);
ok
(
desc
.
dwFVF
==
fvf_tests
[
j
],
"Got FVF %#lx.
\n
"
,
desc
.
dwFVF
);
ok
(
desc
.
dwNumVertices
==
256
,
"Got %lu vertices.
\n
"
,
desc
.
dwNumVertices
);
IDirect3DVertexBuffer_Release
(
vb
);
winetest_pop_context
();
}
}
IDirect3D3_Release
(
d3d
);
DestroyWindow
(
window
);
refcount
=
IDirectDraw4_Release
(
ddraw
);
ok
(
!
refcount
,
"Device has %lu references left.
\n
"
,
refcount
);
}
START_TEST
(
ddraw4
)
{
DDDEVICEIDENTIFIER
identifier
;
...
...
@@ -19805,4 +19875,5 @@ START_TEST(ddraw4)
test_filling_convention
();
test_enum_devices
();
test_multiple_devices
();
test_vb_desc
();
}
dlls/ddraw/tests/ddraw7.c
View file @
08c34e3f
...
...
@@ -20119,6 +20119,76 @@ static void test_multiple_devices(void)
DestroyWindow
(
window
);
}
static
void
test_vb_desc
(
void
)
{
IDirect3DVertexBuffer7
*
vb
;
D3DVERTEXBUFFERDESC
desc
;
IDirectDraw7
*
ddraw
;
IDirect3D7
*
d3d
;
ULONG
refcount
;
HWND
window
;
HRESULT
hr
;
static
const
DWORD
caps_tests
[]
=
{
0
,
D3DVBCAPS_WRITEONLY
,
D3DVBCAPS_SYSTEMMEMORY
,
D3DVBCAPS_SYSTEMMEMORY
|
D3DVBCAPS_WRITEONLY
};
static
const
DWORD
fvf_tests
[]
=
{
D3DFVF_XYZ
,
D3DFVF_XYZRHW
};
ddraw
=
create_ddraw
();
ok
(
!!
ddraw
,
"Failed to create a ddraw object.
\n
"
);
window
=
create_window
();
ok
(
!!
window
,
"Failed to create a window.
\n
"
);
hr
=
IDirectDraw7_SetCooperativeLevel
(
ddraw
,
window
,
DDSCL_EXCLUSIVE
|
DDSCL_FULLSCREEN
);
ok
(
hr
==
DD_OK
,
"SetCooperativeLevel failed, hr %#lx.
\n
"
,
hr
);
hr
=
IDirectDraw7_QueryInterface
(
ddraw
,
&
IID_IDirect3D7
,
(
void
**
)
&
d3d
);
if
(
FAILED
(
hr
))
{
skip
(
"D3D interface is not available, skipping test.
\n
"
);
IDirectDraw7_Release
(
ddraw
);
return
;
}
for
(
unsigned
int
i
=
0
;
i
<
ARRAY_SIZE
(
caps_tests
);
++
i
)
{
for
(
unsigned
int
j
=
0
;
j
<
ARRAY_SIZE
(
fvf_tests
);
++
j
)
{
winetest_push_context
(
"caps %#lx, fvf %#lx"
,
caps_tests
[
i
],
fvf_tests
[
j
]);
desc
.
dwSize
=
sizeof
(
desc
);
desc
.
dwCaps
=
caps_tests
[
i
];
desc
.
dwFVF
=
fvf_tests
[
j
];
desc
.
dwNumVertices
=
256
;
hr
=
IDirect3D7_CreateVertexBuffer
(
d3d
,
&
desc
,
&
vb
,
0
);
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
memset
(
&
desc
,
0
,
sizeof
(
desc
));
hr
=
IDirect3DVertexBuffer7_GetVertexBufferDesc
(
vb
,
&
desc
);
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
ok
(
!
desc
.
dwSize
,
"Got size %lu.
\n
"
,
desc
.
dwSize
);
ok
(
desc
.
dwCaps
==
caps_tests
[
i
],
"Got caps %#lx.
\n
"
,
desc
.
dwCaps
);
ok
(
desc
.
dwFVF
==
fvf_tests
[
j
],
"Got FVF %#lx.
\n
"
,
desc
.
dwFVF
);
ok
(
desc
.
dwNumVertices
==
256
,
"Got %lu vertices.
\n
"
,
desc
.
dwNumVertices
);
IDirect3DVertexBuffer7_Release
(
vb
);
winetest_pop_context
();
}
}
IDirect3D7_Release
(
d3d
);
DestroyWindow
(
window
);
refcount
=
IDirectDraw7_Release
(
ddraw
);
ok
(
!
refcount
,
"Device has %lu references left.
\n
"
,
refcount
);
}
START_TEST
(
ddraw7
)
{
DDDEVICEIDENTIFIER2
identifier
;
...
...
@@ -20295,4 +20365,5 @@ START_TEST(ddraw7)
run_for_each_device_type
(
test_user_memory
);
test_flip_3d
();
test_multiple_devices
();
test_vb_desc
();
}
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