1.1 --- a/test/test_list.c Sat Jan 22 17:15:14 2022 +0100 1.2 +++ b/test/test_list.c Sat Jan 22 18:49:06 2022 +0100 1.3 @@ -762,12 +762,19 @@ 1.4 void test_hl_linked_list_iterator_impl(CxList list) { 1.5 int i = 0; 1.6 for (CxIterator iter = cxListBegin(list); cxIteratorValid(&iter); cxIteratorNext(&iter)) { 1.7 - CU_ASSERT_EQUAL(iter.index, (size_t) i) 1.8 + CU_ASSERT_EQUAL(iter.index, (size_t) (i + 1) / 2) 1.9 int *x = cxIteratorCurrent(&iter); 1.10 CU_ASSERT_EQUAL(*x, i) 1.11 + if (i % 2 == 1) iter.remove = true; 1.12 i++; 1.13 } 1.14 CU_ASSERT_EQUAL(i, 10) 1.15 + CU_ASSERT_EQUAL_FATAL(list->size, 5) 1.16 + CU_ASSERT_EQUAL(*(int *) cxListAt(list, 0), 0) 1.17 + CU_ASSERT_EQUAL(*(int *) cxListAt(list, 1), 2) 1.18 + CU_ASSERT_EQUAL(*(int *) cxListAt(list, 2), 4) 1.19 + CU_ASSERT_EQUAL(*(int *) cxListAt(list, 3), 6) 1.20 + CU_ASSERT_EQUAL(*(int *) cxListAt(list, 4), 8) 1.21 cxLinkedListDestroy(list); 1.22 CU_ASSERT_TRUE(cxTestingAllocatorVerify()) 1.23 }