d3d9/tests: Add out-of-bounds region tests.

Signed-off-by: Akihiro Sagawa <sagawa.aki@gmail.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
stable
Akihiro Sagawa 2019-12-02 17:39:33 +03:30 committed by Alexandre Julliard
parent 2a64dd44bc
commit 3329f50612
1 changed files with 20 additions and 0 deletions

View File

@ -19249,6 +19249,15 @@ static void add_dirty_rect_test(void)
HWND window;
D3DLOCKED_RECT locked_rect;
static const RECT part_rect = {96, 96, 160, 160};
static const RECT oob_rect[] =
{
{ 0, 0, 200, 300},
{ 0, 0, 300, 200},
{100, 100, 10, 10},
{200, 300, 10, 10},
{300, 200, 310, 210},
{ 0, 0, 0, 0},
};
DWORD color;
window = create_window();
@ -19595,6 +19604,17 @@ static void add_dirty_rect_test(void)
hr = IDirect3DTexture9_AddDirtyRect(tex_managed, NULL);
ok(SUCCEEDED(hr), "Failed to add dirty rect, hr %#x.\n", hr);
/* Test out-of-bounds regions. */
for (i = 0; i < ARRAY_SIZE(oob_rect); ++i)
{
hr = IDirect3DTexture9_AddDirtyRect(tex_src_red, &oob_rect[i]);
todo_wine ok(hr == D3DERR_INVALIDCALL, "[%u] Got unexpected hr %#x.\n", i, hr);
hr = IDirect3DTexture9_LockRect(tex_src_red, 0, &locked_rect, &oob_rect[i], 0);
ok(SUCCEEDED(hr), "[%u] Got unexpected hr %#x.\n", i, hr);
hr = IDirect3DTexture9_UnlockRect(tex_src_red, 0);
ok(SUCCEEDED(hr), "[%u] Got unexpected hr %#x.\n", i, hr);
}
hr = IDirect3DDevice9_SetTextureStageState(device, 0, D3DTSS_COLOROP, D3DTOP_DISABLE);
ok(SUCCEEDED(hr), "Failed to set color op, hr %#x.\n", hr);
hr = IDirect3DDevice9_SetTexture(device, 0, NULL);