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

Nikolay Sivov bunglehead at gmail.com
Wed Jun 3 18:02:22 CDT 2009


Just another look at todo list.

Changelog:
    - Some tests for LVS_SORT[A,DE]SCENDING, remove these styles from TODOs

>From 7018e99fe913fd963f51c3aa94a06049af469724 Mon Sep 17 00:00:00 2001
From: Nikolay Sivov <bunglehead at gmail.com>
Date: Wed, 3 Jun 2009 22:43:28 +0400
Subject: 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)
-- 
1.5.6.5







More information about the wine-patches mailing list