From: Gabriel Ivăncescu Subject: [PATCH v2 7/8] comctl32/tests: Test incompatible styles for LBS_NODATA Message-Id: Date: Thu, 20 Sep 2018 19:02:49 +0300 In-Reply-To: <1db722c508148083fe099a2631ce320729c1553e.1537459289.git.gabrielopcode@gmail.com> References: <1db722c508148083fe099a2631ce320729c1553e.1537459289.git.gabrielopcode@gmail.com> Signed-off-by: Gabriel Ivăncescu --- 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