diff -r db8299984bfe -r 6a842bd49fea tests/test_hash_map.c --- a/tests/test_hash_map.c Mon Dec 22 15:47:59 2025 +0100 +++ b/tests/test_hash_map.c Mon Dec 22 16:12:20 2025 +0100 @@ -1611,7 +1611,8 @@ CX_TEST_ASSERT(keyiter.index == map->collection.size); // verify that all keys are mapped to values in reference map for (size_t i = 0 ; i < map->collection.size ; i++) { - cxmutstr ksz = cx_strdup(cx_strn(keys[i].data, keys[i].len)); + // need to create a zero-terminated string from the key + cxmutstr ksz = cx_strdup(cx_hash_key_as_string(&keys[i])); CX_TEST_ASSERT(test_map_reference_get(ksz.ptr) != NULL); cx_strfree(&ksz); } @@ -1652,7 +1653,7 @@ struct test_map_kv *pairs = calloc(map->collection.size, sizeof(struct test_map_kv)); cx_foreach(CxMapEntry*, entry, pairiter) { const CxHashKey *key = entry->key; - pairs[pairiter.index].key = cx_strdup(cx_strn(key->data, key->len)).ptr; + pairs[pairiter.index].key = cx_strdup(cx_hash_key_as_string(key)).ptr; pairs[pairiter.index].value = entry->value; } CX_TEST_ASSERT(pairiter.index == map->collection.size);