From: Thomas Csovcsity <thc.fr13nd@gmail.com> --- dlls/user32/tests/uitools.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/dlls/user32/tests/uitools.c b/dlls/user32/tests/uitools.c index a3067c518ea..3f262f7ab7f 100644 --- a/dlls/user32/tests/uitools.c +++ b/dlls/user32/tests/uitools.c @@ -31,6 +31,20 @@ static void test_FillRect(void) COLORREF col; HBRUSH old_brush; RECT r; + int i; + static const struct + { + const int x; + const int y; + const COLORREF col; + const BOOL todo_flag; + } test[] = + { + { 5, 5, 0x0, TRUE }, + { 5, 6, 0xffffff, FALSE }, + { 6, 5, 0xffffff, FALSE }, + { 6, 6, 0xffffff, TRUE }, + }; /* fill bitmap data with white */ memset(bits, 0xff, sizeof(bits)); @@ -57,6 +71,16 @@ static void test_FillRect(void) col = GetPixel(hdcmem, 0, 0); ok(col == 0, "GetPixel returned %08lx, expected 0\n", col); + /* test negative height and width */ + SetRect(&r, 6, 6, 5, 5); + FillRect(hdcmem, &r, GetStockObject(BLACK_BRUSH)); + for (i = 0; i < ARRAYSIZE(test); i++) + { + col = GetPixel(hdcmem, test[i].x, test[i].y); + todo_wine_if (test[i].todo_flag) + ok(col == test[i].col, "GetPixel (%d,%d) returned %08lx, expected %08lx\n", test[i].x, test[i].y, col, test[i].col); + } + SelectObject(hdcmem, oldhbmp); DeleteObject(hbmp); DeleteDC(hdcmem); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10341