test: Added test for init and destroy
Also changed a few things like destroy tanking a double pointer so that is more secure and making sure before hand that capacity is not that ridiculous of a size, still, shit can get pass but generally is fine
This commit is contained in:
@@ -16,6 +16,7 @@ typedef enum {
|
||||
ARRLIST_OK = 0,
|
||||
ARRLIST_OUT_OF_BOUNDS,
|
||||
ARRLIST_BAD_ALLOC,
|
||||
ARRLIST_ALLOC_OVERFLOW,
|
||||
ARRLIST_EMPTY,
|
||||
ARRLIST_NULL_ARG,
|
||||
ARRLIST_INVALID_ELEM_SIZE,
|
||||
@@ -23,7 +24,7 @@ typedef enum {
|
||||
} ArrayListErr;
|
||||
|
||||
ArrayList *arraylist_init(size_t capacity, size_t elem_size);
|
||||
ArrayListErr arraylist_destroy(ArrayList *arr);
|
||||
ArrayListErr arraylist_destroy(ArrayList **arr);
|
||||
ArrayListErr arraylist_clear(ArrayList *arr);
|
||||
|
||||
size_t arraylist_size(const ArrayList *arr);
|
||||
|
||||
Reference in New Issue
Block a user