Module: wine Branch: master Commit: 227b1fe2ca387f53895df7f5b1036dc8cff54835 URL: http://source.winehq.org/git/wine.git/?a=commit;h=227b1fe2ca387f53895df7f5b1...
Author: Austin Lund austin.lund@gmail.com Date: Tue Oct 5 09:54:26 2010 +1000
comctl32/tests: Add tests for negative subitems independent of local settings.
---
dlls/comctl32/tests/listview.c | 20 ++++++++++++++++++-- 1 files changed, 18 insertions(+), 2 deletions(-)
diff --git a/dlls/comctl32/tests/listview.c b/dlls/comctl32/tests/listview.c index de7369c..d249af8 100644 --- a/dlls/comctl32/tests/listview.c +++ b/dlls/comctl32/tests/listview.c @@ -2992,7 +2992,8 @@ static void test_hittest(void) LVITEMA item; static CHAR text[] = "1234567890ABCDEFGHIJKLMNOPQRST"; POINT pos; - INT x, y; + INT x, y, i; + WORD horiz, vert; HIMAGELIST himl, himl2; HBITMAP hbmp;
@@ -3020,6 +3021,11 @@ static void test_hittest(void) r = SendMessage(hwnd, LVM_GETITEMRECT, 0, (LPARAM)&bounds); ok(bounds.bottom - bounds.top > 0, "Expected non zero item height\n"); ok(bounds.right - bounds.left > 0, "Expected non zero item width\n"); + r = SendMessage(hwnd, LVM_GETITEMSPACING, TRUE, 0); + horiz = LOWORD(r); + vert = HIWORD(r); + ok(bounds.bottom - bounds.top == vert, + "Horizontal spacing inconsistent (%d != %d)\n", bounds.bottom - bounds.top, vert); r = SendMessage(hwnd, LVM_GETITEMPOSITION, 0, (LPARAM)&pos); expect(TRUE, r);
@@ -3052,8 +3058,18 @@ static void test_hittest(void) test_lvm_subitemhittest(hwnd, x, y, -1, -1, LVHT_NOWHERE, FALSE, FALSE, FALSE); /* subitem returned with -1 item too */ x = pos.x + 150; - y = -1; + y = bounds.top - vert; test_lvm_subitemhittest(hwnd, x, y, -1, 1, LVHT_NOWHERE, FALSE, FALSE, FALSE); + test_lvm_subitemhittest(hwnd, x, y - vert + 1, -1, 1, LVHT_NOWHERE, FALSE, FALSE, FALSE); + /* return values appear to underflow with negative indices */ + i = -2; + y = y - vert; + while (i > -10) { + test_lvm_subitemhittest(hwnd, x, y, i, 1, LVHT_ONITEMLABEL, TRUE, FALSE, TRUE); + test_lvm_subitemhittest(hwnd, x, y - vert + 1, i, 1, LVHT_ONITEMLABEL, TRUE, FALSE, TRUE); + y = y - vert; + i--; + } /* parent client area is 100x100 by default */ MoveWindow(hwnd, 0, 0, 300, 100, FALSE); x = pos.x + 150; /* outside column */