d3dx9/tests: Skip a test if DXTn texture formats are not supported.

This commit is contained in:
Matteo Bruni 2014-03-13 16:31:08 +01:00 committed by Alexandre Julliard
parent d96d0af83d
commit d6a919af89
1 changed files with 16 additions and 9 deletions

View File

@ -341,15 +341,22 @@ static void test_D3DXCheckTextureRequirements(IDirect3DDevice9 *device)
ok(format == expected, "Returned format %u, expected %u\n", format, expected);
/* Block-based texture formats and size < block size. */
format = D3DFMT_DXT1;
width = 2; height = 2;
mipmaps = 1;
hr = D3DXCheckTextureRequirements(device, &width, &height, &mipmaps, 0, &format, D3DPOOL_DEFAULT);
ok(hr == D3D_OK, "D3DXCheckTextureRequirements returned %#x, expected %#x\n", hr, D3D_OK);
ok(width == 4, "Returned width %d, expected %d\n", width, 4);
ok(height == 4, "Returned height %d, expected %d\n", height, 4);
ok(mipmaps == 1, "Returned mipmaps %d, expected %d\n", mipmaps, 1);
ok(format == D3DFMT_DXT1, "Returned format %u, expected %u\n", format, D3DFMT_DXT1);
if (has_2d_dxt5)
{
format = D3DFMT_DXT5;
width = 2; height = 2;
mipmaps = 1;
hr = D3DXCheckTextureRequirements(device, &width, &height, &mipmaps, 0, &format, D3DPOOL_DEFAULT);
ok(hr == D3D_OK, "D3DXCheckTextureRequirements returned %#x, expected %#x\n", hr, D3D_OK);
ok(width == 4, "Returned width %d, expected %d\n", width, 4);
ok(height == 4, "Returned height %d, expected %d\n", height, 4);
ok(mipmaps == 1, "Returned mipmaps %d, expected %d\n", mipmaps, 1);
ok(format == D3DFMT_DXT5, "Returned format %u, expected %u\n", format, D3DFMT_DXT5);
}
else
{
skip("D3DFMT_DXT5 textures are not supported, skipping a test.\n");
}
IDirect3D9_Release(d3d);
}