ddraw/tests: Split up test_coop_level_surf_create().

This commit is contained in:
Henri Verbeet 2012-06-01 17:22:49 +02:00 committed by Alexandre Julliard
parent d61d842630
commit 34c9586b60
5 changed files with 96 additions and 76 deletions

View File

@ -3626,80 +3626,6 @@ static void z_format_test(void)
ok(count, "Expected at least one supported Z Buffer format\n");
}
static void test_coop_level_surf_create(void)
{
IDirectDrawSurface7 *surface7;
IDirectDrawSurface4 *surface4;
IDirectDrawSurface *surface1;
IDirectDraw7 *ddraw7;
IDirectDraw4 *ddraw4;
IDirectDraw2 *ddraw2;
IDirectDraw *ddraw1;
DDSURFACEDESC2 ddsd2;
DDSURFACEDESC ddsd;
HRESULT hr;
/* IDirectDraw */
if (FAILED(hr = DirectDrawCreate(NULL, &ddraw1, NULL)))
{
skip("Failed to create IDirectDraw object (%#x), skipping tests.\n", hr);
return;
}
memset(&ddsd, 0, sizeof(ddsd));
ddsd.dwSize = sizeof(ddsd);
ddsd.dwFlags = DDSD_CAPS;
ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
hr = IDirectDraw_CreateSurface(ddraw1, &ddsd, &surface1, NULL);
ok(hr == DDERR_NOCOOPERATIVELEVELSET, "Surface creation returned hr %#x.\n", hr);
/* IDirectDraw2 */
if (SUCCEEDED(IDirectDraw_QueryInterface(ddraw1, &IID_IDirectDraw2, (void **)&ddraw2)))
{
memset(&ddsd, 0, sizeof(ddsd));
ddsd.dwSize = sizeof(ddsd);
ddsd.dwFlags = DDSD_CAPS;
ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
hr = IDirectDraw2_CreateSurface(ddraw2, &ddsd, &surface1, NULL);
ok(hr == DDERR_NOCOOPERATIVELEVELSET, "Surface creation returned hr %#x.\n", hr);
IDirectDraw2_Release(ddraw2);
}
else skip("Failed to query IDirectDraw2 interface, skipping tests.\n");
/* IDirectDraw4 */
if (SUCCEEDED(IDirectDraw_QueryInterface(ddraw1, &IID_IDirectDraw4, (void **)&ddraw4)))
{
memset(&ddsd2, 0, sizeof(ddsd2));
ddsd2.dwSize = sizeof(ddsd2);
ddsd2.dwFlags = DDSD_CAPS;
ddsd2.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
hr = IDirectDraw4_CreateSurface(ddraw4, &ddsd2, &surface4, NULL);
ok(hr == DDERR_NOCOOPERATIVELEVELSET, "Surface creation returned hr %#x.\n", hr);
IDirectDraw4_Release(ddraw4);
}
else skip("Failed to query IDirectDraw4 interface, skipping tests.\n");
IDirectDraw_Release(ddraw1);
/* IDirectDraw7 */
if (FAILED(hr = pDirectDrawCreateEx(NULL, (void **)&ddraw7, &IID_IDirectDraw7, NULL)))
{
skip("Failed to create IDirectDraw7 object (%#x), skipping tests.\n", hr);
return;
}
memset(&ddsd2, 0, sizeof(ddsd2));
ddsd2.dwSize = sizeof(ddsd2);
ddsd2.dwFlags = DDSD_CAPS;
ddsd2.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
hr = IDirectDraw7_CreateSurface(ddraw7, &ddsd2, &surface7, NULL);
ok(hr == DDERR_NOCOOPERATIVELEVELSET, "Surface creation returned hr %#x.\n", hr);
IDirectDraw7_Release(ddraw7);
}
static void test_get_caps1(void)
{
D3DDEVICEDESC hw_caps, hel_caps;
@ -4053,6 +3979,4 @@ START_TEST(d3d)
test_get_caps1();
D3D1_releaseObjects();
}
test_coop_level_surf_create();
}

View File

