Commit 227b1fe2 authored by Austin Lund's avatar Austin Lund Committed by Alexandre Julliard

comctl32/tests: Add tests for negative subitems independent of local settings.

parent 6a3ca3ca
......@@ -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 */
......
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