Matteo Bruni : d3dx9/tests: Skip a test if DXTn texture formats are not supported.
Alexandre Julliard
julliard at winehq.org
Thu Mar 13 14:40:35 CDT 2014
Module: wine
Branch: master
Commit: d6a919af89d5154e8892f0bcddf961a86fdcc43e
URL: http://source.winehq.org/git/wine.git/?a=commit;h=d6a919af89d5154e8892f0bcddf961a86fdcc43e
Author: Matteo Bruni <mbruni at codeweavers.com>
Date: Thu Mar 13 16:31:08 2014 +0100
d3dx9/tests: Skip a test if DXTn texture formats are not supported.
---
dlls/d3dx9_36/tests/texture.c | 25 ++++++++++++++++---------
1 file changed, 16 insertions(+), 9 deletions(-)
diff --git a/dlls/d3dx9_36/tests/texture.c b/dlls/d3dx9_36/tests/texture.c
index aea09d5..1a85d15 100644
--- a/dlls/d3dx9_36/tests/texture.c
+++ b/dlls/d3dx9_36/tests/texture.c
@@ -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);
}
More information about the wine-cvs
mailing list