@ -2414,6 +2414,29 @@ static void test_initialize(void)
}
}
static void test_coop_level_surf_create(void)
{
IDirectDrawSurface *surface;
IDirectDraw *ddraw;
DDSURFACEDESC ddsd;
HRESULT hr;
if (!(ddraw = create_ddraw()))
{
skip("Failed to create a ddraw object, skipping test.\n");
return;
}
memset(&ddsd, 0, sizeof(ddsd));
ddsd.dwSize = sizeof(ddsd);
ddsd.dwFlags = DDSD_CAPS;
ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
hr = IDirectDraw_CreateSurface(ddraw, &ddsd, &surface, NULL);
ok(hr == DDERR_NOCOOPERATIVELEVELSET, "Surface creation returned hr %#x.\n", hr);
IDirectDraw_Release(ddraw);
}
START_TEST(ddraw1)
{
test_coop_level_create_device_window();
@ -2432,4 +2455,5 @@ START_TEST(ddraw1)
test_redundant_mode_set();
test_coop_level_mode_set();
test_initialize();
test_coop_level_surf_create();
}

View File

@ -2533,6 +2533,29 @@ static void test_initialize(void)
CoUninitialize();
}
static void test_coop_level_surf_create(void)
{
IDirectDrawSurface *surface;
IDirectDraw2 *ddraw;
DDSURFACEDESC ddsd;
HRESULT hr;
if (!(ddraw = create_ddraw()))
{
skip("Failed to create a ddraw object, skipping test.\n");
return;
}
memset(&ddsd, 0, sizeof(ddsd));
ddsd.dwSize = sizeof(ddsd);
ddsd.dwFlags = DDSD_CAPS;
ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
hr = IDirectDraw2_CreateSurface(ddraw, &ddsd, &surface, NULL);
ok(hr == DDERR_NOCOOPERATIVELEVELSET, "Surface creation returned hr %#x.\n", hr);
IDirectDraw2_Release(ddraw);
}
START_TEST(ddraw2)
{
test_coop_level_create_device_window();
@ -2553,4 +2576,5 @@ START_TEST(ddraw2)
test_redundant_mode_set();
test_coop_level_mode_set();
test_initialize();
test_coop_level_surf_create();
}

View File

@ -2648,6 +2648,29 @@ static void test_initialize(void)
CoUninitialize();
}
static void test_coop_level_surf_create(void)
{
IDirectDrawSurface4 *surface;
IDirectDraw4 *ddraw;
DDSURFACEDESC2 ddsd;
HRESULT hr;
if (!(ddraw = create_ddraw()))
{
skip("Failed to create a ddraw object, skipping test.\n");
return;
}
memset(&ddsd, 0, sizeof(ddsd));
ddsd.dwSize = sizeof(ddsd);
ddsd.dwFlags = DDSD_CAPS;
ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
hr = IDirectDraw4_CreateSurface(ddraw, &ddsd, &surface, NULL);
ok(hr == DDERR_NOCOOPERATIVELEVELSET, "Surface creation returned hr %#x.\n", hr);
IDirectDraw4_Release(ddraw);
}
START_TEST(ddraw4)
{
test_process_vertices();
@ -2669,4 +2692,5 @@ START_TEST(ddraw4)
test_redundant_mode_set();
test_coop_level_mode_set();
test_initialize();
test_coop_level_surf_create();
}

View File

@ -2457,6 +2457,29 @@ static void test_initialize(void)
CoUninitialize();
}
static void test_coop_level_surf_create(void)
{
IDirectDrawSurface7 *surface;
IDirectDraw7 *ddraw;
DDSURFACEDESC2 ddsd;
HRESULT hr;
if (!(ddraw = create_ddraw()))
{
skip("Failed to create a ddraw object, skipping test.\n");
return;
}
memset(&ddsd, 0, sizeof(ddsd));
ddsd.dwSize = sizeof(ddsd);
ddsd.dwFlags = DDSD_CAPS;
ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
hr = IDirectDraw7_CreateSurface(ddraw, &ddsd, &surface, NULL);
ok(hr == DDERR_NOCOOPERATIVELEVELSET, "Surface creation returned hr %#x.\n", hr);
IDirectDraw7_Release(ddraw);
}
START_TEST(ddraw7)
{
HMODULE module = GetModuleHandleA("ddraw.dll");
@ -2485,4 +2508,5 @@ START_TEST(ddraw7)
test_redundant_mode_set();
test_coop_level_mode_set();
test_initialize();
test_coop_level_surf_create();
}