Nikolay Sivov : comctl32/tests: Merge header items test with existing function.

Alexandre Julliard julliard at winehq.org
Wed Dec 4 16:13:04 CST 2019


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

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Wed Dec  4 12:55:55 2019 +0300

comctl32/tests: Merge header items test with existing function.

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

---

 dlls/comctl32/tests/listview.c | 34 +++++++++++++---------------------
 1 file changed, 13 insertions(+), 21 deletions(-)

diff --git a/dlls/comctl32/tests/listview.c b/dlls/comctl32/tests/listview.c
index 48cd614380..dc923c0b6e 100644
--- a/dlls/comctl32/tests/listview.c
+++ b/dlls/comctl32/tests/listview.c
@@ -1546,6 +1546,19 @@ static void test_columns(void)
         "get subitem text after column added", FALSE);
 
     DestroyWindow(hwnd);
+
+    /* Columns are not created right away. */
+    hwnd = create_listview_control(LVS_REPORT);
+    ok(hwnd != NULL, "Failed to create a listview window.\n");
+
+    insert_item(hwnd, 0);
+
+    header = (HWND)SendMessageA(hwnd, LVM_GETHEADER, 0, 0);
+    ok(IsWindow(header), "Expected header handle.\n");
+    rc = SendMessageA(header, HDM_GETITEMCOUNT, 0, 0);
+    ok(!rc, "Unexpected column count.\n");
+
+    DestroyWindow(hwnd);
 }
 
 /* test setting imagelist between WM_NCCREATE and WM_CREATE */
@@ -3939,25 +3952,6 @@ static void test_getitemposition(void)
     DestroyWindow(hwnd);
 }
 
-static void test_columnscreation(void)
-{
-    HWND hwnd, header;
-    DWORD r;
-
-    hwnd = create_listview_control(LVS_REPORT);
-    ok(hwnd != NULL, "failed to create a listview window\n");
-
-    insert_item(hwnd, 0);
-
-    /* headers columns aren't created automatically */
-    header = (HWND)SendMessageA(hwnd, LVM_GETHEADER, 0, 0);
-    ok(IsWindow(header), "Expected header handle\n");
-    r = SendMessageA(header, HDM_GETITEMCOUNT, 0, 0);
-    expect(0, r);
-
-    DestroyWindow(hwnd);
-}
-
 static void test_getitemrect(void)
 {
     HWND hwnd;
@@ -6577,7 +6571,6 @@ START_TEST(listview)
     test_hittest();
     test_getviewrect();
     test_getitemposition();
-    test_columnscreation();
     test_editbox();
     test_notifyformat();
     test_indentation();
@@ -6632,7 +6625,6 @@ START_TEST(listview)
     test_ownerdata();
     test_norecompute();
     test_nosortheader();
-    test_columnscreation();
     test_indentation();
     test_finditem();
     test_hover();




More information about the wine-cvs mailing list