1626 CX_TEST_ASSERT(!cxListIndexValid(list, len)); |
1626 CX_TEST_ASSERT(!cxListIndexValid(list, len)); |
1627 CX_TEST_ASSERT(cxListAt(list, len) == NULL); |
1627 CX_TEST_ASSERT(cxListAt(list, len) == NULL); |
1628 free(testdata); |
1628 free(testdata); |
1629 }) |
1629 }) |
1630 |
1630 |
|
1631 roll_out_test_combos(set, { |
|
1632 // Add some values |
|
1633 int v1 = 42; |
|
1634 cxListAdd(list, &v1); |
|
1635 int v2 = 100; |
|
1636 cxListAdd(list, &v2); |
|
1637 int v3 = 47; |
|
1638 cxListAdd(list, &v3); |
|
1639 |
|
1640 // Change the first element |
|
1641 int v1new = 99; |
|
1642 CX_TEST_ASSERT(cxListSet(list, 0, &v1new) == 0); |
|
1643 CX_TEST_ASSERT(*(int *) cxListAt(list, 0) == 99); |
|
1644 |
|
1645 // Change the last element |
|
1646 int v3new = 101; |
|
1647 CX_TEST_ASSERT(cxListSet(list, 2, &v3new) == 0); |
|
1648 CX_TEST_ASSERT(*(int *) cxListAt(list, 2) == 101); |
|
1649 |
|
1650 // Try index out of bounds |
|
1651 int oob = 1337; |
|
1652 CX_TEST_ASSERT(cxListSet(list, 3, &oob) != 0); |
|
1653 }) |
|
1654 |
1631 roll_out_test_combos_with_defaulted_funcs(swap, { |
1655 roll_out_test_combos_with_defaulted_funcs(swap, { |
1632 int original[16] = array_init(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); |
1656 int original[16] = array_init(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); |
1633 int swapped[16] = array_init(8, 4, 14, 3, 1, 5, 9, 12, 0, 6, 11, 10, 7, 15, 2, 13); |
1657 int swapped[16] = array_init(8, 4, 14, 3, 1, 5, 9, 12, 0, 6, 11, 10, 7, 15, 2, 13); |
1634 |
1658 |
1635 for (size_t i = 0; i < 16; i++) { |
1659 for (size_t i = 0; i < 16; i++) { |
1979 cx_test_register(suite, test_list_parl_find_remove_sorted); |
2003 cx_test_register(suite, test_list_parl_find_remove_sorted); |
1980 cx_test_register(suite, test_list_arl_clear); |
2004 cx_test_register(suite, test_list_arl_clear); |
1981 cx_test_register(suite, test_list_parl_clear); |
2005 cx_test_register(suite, test_list_parl_clear); |
1982 cx_test_register(suite, test_list_arl_at); |
2006 cx_test_register(suite, test_list_arl_at); |
1983 cx_test_register(suite, test_list_parl_at); |
2007 cx_test_register(suite, test_list_parl_at); |
|
2008 cx_test_register(suite, test_list_arl_set); |
|
2009 cx_test_register(suite, test_list_parl_set); |
1984 cx_test_register(suite, test_list_arl_swap); |
2010 cx_test_register(suite, test_list_arl_swap); |
1985 cx_test_register(suite, test_list_parl_swap); |
2011 cx_test_register(suite, test_list_parl_swap); |
1986 cx_test_register(suite, test_list_arl_swap_no_sbo); |
2012 cx_test_register(suite, test_list_arl_swap_no_sbo); |
1987 cx_test_register(suite, test_list_arl_find); |
2013 cx_test_register(suite, test_list_arl_find); |
1988 cx_test_register(suite, test_list_parl_find); |
2014 cx_test_register(suite, test_list_parl_find); |
2078 cx_test_register(suite, test_list_pll_find_remove_sorted); |
2104 cx_test_register(suite, test_list_pll_find_remove_sorted); |
2079 cx_test_register(suite, test_list_ll_clear); |
2105 cx_test_register(suite, test_list_ll_clear); |
2080 cx_test_register(suite, test_list_pll_clear); |
2106 cx_test_register(suite, test_list_pll_clear); |
2081 cx_test_register(suite, test_list_ll_at); |
2107 cx_test_register(suite, test_list_ll_at); |
2082 cx_test_register(suite, test_list_pll_at); |
2108 cx_test_register(suite, test_list_pll_at); |
|
2109 cx_test_register(suite, test_list_ll_set); |
|
2110 cx_test_register(suite, test_list_pll_set); |
2083 cx_test_register(suite, test_list_ll_swap); |
2111 cx_test_register(suite, test_list_ll_swap); |
2084 cx_test_register(suite, test_list_pll_swap); |
2112 cx_test_register(suite, test_list_pll_swap); |
2085 cx_test_register(suite, test_list_ll_find); |
2113 cx_test_register(suite, test_list_ll_find); |
2086 cx_test_register(suite, test_list_pll_find); |
2114 cx_test_register(suite, test_list_pll_find); |
2087 cx_test_register(suite, test_list_ll_sort); |
2115 cx_test_register(suite, test_list_ll_sort); |