Commit 0bdae1a0 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

ddraw/tests: Skip initialising "quad" and "indices" in test_specular_lighting()…

ddraw/tests: Skip initialising "quad" and "indices" in test_specular_lighting() if a 3D device can't be created. This also happens to avoid leaking them in that case. Signed-off-by: 's avatarHenri Verbeet <hverbeet@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent f8c1c177
......@@ -6959,6 +6959,17 @@ static void test_specular_lighting(void)
D3DVERTEX *quad;
WORD *indices;
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
0, 0, 640, 480, 0, 0, 0, 0);
ddraw = create_ddraw();
ok(!!ddraw, "Failed to create a ddraw object.\n");
if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
return;
}
quad = HeapAlloc(GetProcessHeap(), 0, vertices_side * vertices_side * sizeof(*quad));
indices = HeapAlloc(GetProcessHeap(), 0, indices_count * sizeof(*indices));
for (i = 0, y = 0; y < vertices_side; ++y)
......@@ -6988,17 +6999,6 @@ static void test_specular_lighting(void)
}
}
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
0, 0, 640, 480, 0, 0, 0, 0);
ddraw = create_ddraw();
ok(!!ddraw, "Failed to create a ddraw object.\n");
if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
return;
}
hr = IDirect3DDevice2_GetDirect3D(device, &d3d);
ok(SUCCEEDED(hr), "Failed to get D3D interface, hr %#x.\n", hr);
......
......@@ -4230,6 +4230,15 @@ static void test_specular_lighting(void)
} *quad;
WORD *indices;
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 a 3D device, skipping test.\n");
DestroyWindow(window);
return;
}
quad = HeapAlloc(GetProcessHeap(), 0, vertices_side * vertices_side * sizeof(*quad));
indices = HeapAlloc(GetProcessHeap(), 0, indices_count * sizeof(*indices));
for (i = 0, y = 0; y < vertices_side; ++y)
......@@ -4257,15 +4266,6 @@ static void test_specular_lighting(void)
}
}
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 a 3D device, skipping test.\n");
DestroyWindow(window);
return;
}
hr = IDirect3DDevice3_GetDirect3D(device, &d3d);
ok(SUCCEEDED(hr), "Failed to get D3D interface, hr %#x.\n", hr);
......
......@@ -3941,6 +3941,15 @@ static void test_specular_lighting(void)
} *quad;
WORD *indices;
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 a 3D device, skipping test.\n");
DestroyWindow(window);
return;
}
quad = HeapAlloc(GetProcessHeap(), 0, vertices_side * vertices_side * sizeof(*quad));
indices = HeapAlloc(GetProcessHeap(), 0, indices_count * sizeof(*indices));
for (i = 0, y = 0; y < vertices_side; ++y)
......@@ -3968,15 +3977,6 @@ static void test_specular_lighting(void)
}
}
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 a 3D device, skipping test.\n");
DestroyWindow(window);
return;
}
hr = IDirect3DDevice7_GetRenderTarget(device, &rt);
ok(SUCCEEDED(hr), "Failed to get render target, hr %#x.\n", hr);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment