d3d9/tests: Actually test some return values (PVS-Studio).

oldstable
Michael Stefaniuc 2015-03-04 09:21:17 +01:00 committed by Alexandre Julliard
parent 51e3750fea
commit 148d6e3c10
3 changed files with 8 additions and 0 deletions

View File

@ -738,6 +738,7 @@ static void test_user_memory(void)
ok(locked_rect.Pitch == 128 * 4, "Got unexpected pitch %d.\n", locked_rect.Pitch);
ok(locked_rect.pBits == mem, "Got unexpected pBits %p, expected %p.\n", locked_rect.pBits, mem);
hr = IDirect3DSurface9_UnlockRect(surface);
ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#x.\n", hr);
IDirect3DSurface9_Release(surface);
hr = IDirect3DDevice9Ex_CreateOffscreenPlainSurfaceEx(device, 128, 128, D3DFMT_A8R8G8B8,
@ -750,6 +751,7 @@ static void test_user_memory(void)
ok(locked_rect.Pitch == 128 * 4, "Got unexpected pitch %d.\n", locked_rect.Pitch);
ok(locked_rect.pBits == mem, "Got unexpected pBits %p, expected %p.\n", locked_rect.pBits, mem);
hr = IDirect3DSurface9_UnlockRect(surface);
ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#x.\n", hr);
IDirect3DSurface9_Release(surface);
}

View File

@ -1081,6 +1081,7 @@ static void test_swapchain(void)
ok(SUCCEEDED(hr), "Failed to get the implicit swapchain (%08x)\n", hr);
/* Check if the back buffer count was modified */
hr = IDirect3DSwapChain9_GetPresentParameters(swapchain0, &d3dpp);
ok(SUCCEEDED(hr), "Failed to get present parameters, hr %#x.\n", hr);
ok(d3dpp.BackBufferCount == 1, "Got unexpected back buffer count %u.\n", d3dpp.BackBufferCount);
IDirect3DSwapChain9_Release(swapchain0);
@ -8821,6 +8822,7 @@ static void test_volume_blocks(void)
{
hr = IDirect3DDevice9_CreateVolumeTexture(device, formats[i].block_width, formats[i].block_height,
2, 2, 0, formats[i].fmt, D3DPOOL_SCRATCH, &texture, NULL);
ok(SUCCEEDED(hr), "Failed to create volume texture, hr %#x.\n", hr);
hr = IDirect3DVolumeTexture9_LockBox(texture, 1, &locked_box, NULL, 0);
ok(SUCCEEDED(hr), "Failed to lock volume texture mipmap, hr %#x.\n", hr);
@ -9728,6 +9730,7 @@ static void test_resource_type(void)
{
hr = IDirect3DDevice9_CreateVolumeTexture(device, 2, 4, 8, 4, 0, D3DFMT_X8R8G8B8,
D3DPOOL_SYSTEMMEM, &volume_texture, NULL);
ok(SUCCEEDED(hr), "Failed to create volume texture, hr %#x.\n", hr);
type = IDirect3DVolumeTexture9_GetType(volume_texture);
ok(type == D3DRTYPE_VOLUMETEXTURE, "Expected type D3DRTYPE_VOLUMETEXTURE, got %u.\n", type);

View File

@ -12095,6 +12095,7 @@ static void loop_index_test(void)
ok(SUCCEEDED(hr), "IDirect3DDevice9_SetVertexShaderConstantI returned %#x.\n", hr);
hr = IDirect3DDevice9_BeginScene(device);
ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr);
hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, 3 * sizeof(float));
ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr);
hr = IDirect3DDevice9_EndScene(device);
@ -14793,6 +14794,7 @@ static void multisampled_depth_buffer_test(void)
IDirect3DSurface9_Release(ds);
hr = IDirect3DDevice9_CreateDepthStencilSurface(device, 640, 480, D3DFMT_D24S8,
D3DMULTISAMPLE_2_SAMPLES, 0, TRUE, &ds, NULL);
ok(SUCCEEDED(hr), "Failed to create depth/stencil, hr %#x.\n", hr);
hr = IDirect3DDevice9_SetDepthStencilSurface(device, ds);
ok(SUCCEEDED(hr), "Failed to set depth/stencil, hr %#x.\n", hr);
@ -15074,6 +15076,7 @@ static void resz_test(void)
ok(SUCCEEDED(hr), "Failed to create render target, hr %#x.\n", hr);
hr = IDirect3DDevice9_CreateDepthStencilSurface(device, 640, 480, D3DFMT_D24S8,
D3DMULTISAMPLE_2_SAMPLES, 0, TRUE, &ds, NULL);
ok(SUCCEEDED(hr), "Failed to create depth/stencil, hr %#x.\n", hr);
hr = IDirect3DDevice9_CreateRenderTarget(device, 640, 480, D3DFMT_A8R8G8B8,
D3DMULTISAMPLE_NONE, 0, TRUE, &readback, NULL);
ok(SUCCEEDED(hr), "Failed to create readback surface, hr %#x.\n", hr);