Module: wine Branch: master Commit: 379c6564dbb024c45f6cc7ce1063885988cdd7ed URL: http://source.winehq.org/git/wine.git/?a=commit;h=379c6564dbb024c45f6cc7ce10...
Author: Stefan Dösinger stefan@codeweavers.com Date: Mon Mar 10 23:43:09 2014 +0100
d3d9/tests: Show that a failing SetPrivateData call does not clear the old contents.
---
dlls/d3d9/tests/device.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
diff --git a/dlls/d3d9/tests/device.c b/dlls/d3d9/tests/device.c index 08a5be4..93f43fa 100644 --- a/dlls/d3d9/tests/device.c +++ b/dlls/d3d9/tests/device.c @@ -5109,6 +5109,20 @@ static void test_private_data(void) device, sizeof(IUnknown *) * 2, D3DSPD_IUNKNOWN); ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr);
+ /* A failing SetPrivateData call does not clear the old data with the same tag. */ + hr = IDirect3DSurface9_SetPrivateData(surface, &IID_IDirect3DVertexBuffer9, device, + sizeof(device), D3DSPD_IUNKNOWN); + ok(SUCCEEDED(hr), "Failed to set private data, hr %#x.\n", hr); + hr = IDirect3DSurface9_SetPrivateData(surface, &IID_IDirect3DVertexBuffer9, device, + sizeof(device) * 2, D3DSPD_IUNKNOWN); + ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); + size = sizeof(ptr); + hr = IDirect3DSurface9_GetPrivateData(surface, &IID_IDirect3DVertexBuffer9, &ptr, &size); + ok(SUCCEEDED(hr), "Failed to get private data, hr %#x.\n", hr); + IUnknown_Release(ptr); + hr = IDirect3DSurface9_FreePrivateData(surface, &IID_IDirect3DVertexBuffer9); + ok(SUCCEEDED(hr), "Failed to free private data, hr %#x.\n", hr); + refcount = get_refcount((IUnknown *)device); hr = IDirect3DSurface9_SetPrivateData(surface, &IID_IDirect3DSurface9 /* Abuse this tag */, device, sizeof(IUnknown *), D3DSPD_IUNKNOWN); @@ -5176,6 +5190,7 @@ static void test_private_data(void) ok(SUCCEEDED(hr), "Failed to set private data, hr %#x.\n", hr); hr = IDirect3DSurface9_GetPrivateData(surface2, &IID_IDirect3DVertexBuffer9, data, &size); ok(hr == D3DERR_NOTFOUND, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DSurface9_FreePrivateData(surface, &IID_IDirect3DVertexBuffer9); ok(SUCCEEDED(hr), "Failed to free private data, hr %#x.\n", hr);