[PATCH v2 7/8] comctl32/tests: Test incompatible styles for LBS_NODATA

Gabriel Ivăncescu gabrielopcode at gmail.com
Thu Sep 20 11:02:49 CDT 2018


Signed-off-by: Gabriel Ivăncescu <gabrielopcode at gmail.com>
---
 dlls/comctl32/tests/listbox.c | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/dlls/comctl32/tests/listbox.c b/dlls/comctl32/tests/listbox.c
index 16efa60..ad341c5 100644
--- a/dlls/comctl32/tests/listbox.c
+++ b/dlls/comctl32/tests/listbox.c
@@ -1763,6 +1763,26 @@ static void test_set_count( void )
     DestroyWindow( parent );
 }
 
+static void test_nodata_invalid_styles( void )
+{
+    static const DWORD style[] =
+    {
+        0, LBS_OWNERDRAWVARIABLE, LBS_SORT, LBS_HASSTRINGS,
+        LBS_OWNERDRAWFIXED | LBS_SORT, LBS_OWNERDRAWFIXED | LBS_HASSTRINGS
+    };
+    HWND parent, listbox;
+    UINT i;
+
+    parent = create_parent();
+    for (i = 0; i < ARRAY_SIZE(style); i++)
+    {
+        listbox = create_listbox(style[i] | LBS_NODATA | WS_CHILD | WS_VISIBLE, parent);
+        ok(SendMessageA(listbox, LB_SETCOUNT, 100, 0) == LB_ERR, "LBS_NODATA enabled with incompatible styles 0x%X\n", style[i]);
+        DestroyWindow(listbox);
+    }
+    DestroyWindow(parent);
+}
+
 static int lb_getlistboxinfo;
 
 static LRESULT WINAPI listbox_subclass_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
@@ -2204,6 +2224,7 @@ START_TEST(listbox)
     test_listbox_LB_DIR();
     test_listbox_dlgdir();
     test_set_count();
+    test_nodata_invalid_styles();
     test_GetListBoxInfo();
     test_missing_lbuttonup();
     test_extents();
-- 
1.9.1




More information about the wine-devel mailing list