[PATCH v4 11/11] comctl32/tests: Add test for negative LB_SETCOUNT counts

Gabriel Ivăncescu gabrielopcode at gmail.com
Wed Nov 21 13:15:14 CST 2018


Signed-off-by: Gabriel Ivăncescu <gabrielopcode at gmail.com>
---

This is placed here *after* LBS_NODATA's implementation because otherwise
the test would timeout or run out of memory (since without LBS_NODATA
implementation it ends up allocating forever until it runs out of memory).

 dlls/comctl32/tests/listbox.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/dlls/comctl32/tests/listbox.c b/dlls/comctl32/tests/listbox.c
index be42e6b..030d492 100644
--- a/dlls/comctl32/tests/listbox.c
+++ b/dlls/comctl32/tests/listbox.c
@@ -1872,6 +1872,11 @@ static void test_set_count( void )
     GetUpdateRect( listbox, &r, TRUE );
     ok( !IsRectEmpty( &r ), "got empty rect\n");
 
+    ret = SendMessageA( listbox, LB_SETCOUNT, -5, 0 );
+    ok( ret == 0, "got %d\n", ret );
+    ret = SendMessageA( listbox, LB_GETCOUNT, 0, 0 );
+    ok( ret == -5, "got %d\n", ret );
+
     /* Confirm that emptying the listbox sends a LB_RESETCONTENT to itself */
     lb_test_subclass_proc_prev = (WNDPROC)SetWindowLongPtrW(listbox, GWLP_WNDPROC, (LONG_PTR)lb_test_subclass_proc);
 
-- 
2.19.1




More information about the wine-devel mailing list