From e892f061751d0178f840f4db787c3b689186c099 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rico=20Sch=C3=BCller?= Date: Tue, 24 Jan 2012 09:48:45 +0100 Subject: [PATCH] d3dx9/tests: Add effect parameter value SetIntArray() test. --- dlls/d3dx9_36/tests/effect.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/dlls/d3dx9_36/tests/effect.c b/dlls/d3dx9_36/tests/effect.c index 3af1d14b3d0..80357353daa 100644 --- a/dlls/d3dx9_36/tests/effect.c +++ b/dlls/d3dx9_36/tests/effect.c @@ -1756,6 +1756,32 @@ 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); + + /* SetIntArray */ + *input_value = 123456; + for (l = 0; l < res_desc->Bytes / sizeof(*input_value); ++l) + { + *(input_value + l) = *(input_value + l - 1) + 23; + } + memcpy(expected_value, &blob[res_value_offset], res_desc->Bytes); + hr = effect->lpVtbl->SetIntArray(effect, parameter, (INT *)input_value, res_desc->Bytes / sizeof(*input_value)); + if (res_desc->Class == D3DXPC_SCALAR + || res_desc->Class == D3DXPC_VECTOR + || res_desc->Class == D3DXPC_MATRIX_ROWS) + { + for (l = 0; l < res_desc->Bytes / sizeof(*input_value); ++l) + { + set_number(expected_value + l, res_desc->Type, input_value + l, D3DXPT_INT); + } + ok(hr == D3D_OK, "%u - %s: SetIntArray failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK); + } + else + { + ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetIntArray 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);