From 0ae7c573b1529b1b6a7929319f4af6e19348d263 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rico=20Sch=C3=BCller?= Date: Fri, 27 Jan 2012 10:31:38 +0100 Subject: [PATCH] d3dx9/tests: Add effect parameter value SetMatrixTranspose() test. --- dlls/d3dx9_36/tests/effect.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/dlls/d3dx9_36/tests/effect.c b/dlls/d3dx9_36/tests/effect.c index 31edcb6b9bf..5ff41a2f20e 100644 --- a/dlls/d3dx9_36/tests/effect.c +++ b/dlls/d3dx9_36/tests/effect.c @@ -1972,6 +1972,39 @@ static void test_effect_parameter_value(IDirect3DDevice9 *device) test_effect_parameter_value_GetTestGroup(&res[k], effect, expected_value, parameter, i); test_effect_parameter_value_ResetValue(&res[k], effect, &blob[res_value_offset], parameter, i); } + + /* SetMatrixTranspose */ + fvalue = 1.33; + for (l = 0; l < 16; ++l) + { + *(input_value + l) = *(DWORD *)&fvalue; + fvalue += 1.12; + } + memcpy(expected_value, &blob[res_value_offset], res_desc->Bytes); + hr = effect->lpVtbl->SetMatrixTranspose(effect, parameter, (D3DXMATRIX *)input_value); + if (!res_desc->Elements && res_desc->Class == D3DXPC_MATRIX_ROWS) + { + for (l = 0; l < 4; ++l) + { + UINT m; + + for (m = 0; m < 4; ++m) + { + if (m < res_desc->Rows && l < res_desc->Columns) + set_number(expected_value + l + m * res_desc->Columns, res_desc->Type, + input_value + l * 4 + m, D3DXPT_FLOAT); + } + + } + ok(hr == D3D_OK, "%u - %s: SetMatrixTranspose failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK); + } + else + { + ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetMatrixTranspose failed, got %#x, expected %#x\n", + i, res_full_name, hr, D3DERR_INVALIDCALL); + } + test_effect_parameter_value_GetTestGroup(&res[k], effect, expected_value, parameter, i); + test_effect_parameter_value_ResetValue(&res[k], effect, &blob[res_value_offset], parameter, i); } count = effect->lpVtbl->Release(effect);