From: Gabriel Ivăncescu Subject: [PATCH v2 8/8] user32/tests: Test incompatible styles for LBS_NODATA Message-Id: <3dca5613a3365144143800dfeea9bc244d86bcb0.1537459289.git.gabrielopcode@gmail.com> Date: Thu, 20 Sep 2018 19:02:50 +0300 In-Reply-To: <1db722c508148083fe099a2631ce320729c1553e.1537459289.git.gabrielopcode@gmail.com> References: <1db722c508148083fe099a2631ce320729c1553e.1537459289.git.gabrielopcode@gmail.com> Signed-off-by: Gabriel Ivăncescu --- dlls/user32/tests/listbox.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/dlls/user32/tests/listbox.c b/dlls/user32/tests/listbox.c index 4d9e70f..5259f29 100644 --- a/dlls/user32/tests/listbox.c +++ b/dlls/user32/tests/listbox.c @@ -1721,6 +1721,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 DWORD (WINAPI *pGetListBoxInfo)(HWND); static int lb_getlistboxinfo; @@ -2067,6 +2087,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