1
1
mirror of https://github.com/theoludwig/libcproject.git synced 2025-05-21 23:21:15 +02:00

fix: error in array_list_remove (always removed the last index and not the index given) (#6)

Co-authored-by: Maxime Rumpler <mrumpler68@gmail.com>
This commit is contained in:
ChepakiLeCookie
2023-10-13 11:04:38 +02:00
committed by GitHub
parent 269b1f7451
commit e0115dd7d9
2 changed files with 13 additions and 2 deletions

View File

@ -34,4 +34,15 @@ void array_list_test() {
assert(array_list_get(list, 100) == (void *)95);
array_list_free(list);
list = array_list_initialization();
array_list_add(list, (void *)'a');
array_list_add(list, (void *)'b');
array_list_add(list, (void *)'c');
array_list_remove(list, 1);
assert(array_list_get(list, 0) == (void *)'a');
assert(array_list_get(list, 1) == (void *)'c');
assert(list->size == 2);
array_list_free(list);
}