[PATCH] d3dx9/tests: Add test for out of bound array selector in effect.

Paul Gofman gofmanp at gmail.com
Tue Mar 7 14:50:39 CST 2017


Thank you, I will update the patch with helper function ok() calls and 
will keep in mind to add more tests around multiple passes (including 
those you mention here) to dirty state update tests.

On 03/07/2017 11:43 PM, Matteo Bruni wrote:
> 2017-03-07 20:57 GMT+01:00 Paul Gofman <gofmanp at gmail.com>:
>> Hi Matteo,
>>
>>> It seems preferable to keep the detailed ok() calls from the old test
>>> instead of a generic ok() message on the return value of
>>> test_effect_preshader_compare_shader(). I guess you want to avoid to
>>> have ambiguous ok() calls in this helper. Until we get something like
>>> the with_context() thing from
>>> https://source.winehq.org/patches/data/131137 just passing a string
>>> with the test name to the helper function and using that in the ok()
>>> messages should do the trick.
>> The problem I had with it is actually when ok(...) with the call to this
>> function as the condition fails within the main test function body, I get
>> the line of failure inside this function (and not of the actual ok()), which
>> is confusing. I didn't check, it may be related to compiler
>> optimization/inlining somehow and may be not reproducible with default build
>> flags, but should not I avoid that? Maybe I would better trace failure
>> messages passing a main test context string?
> Not sure I understand your issue. I don't think there is any problem
> if the ok() call prints the line in the helper vs the line in the
> caller function. If you want to "fix" that you can, e.g. look at
> check_srv_desc() in d3d11/tests/d3d11.c for a possible solution. I
> don't think it's necessary here though.
>
>>>> +    hr = effect->lpVtbl->BeginPass(effect, 1);
>>>> +    todo_wine ok(hr == E_FAIL, "Got result %#x.\n", hr);
>>>> +    if (SUCCEEDED(hr))
>>>> +        effect->lpVtbl->EndPass(effect);
>>>> +
>>>> +    hr = effect->lpVtbl->BeginPass(effect, 1);
>>>> +    ok(hr == D3D_OK, "Got result %#x.\n", hr);
>>> That reminds me, do we have tests for two BeginPass() calls without an
>>> EndPass() in between? Might be interesting to see what happens both
>>> with the same or different pass index.
>> I could not find two consequent BeginPass() tests, I can add some as a
>> separate case, but do you think it is related here to the out of bounds
>> behaviour?
> No, that was an idea for a separate patch.
>
>> BTW if I add EndPass right after the first (failing) BeginPass here, it will
>> fail as expected.
>>
>>      When you say what happens with the same or different pass index, do you
>> mean a test where the same variable causes out of bounds behaviour in 2
>> different passes, and check if BeginPass() will succeed for another pass
>> after failing for the first one?
> No, just a BeginPass(..., 0) followed by BeginPass(..., 1) or
> something like that, with no EndPass() in between. Again, ideas for
> another patch.
>
>> The motivation under this test was that I started preparing my patches for
>> dirty parameter flags update and usage in CommitChanges, and while extending
>> the test I found that very specific behaviour of out of bounds access
>> processing. So I extracted this part of test into separate one to split the
>> thing. I actually suggest not to cover this todo's in the initial dirty
>> parameters update implementation leaving the out of bounds processing in
>> some consistent state, i. e., always clamp to range or always skip the state
>> (as it is done now) without failing BeginPass().
> Sure, that's okay. Whatever is less annoying for you when implementing
> the dirty state tracking.
>




More information about the wine-devel mailing list