Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Davide Beatrici
wine
Commits
08c34e3f
Commit
08c34e3f
authored
10 months ago
by
Elizabeth Figura
Committed by
Alexandre Julliard
10 months ago
Browse files
Options
Downloads
Patches
Plain Diff
ddraw/tests: Test GetVertexBufferDesc().
parent
4d289c0c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dlls/ddraw/tests/ddraw4.c
+71
-0
71 additions, 0 deletions
dlls/ddraw/tests/ddraw4.c
dlls/ddraw/tests/ddraw7.c
+71
-0
71 additions, 0 deletions
dlls/ddraw/tests/ddraw7.c
with
142 additions
and
0 deletions
dlls/ddraw/tests/ddraw4.c
+
71
−
0
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();
}
This diff is collapsed.
Click to expand it.
dlls/ddraw/tests/ddraw7.c
+
71
−
0
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();
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment