Nikolay Sivov : comctl32/listview: Some tests for LVS_SORT[A, DE]SCENDING, remove these styles from TODOs.

Alexandre Julliard julliard at winehq.org
Thu Jun 4 07:59:33 CDT 2009


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

Author: Nikolay Sivov <bunglehead at gmail.com>
Date:   Wed Jun  3 22:43:28 2009 +0400

comctl32/listview: Some tests for LVS_SORT[A,DE]SCENDING, remove these styles from TODOs.

---

 dlls/comctl32/listview.c       |    1 -
 dlls/comctl32/tests/listview.c |   29 +++++++++++++++++++++++++++++
 2 files changed, 29 insertions(+), 1 deletions(-)

diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c
index aa614c2..b83c697 100644
--- a/dlls/comctl32/listview.c
+++ b/dlls/comctl32/listview.c
@@ -80,7 +80,6 @@
  * Styles
  *   -- LVS_NOLABELWRAP
  *   -- LVS_NOSCROLL (see Q137520)
- *   -- LVS_SORTASCENDING, LVS_SORTDESCENDING
  *   -- LVS_ALIGNTOP
  *   -- LVS_TYPESTYLEMASK
  *
diff --git a/dlls/comctl32/tests/listview.c b/dlls/comctl32/tests/listview.c
index d0aa1f3..a8e0b9b 100644
--- a/dlls/comctl32/tests/listview.c
+++ b/dlls/comctl32/tests/listview.c
@@ -2226,6 +2226,35 @@ static void test_ownerdata(void)
                 "ownerdata getitem selected state 2", FALSE);
 
     DestroyWindow(hwnd);
+
+    /* LVS_SORTASCENDING/LVS_SORTDESCENDING aren't compatible with LVS_OWNERDATA */
+    hwnd = create_listview_control(LVS_OWNERDATA | LVS_SORTASCENDING);
+    ok(hwnd != NULL, "failed to create a listview window\n");
+    style = GetWindowLongPtrA(hwnd, GWL_STYLE);
+    ok(style & LVS_OWNERDATA, "Expected LVS_OWNERDATA\n");
+    ok(style & LVS_SORTASCENDING, "Expected LVS_SORTASCENDING to be set\n");
+    SetWindowLongPtrA(hwnd, GWL_STYLE, style & ~LVS_SORTASCENDING);
+    style = GetWindowLongPtrA(hwnd, GWL_STYLE);
+    ok(!(style & LVS_SORTASCENDING), "Expected LVS_SORTASCENDING not set\n");
+    DestroyWindow(hwnd);
+    /* apparently it's allowed to switch these style on after creation */
+    hwnd = create_listview_control(LVS_OWNERDATA);
+    ok(hwnd != NULL, "failed to create a listview window\n");
+    style = GetWindowLongPtrA(hwnd, GWL_STYLE);
+    ok(style & LVS_OWNERDATA, "Expected LVS_OWNERDATA\n");
+    SetWindowLongPtrA(hwnd, GWL_STYLE, style | LVS_SORTASCENDING);
+    style = GetWindowLongPtrA(hwnd, GWL_STYLE);
+    ok(style & LVS_SORTASCENDING, "Expected LVS_SORTASCENDING to be set\n");
+    DestroyWindow(hwnd);
+
+    hwnd = create_listview_control(LVS_OWNERDATA);
+    ok(hwnd != NULL, "failed to create a listview window\n");
+    style = GetWindowLongPtrA(hwnd, GWL_STYLE);
+    ok(style & LVS_OWNERDATA, "Expected LVS_OWNERDATA\n");
+    SetWindowLongPtrA(hwnd, GWL_STYLE, style | LVS_SORTDESCENDING);
+    style = GetWindowLongPtrA(hwnd, GWL_STYLE);
+    ok(style & LVS_SORTDESCENDING, "Expected LVS_SORTDESCENDING to be set\n");
+    DestroyWindow(hwnd);
 }
 
 static void test_norecompute(void)




More information about the wine-cvs mailing list