Nikolay Sivov : comctl32/tests: Add some tests for LVSCW_AUTOSIZE.

Alexandre Julliard julliard at winehq.org
Tue Feb 6 15:55:50 CST 2018


Module: wine
Branch: master
Commit: e00a2379fcc22eb417c45da1b50d50e01e2eedd4
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=e00a2379fcc22eb417c45da1b50d50e01e2eedd4

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Tue Feb  6 15:37:38 2018 +0300

comctl32/tests: Add some tests for LVSCW_AUTOSIZE.

Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/comctl32/tests/listview.c | 48 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 48 insertions(+)

diff --git a/dlls/comctl32/tests/listview.c b/dlls/comctl32/tests/listview.c
index c6e3127..0506eaa 100644
--- a/dlls/comctl32/tests/listview.c
+++ b/dlls/comctl32/tests/listview.c
@@ -6270,6 +6270,52 @@ static void test_state_image(void)
     }
 }
 
+static void test_LVSCW_AUTOSIZE(void)
+{
+    int width, width2;
+    HWND hwnd;
+    BOOL ret;
+
+    hwnd = create_listview_control(LVS_REPORT);
+    ok(hwnd != NULL, "failed to create a listview window\n");
+
+    insert_column(hwnd, 0);
+    insert_column(hwnd, 1);
+    insert_item(hwnd, 0);
+
+    ret = SendMessageA(hwnd, LVM_SETCOLUMNWIDTH, 0, LVSCW_AUTOSIZE);
+    ok(ret, "Failed to set column width.\n");
+
+    width = SendMessageA(hwnd, LVM_GETCOLUMNWIDTH, 0, 0);
+    ok(width > 0, "Unexpected column width %d.\n", width);
+
+    /* Turn on checkboxes. */
+    ret = SendMessageA(hwnd, LVM_SETEXTENDEDLISTVIEWSTYLE, LVS_EX_CHECKBOXES, LVS_EX_CHECKBOXES);
+    ok(ret == 0, "Unexpected previous extended style.\n");
+
+    ret = SendMessageA(hwnd, LVM_SETCOLUMNWIDTH, 0, LVSCW_AUTOSIZE);
+    ok(ret, "Failed to set column width.\n");
+
+    width2 = SendMessageA(hwnd, LVM_GETCOLUMNWIDTH, 0, 0);
+    ok(width2 > 0, "Unexpected column width %d.\n", width2);
+todo_wine
+    ok(width2 > width, "Expected increased column width.\n");
+
+    /* Turn off checkboxes. */
+    ret = SendMessageA(hwnd, LVM_SETEXTENDEDLISTVIEWSTYLE, LVS_EX_CHECKBOXES, 0);
+    ok(ret == LVS_EX_CHECKBOXES, "Unexpected previous extended style.\n");
+
+    ret = SendMessageA(hwnd, LVM_SETCOLUMNWIDTH, 0, LVSCW_AUTOSIZE);
+    ok(ret, "Failed to set column width.\n");
+
+    width = SendMessageA(hwnd, LVM_GETCOLUMNWIDTH, 0, 0);
+    ok(width > 0, "Unexpected column width %d.\n", width2);
+todo_wine
+    ok(width2 > width, "Expected reduced column width.\n");
+
+    DestroyWindow(hwnd);
+}
+
 START_TEST(listview)
 {
     ULONG_PTR ctx_cookie;
@@ -6330,6 +6376,7 @@ START_TEST(listview)
     test_oneclickactivate();
     test_callback_mask();
     test_state_image();
+    test_LVSCW_AUTOSIZE();
 
     if (!load_v6_module(&ctx_cookie, &hCtx))
     {
@@ -6371,6 +6418,7 @@ START_TEST(listview)
     test_LVM_REDRAWITEMS();
     test_oneclickactivate();
     test_state_image();
+    test_LVSCW_AUTOSIZE();
 
     unload_v6_module(ctx_cookie, hCtx);
 




More information about the wine-cvs mailing list