[PATCH 1/2] d3d8/tests: Use correct index variable in test_resource_access() (Coverity).

Józef Kucia jkucia at codeweavers.com
Fri Nov 30 05:04:38 CST 2018


Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
---
 dlls/d3d8/tests/device.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/dlls/d3d8/tests/device.c b/dlls/d3d8/tests/device.c
index 49d2a9818cc4..a812f032a3d9 100644
--- a/dlls/d3d8/tests/device.c
+++ b/dlls/d3d8/tests/device.c
@@ -9081,17 +9081,19 @@ static void test_resource_access(void)
         HRESULT expected_hr;
         D3DLOCKED_BOX lb;
 
-        if (tests[j].format == FORMAT_DEPTH)
+        if (tests[i].format == FORMAT_DEPTH)
             continue;
 
-        if (tests[j].format == FORMAT_ATI2)
+        if (tests[i].format == FORMAT_ATI2)
             format = MAKEFOURCC('A','T','I','2');
         else
             format = colour_format;
 
         hr = IDirect3DDevice8_CreateVolumeTexture(device, 16, 16, 1, 1,
                 tests[i].usage, format, tests[i].pool, &texture);
-        ok(hr == (!(tests[i].usage & ~D3DUSAGE_DYNAMIC) ? D3D_OK : D3DERR_INVALIDCALL),
+        todo_wine_if(tests[i].pool == D3DPOOL_SCRATCH && tests[i].format == FORMAT_ATI2)
+        ok(hr == (!(tests[i].usage & ~D3DUSAGE_DYNAMIC) && tests[i].format != FORMAT_ATI2
+                ? D3D_OK : D3DERR_INVALIDCALL),
                 "Test %u: Got unexpected hr %#x.\n", i, hr);
         if (FAILED(hr))
             continue;
-- 
2.18.1




More information about the wine-devel mailing list