[PATCH 3/5] d3dx9/tests: Skip a test if DXTn texture formats are not supported.

Matteo Bruni mbruni at codeweavers.com
Thu Mar 13 10:31:08 CDT 2014


---
 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);
 }
-- 
1.8.3.2




More information about the wine-patches mailing list