From: Connor McAdams cmcadams@codeweavers.com
Signed-off-by: Connor McAdams cmcadams@codeweavers.com --- dlls/comctl32/tests/listview.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+)
diff --git a/dlls/comctl32/tests/listview.c b/dlls/comctl32/tests/listview.c index 54ac79b5f86..2abe27f354e 100644 --- a/dlls/comctl32/tests/listview.c +++ b/dlls/comctl32/tests/listview.c @@ -3520,6 +3520,35 @@ static void test_ownerdata(void) expect(1, res); res = SendMessageA(hwnd, LVM_GETITEMCOUNT, 0, 0); expect(1, res); + + /* LVIF_STATE is not set, state field untouched. */ + memset(&item, 0, sizeof(item)); + item.mask = LVIF_TEXT; + item.iItem = 0; + item.state = 0xffff; + res = SendMessageA(hwnd, LVM_GETITEMA, 0, (LPARAM)&item); + ok(res, "Failed to get item.\n"); + todo_wine ok(item.state == 0xffff, "Unexpected item state %#x.\n", item.state); + + /* LVIF_STATE is set with no statemask, state field zeroed. */ + memset(&item, 0, sizeof(item)); + item.mask = LVIF_STATE; + item.iItem = 0; + item.state = 0xffff; + res = SendMessageA(hwnd, LVM_GETITEMA, 0, (LPARAM)&item); + ok(res, "Failed to get item.\n"); + todo_wine ok(!item.state, "Unexpected item state %#x.\n", item.state); + + res = SendMessageA(hwnd, LVM_GETITEMSTATE, 0, 0xff); + todo_wine ok(res == LVIS_SELECTED, "Unexpected item state %#lx.\n", res); + + /* Set the callback mask for LVIS_SELECTED. */ + res = SendMessageA(hwnd, LVM_SETCALLBACKMASK, LVIS_SELECTED, 0); + expect(TRUE, res); + + res = SendMessageA(hwnd, LVM_GETITEMSTATE, 0, 0xff); + ok(!res, "Unexpected item state %#lx.\n", res); + DestroyWindow(hwnd);
/* LVM_SETITEM and LVM_SETITEMTEXT is unsupported on LVS_OWNERDATA */