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:
@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user