Akihiro Sagawa : d3d9/tests: Add out-of-bounds region tests.
Alexandre Julliard
julliard at winehq.org
Mon Dec 2 17:10:16 CST 2019
Module: wine
Branch: master
Commit: 3329f50612848e611c4ecd8f524f42f7537ea22b
URL: https://source.winehq.org/git/wine.git/?a=commit;h=3329f50612848e611c4ecd8f524f42f7537ea22b
Author: Akihiro Sagawa <sagawa.aki at gmail.com>
Date: Mon Dec 2 17:57:33 2019 +0330
d3d9/tests: Add out-of-bounds region tests.
Signed-off-by: Akihiro Sagawa <sagawa.aki at gmail.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/d3d9/tests/visual.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c
index cbfb98bec6..f19bd11607 100644
--- a/dlls/d3d9/tests/visual.c
+++ b/dlls/d3d9/tests/visual.c
@@ -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);
More information about the wine-cvs
mailing list