Module: wine Branch: master Commit: 778c04db079d3955bcea263bb5693c624318bf75 URL: http://source.winehq.org/git/wine.git/?a=commit;h=778c04db079d3955bcea263bb5...
Author: Lei Zhang thestig@google.com Date: Wed Mar 19 14:58:42 2008 -0700
comctl32: Add listview checkbox toggle test.
---
dlls/comctl32/tests/listview.c | 38 ++++++++++++++++++++++++++++++++++++++ 1 files changed, 38 insertions(+), 0 deletions(-)
diff --git a/dlls/comctl32/tests/listview.c b/dlls/comctl32/tests/listview.c index f988ab9..99c026f 100644 --- a/dlls/comctl32/tests/listview.c +++ b/dlls/comctl32/tests/listview.c @@ -539,6 +539,44 @@ static void test_checkboxes(void) r = SendMessage(hwnd, LVM_GETITEMA, 0, (LPARAM) &item); ok(item.state == 0x1aaa, "state %x\n", item.state);
+ /* Toggle checkbox tests (bug 9934) */ + memset (&item, 0xcc, sizeof(item)); + item.mask = LVIF_STATE; + item.iItem = 3; + item.iSubItem = 0; + item.state = LVIS_FOCUSED; + item.stateMask = LVIS_FOCUSED; + r = SendMessage(hwnd, LVM_SETITEM, 0, (LPARAM) &item); + expect(1, r); + + item.iItem = 3; + item.mask = LVIF_STATE; + item.stateMask = 0xffff; + r = SendMessage(hwnd, LVM_GETITEMA, 0, (LPARAM) &item); + ok(item.state == 0x1aab, "state %x\n", item.state); + + r = SendMessage(hwnd, WM_KEYDOWN, VK_SPACE, 0); + expect(0, r); + r = SendMessage(hwnd, WM_KEYUP, VK_SPACE, 0); + expect(0, r); + + item.iItem = 3; + item.mask = LVIF_STATE; + item.stateMask = 0xffff; + r = SendMessage(hwnd, LVM_GETITEMA, 0, (LPARAM) &item); + todo_wine ok(item.state == 0x2aab, "state %x\n", item.state); + + r = SendMessage(hwnd, WM_KEYDOWN, VK_SPACE, 0); + expect(0, r); + r = SendMessage(hwnd, WM_KEYUP, VK_SPACE, 0); + expect(0, r); + + item.iItem = 3; + item.mask = LVIF_STATE; + item.stateMask = 0xffff; + r = SendMessage(hwnd, LVM_GETITEMA, 0, (LPARAM) &item); + ok(item.state == 0x1aab, "state %x\n", item.state); + DestroyWindow(hwnd); }