diff -r 748d0d40881e -r 9bdd053820b7 tests/test_hash_map.c --- a/tests/test_hash_map.c Sun Sep 21 19:31:30 2025 +0200 +++ b/tests/test_hash_map.c Mon Sep 22 19:22:23 2025 +0200 @@ -305,7 +305,8 @@ cx_foreach(CxMapEntry*, entry, iter) { if (((const char *)entry->key->data)[4] % 2 == 1) cxIteratorFlagRemoval(iter); } - CX_TEST_ASSERT(map->collection.size == 3); + CX_TEST_ASSERT(cxMapSize(map) == 3); + CX_TEST_ASSERT(iter.elem_count == 3); CX_TEST_ASSERT(iter.index == map->collection.size); CX_TEST_ASSERT(cxMapGet(map, "key 1") == NULL); @@ -403,15 +404,21 @@ v1[0] = 'y'; // mark v1 and check that destr is not called for previous val { CxMapIterator iter = cxMapMutIteratorKeys(map); + CX_TEST_ASSERT(iter.elem_count == 4); + CX_TEST_ASSERT(cxMapSize(map) == 4); cx_foreach(CxHashKey*, key, iter) { if (((char*)key->data)[4] == '1') cxIteratorFlagRemoval(iter); } + CX_TEST_ASSERT(iter.elem_count == 3); + CX_TEST_ASSERT(cxMapSize(map) == 3); } { CxMapIterator iter = cxMapMutIteratorValues(map); cx_foreach(struct test_destr_struct*, v, iter) { if (v->str[4] == '5') cxIteratorFlagRemoval(iter); } + CX_TEST_ASSERT(iter.elem_count == 2); + CX_TEST_ASSERT(cxMapSize(map) == 2); } CX_TEST_ASSERT(0 == strcmp(v1, "yK"));