Commit 3329f506 authored by Akihiro Sagawa's avatar Akihiro Sagawa Committed by Alexandre Julliard

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

parent 2a64dd44
......@@ -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);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment