=?UTF-8?Q?Stefan=20D=C3=B6singer=20?=: d3d8/tests: Add more GetBackBuffer error handling tests.

Alexandre Julliard julliard at wine.codeweavers.com
Thu Sep 3 07:34:28 CDT 2015


Module: wine
Branch: master
Commit: 76c43d817746bb9c81b36e0d0bec4bb0b2ffbdbb
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=76c43d817746bb9c81b36e0d0bec4bb0b2ffbdbb

Author: Stefan Dösinger <stefan at codeweavers.com>
Date:   Thu Sep  3 12:52:55 2015 +0200

d3d8/tests: Add more GetBackBuffer error handling tests.

---

 dlls/d3d8/tests/device.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/dlls/d3d8/tests/device.c b/dlls/d3d8/tests/device.c
index 660e202..47326b5 100644
--- a/dlls/d3d8/tests/device.c
+++ b/dlls/d3d8/tests/device.c
@@ -280,6 +280,12 @@ static void test_swapchain(void)
         goto cleanup;
     }
 
+    backbuffer = (void *)0xdeadbeef;
+    /* IDirect3DDevice8::GetBackBuffer crashes if a NULL output pointer is passed. */
+    hr = IDirect3DDevice8_GetBackBuffer(device, 1, D3DBACKBUFFER_TYPE_MONO, &backbuffer);
+    ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr);
+    ok(!backbuffer, "The back buffer pointer is %p, expected NULL.\n", backbuffer);
+
     memset(&d3dpp, 0, sizeof(d3dpp));
     d3dpp.Windowed = TRUE;
     d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;
@@ -300,6 +306,9 @@ static void test_swapchain(void)
     ok(SUCCEEDED(hr), "Failed to create a swapchain (%#08x)\n", hr);
     if(SUCCEEDED(hr)) {
         /* Swapchain 3, created with backbuffercount 2 */
+        hr = IDirect3DSwapChain8_GetBackBuffer(swapchain3, 0, 0, NULL);
+        ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr);
+
         backbuffer = (void *) 0xdeadbeef;
         hr = IDirect3DSwapChain8_GetBackBuffer(swapchain3, 0, 0, &backbuffer);
         ok(SUCCEEDED(hr), "Failed to get the 1st back buffer (%#08x)\n", hr);




More information about the wine-cvs mailing list