--- a/tests/test_list.c Sun Apr 13 18:01:29 2025 +0200 +++ b/tests/test_list.c Mon Apr 14 19:36:43 2025 +0200 @@ -1607,6 +1607,24 @@ free(testdata); }) +roll_out_test_combos(contains, { + int a = 37; + int b = 42; + int c = 55; + cxListAdd(list, &a); + cxListAdd(list, &b); + cxListAdd(list, &c); + int x; + x = 37; + CX_TEST_ASSERT(cxListContains(list, &x)); + x = 42; + CX_TEST_ASSERT(cxListContains(list, &x)); + x = 55; + CX_TEST_ASSERT(cxListContains(list, &x)); + x = 47; + CX_TEST_ASSERT(!cxListContains(list, &x)); +}) + roll_out_test_combos(clear, { int *testdata = int_test_data_added_to_list(list, isptrlist, 8); CX_TEST_ASSERT(cxListSize(list) > 0); @@ -2001,6 +2019,8 @@ cx_test_register(suite, test_list_parl_find_remove); cx_test_register(suite, test_list_arl_find_remove_sorted); cx_test_register(suite, test_list_parl_find_remove_sorted); + cx_test_register(suite, test_list_arl_contains); + cx_test_register(suite, test_list_parl_contains); cx_test_register(suite, test_list_arl_clear); cx_test_register(suite, test_list_parl_clear); cx_test_register(suite, test_list_arl_at); @@ -2102,6 +2122,8 @@ cx_test_register(suite, test_list_pll_find_remove); cx_test_register(suite, test_list_ll_find_remove_sorted); cx_test_register(suite, test_list_pll_find_remove_sorted); + cx_test_register(suite, test_list_ll_contains); + cx_test_register(suite, test_list_pll_contains); cx_test_register(suite, test_list_ll_clear); cx_test_register(suite, test_list_pll_clear); cx_test_register(suite, test_list_ll_at);