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: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
f8c1c1778a
commit
0bdae1a0b8
|
@ -6959,6 +6959,17 @@ static void test_specular_lighting(void)
|
||||||
D3DVERTEX *quad;
|
D3DVERTEX *quad;
|
||||||
WORD *indices;
|
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));
|
quad = HeapAlloc(GetProcessHeap(), 0, vertices_side * vertices_side * sizeof(*quad));
|
||||||
indices = HeapAlloc(GetProcessHeap(), 0, indices_count * sizeof(*indices));
|
indices = HeapAlloc(GetProcessHeap(), 0, indices_count * sizeof(*indices));
|
||||||
for (i = 0, y = 0; y < vertices_side; ++y)
|
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);
|
hr = IDirect3DDevice2_GetDirect3D(device, &d3d);
|
||||||
ok(SUCCEEDED(hr), "Failed to get D3D interface, hr %#x.\n", hr);
|
ok(SUCCEEDED(hr), "Failed to get D3D interface, hr %#x.\n", hr);
|
||||||
|
|
||||||
|
|
|
@ -4230,6 +4230,15 @@ static void test_specular_lighting(void)
|
||||||
} *quad;
|
} *quad;
|
||||||
WORD *indices;
|
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));
|
quad = HeapAlloc(GetProcessHeap(), 0, vertices_side * vertices_side * sizeof(*quad));
|
||||||
indices = HeapAlloc(GetProcessHeap(), 0, indices_count * sizeof(*indices));
|
indices = HeapAlloc(GetProcessHeap(), 0, indices_count * sizeof(*indices));
|
||||||
for (i = 0, y = 0; y < vertices_side; ++y)
|
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);
|
hr = IDirect3DDevice3_GetDirect3D(device, &d3d);
|
||||||
ok(SUCCEEDED(hr), "Failed to get D3D interface, hr %#x.\n", hr);
|
ok(SUCCEEDED(hr), "Failed to get D3D interface, hr %#x.\n", hr);
|
||||||
|
|
||||||
|
|
|
@ -3941,6 +3941,15 @@ static void test_specular_lighting(void)
|
||||||
} *quad;
|
} *quad;
|
||||||
WORD *indices;
|
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));
|
quad = HeapAlloc(GetProcessHeap(), 0, vertices_side * vertices_side * sizeof(*quad));
|
||||||
indices = HeapAlloc(GetProcessHeap(), 0, indices_count * sizeof(*indices));
|
indices = HeapAlloc(GetProcessHeap(), 0, indices_count * sizeof(*indices));
|
||||||
for (i = 0, y = 0; y < vertices_side; ++y)
|
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);
|
hr = IDirect3DDevice7_GetRenderTarget(device, &rt);
|
||||||
ok(SUCCEEDED(hr), "Failed to get render target, hr %#x.\n", hr);
|
ok(SUCCEEDED(hr), "Failed to get render target, hr %#x.\n", hr);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue