d3d9: update locked_rect only if wined3d_surface_map succeeded (try 3)

Henri Verbeet hverbeet at gmail.com
Tue Oct 15 11:33:28 CDT 2013


On 15 October 2013 18:10, Nikolay Sivov <bunglehead at gmail.com> wrote:
>> diff --git a/dlls/d3d9/tests/device.c b/dlls/d3d9/tests/device.c
>> index 02b4174..90d5c38 100644
>> --- a/dlls/d3d9/tests/device.c
>> +++ b/dlls/d3d9/tests/device.c
>> @@ -5404,6 +5404,10 @@ static void test_lockrect_invalid(void)
>>       ok(SUCCEEDED(hr), "Failed to lock surface with rect NULL, hr
>> %#x.\n", hr);
>>       hr = IDirect3DSurface9_LockRect(surface, &locked_rect, NULL, 0);
>>       ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr);
>> +    locked_rect.pBits = (BYTE *)0xdeadbeef;
>> +    hr = IDirect3DSurface9_LockRect(surface, &locked_rect, NULL, 0);
>> +    ok(!SUCCEEDED(hr) && locked_rect.pBits == NULL, "Failed to clear
>> pBits (%p)\n",
>> +            locked_rect.pBits);
>>       hr = IDirect3DSurface9_UnlockRect(surface);
>>       ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#x.\n", hr);
>>
>
> It looks like you could use existing LockRect() call that's already tested
> as failing. Also I think FAILED() is a preferred way to
> test HRESULT value for failure, but as existing code does - you could also
> test for exact failure code.
>
Yeah, I think it really just needs the intialization of pBits before
the existing LockRect() call, and an extra ok() call after the
existing one.



More information about the wine-devel mailing list