Signed-off-by: Gabriel Ivăncescu gabrielopcode@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 b4be05c..47498ca 100644 --- a/dlls/comctl32/tests/listbox.c +++ b/dlls/comctl32/tests/listbox.c @@ -1803,6 +1803,25 @@ 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 + }; + UINT i; + + for (i = 0; i < ARRAY_SIZE(style); i++) + { + HWND listbox = CreateWindowA(WC_LISTBOXA, "TestList", LBS_NODATA | style[i], + 0, 0, 100, 100, NULL, NULL, NULL, 0); + LRESULT ret = SendMessageA(listbox, LB_SETCOUNT, 100, 0); + ok(ret == LB_ERR, "LBS_NODATA enabled with incompatible styles 0x%X\n", style[i]); + DestroyWindow(listbox); + } +} + static void test_nodata( void ) { static const UINT invalid_idx[] = { -2, 2 }; @@ -1815,6 +1834,8 @@ static void test_nodata( void ) so we can't rely on sizeof(void*) and have to hardcode it */ UINT64 data;
+ test_nodata_invalid_styles(); + listbox = CreateWindowA(WC_LISTBOXA, "TestList", LBS_NODATA | LBS_OWNERDRAWFIXED | WS_VISIBLE, 0, 0, 100, 100, NULL, NULL, NULL, 0); ok(listbox != NULL, "last error 0x%08x\n", GetLastError());