Nikolay Sivov : comctl32/listview: Use LVM_SETITEMSTATE directly in tests.

Alexandre Julliard julliard at winehq.org
Thu Jan 10 13:36:12 CST 2013


Module: wine
Branch: master
Commit: 7bb36372c8ffaff8a3032c7771a512a3a0f93bfe
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=7bb36372c8ffaff8a3032c7771a512a3a0f93bfe

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Thu Jan 10 16:45:44 2013 +0400

comctl32/listview: Use LVM_SETITEMSTATE directly in tests.

---

 dlls/comctl32/tests/listview.c |   36 +++++++++++++++++++++++++-----------
 1 files changed, 25 insertions(+), 11 deletions(-)

diff --git a/dlls/comctl32/tests/listview.c b/dlls/comctl32/tests/listview.c
index 161278c..583645d 100644
--- a/dlls/comctl32/tests/listview.c
+++ b/dlls/comctl32/tests/listview.c
@@ -2145,24 +2145,29 @@ static void test_multiselect(void)
 
     hwnd = create_listview_control(LVS_REPORT);
 
-    for (i=0;i<items;i++) {
-	    insert_item(hwnd, 0);
-    }
+    for (i = 0; i < items; i++)
+        insert_item(hwnd, 0);
 
     item_count = (int)SendMessage(hwnd, LVM_GETITEMCOUNT, 0, 0);
+    expect(items, item_count);
 
-    expect(items,item_count);
+    for (i = 0; i < 4; i++) {
+        LVITEMA item;
 
-    for (i=0;i<4;i++) {
         task = task_list[i];
 
 	/* deselect all items */
-	ListView_SetItemState(hwnd, -1, 0, LVIS_SELECTED);
+        item.state = 0;
+        item.stateMask = LVIS_SELECTED;
+        SendMessageA(hwnd, LVM_SETITEMSTATE, -1, (LPARAM)&item);
 	SendMessage(hwnd, LVM_SETSELECTIONMARK, 0, -1);
 
 	/* set initial position */
 	SendMessage(hwnd, LVM_SETSELECTIONMARK, 0, (task.initPos == -1 ? item_count -1 : task.initPos));
-	ListView_SetItemState(hwnd,(task.initPos == -1 ? item_count -1 : task.initPos),LVIS_SELECTED ,LVIS_SELECTED);
+
+        item.state = LVIS_SELECTED;
+        item.stateMask = LVIS_SELECTED;
+        SendMessageA(hwnd, LVM_SETITEMSTATE, task.initPos == -1 ? item_count-1 : task.initPos, (LPARAM)&item);
 
 	selected_count = (int)SendMessage(hwnd, LVM_GETSELECTEDCOUNT, 0, 0);
 
@@ -2204,7 +2209,9 @@ static void test_multiselect(void)
     expect(FALSE, r);
 
     /* select all, check notifications */
-    ListView_SetItemState(hwnd, -1, 0, LVIS_SELECTED);
+    item.state = 0;
+    item.stateMask = LVIS_SELECTED;
+    SendMessageA(hwnd, LVM_SETITEMSTATE, -1, (LPARAM)&item);
 
     flush_sequences(sequences, NUM_MSG_SEQUENCES);
 
@@ -2217,10 +2224,15 @@ static void test_multiselect(void)
                 "select all notification", FALSE);
 
     /* deselect all items */
-    ListView_SetItemState(hwnd, -1, 0, LVIS_SELECTED);
+    item.state = 0;
+    item.stateMask = LVIS_SELECTED;
+    SendMessageA(hwnd, LVM_SETITEMSTATE, -1, (LPARAM)&item);
+
     SendMessage(hwnd, LVM_SETSELECTIONMARK, 0, -1);
     for (i=0;i<3;i++) {
-        ListView_SetItemState(hwnd, i, LVIS_SELECTED, LVIS_SELECTED);
+        item.state = LVIS_SELECTED;
+        item.stateMask = LVIS_SELECTED;
+        SendMessageA(hwnd, LVM_SETITEMSTATE, i, (LPARAM)&item);
     }
 
     r = SendMessage(hwnd, LVM_GETSELECTEDCOUNT, 0, 0);
@@ -2245,7 +2257,9 @@ static void test_multiselect(void)
     expect(3, r);
 
     /* select one more */
-    ListView_SetItemState(hwnd, 3, LVIS_SELECTED, LVIS_SELECTED);
+    item.state = LVIS_SELECTED;
+    item.stateMask = LVIS_SELECTED;
+    SendMessageA(hwnd, LVM_SETITEMSTATE, 3, (LPARAM)&item);
 
     for (i=0;i<3;i++) {
         r = ListView_GetItemState(hwnd, i, LVIS_SELECTED);




More information about the wine-cvs mailing list