Akihiro Sagawa : d3d8/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: 3499694f1350a0f8058bf1928ace9c697d505b10
URL: https://source.winehq.org/git/wine.git/?a=commit;h=3499694f1350a0f8058bf1928ace9c697d505b10
Author: Akihiro Sagawa <sagawa.aki at gmail.com>
Date: Mon Dec 2 17:57:34 2019 +0330
d3d8/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/d3d8/tests/visual.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/dlls/d3d8/tests/visual.c b/dlls/d3d8/tests/visual.c
index 310ffc59e4..96ab4596a7 100644
--- a/dlls/d3d8/tests/visual.c
+++ b/dlls/d3d8/tests/visual.c
@@ -5441,6 +5441,15 @@ static void add_dirty_rect_test(void)
HRESULT hr;
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},
+ };
window = create_window();
d3d = Direct3DCreate8(D3D_SDK_VERSION);
@@ -5784,6 +5793,17 @@ static void add_dirty_rect_test(void)
hr = IDirect3DTexture8_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 = IDirect3DTexture8_AddDirtyRect(tex_src_red, &oob_rect[i]);
+ todo_wine ok(hr == D3DERR_INVALIDCALL, "[%u] Got unexpected hr %#x.\n", i, hr);
+ hr = IDirect3DTexture8_LockRect(tex_src_red, 0, &locked_rect, &oob_rect[i], 0);
+ ok(SUCCEEDED(hr), "[%u] Got unexpected hr %#x.\n", i, hr);
+ hr = IDirect3DTexture8_UnlockRect(tex_src_red, 0);
+ ok(SUCCEEDED(hr), "[%u] Got unexpected hr %#x.\n", i, hr);
+ }
+
IDirect3DSurface8_Release(surface_dst2);
IDirect3DSurface8_Release(surface_managed1);
IDirect3DSurface8_Release(surface_managed0);
More information about the wine-cvs
mailing list