Matteo Bruni (@Mystral) commented about dlls/d3dx9_36/tests/effect.c:
- //hr = effect->lpVtbl->SetRawValue( effect, INVALID_HANDLE_VALUE, NULL, 0, 1 );
- //ok( hr == D3DERR_INVALIDCALL, "Got result %#x, expected 0 (D3D_INVALIDCALL).\n", hr );
- //hr = effect->lpVtbl->SetRawValue( effect, INVALID_HANDLE_VALUE, NULL, 1, 1 );
- //ok( hr == D3DERR_INVALIDCALL, "Got result %#x, expected 0 (D3D_INVALIDCALL).\n", hr );
- test_effect_setrawvalue_init_floats();
- /* Begin value loop. */
- for (x = 0; x < (sizeof( test_set_raw_data_values ) / sizeof( struct test_set_raw_data_value )); x++)
- {
result_buf = malloc( test_set_raw_data_values[x].expected_data_len );
if (result_buf)
{
memset( result_buf, '\0', test_set_raw_data_values[x].expected_data_len );
hr = effect->lpVtbl->SetRawValue( effect,
effect->lpVtbl->GetParameterByName( effect, NULL, test_set_raw_data_values[x].param_name ),
Let's put that on its own line and make sure to check the result with an ok() call. Checking that it's non-NULL is enough.
Also that way you can avoid an extra GetParameterByName() call immediately afterwards.