Added unit tests for Vector data type

This commit is contained in:
2025-11-05 11:52:21 +01:00
parent fafbd0bc51
commit e6a48e1c21
3 changed files with 311 additions and 3 deletions

View File

@@ -20,6 +20,13 @@ static vector_result_t vector_resize(vector_t *vector);
vector_result_t vector_new(size_t size, size_t data_size) {
vector_result_t result = {0};
if (size == 0) {
result.status = VECTOR_ERR_ALLOCATE;
SET_MSG(result, "Invalid vector size");
return result;
}
// Allocate a new vector
vector_t *vector = malloc(sizeof(vector_t));
if (vector == NULL) {