diff options
author | sanine <sanine.not@pm.me> | 2022-12-10 19:12:31 -0600 |
---|---|---|
committer | sanine <sanine.not@pm.me> | 2022-12-10 19:12:31 -0600 |
commit | 7c47f23ee92afa07c748700f1de22fd8b8ccf967 (patch) | |
tree | 4387add23b932b74c237128c579c4c2c9005262a /src/util.test.c | |
parent | 8bc49efb970ac44f17f6076bb16f1d0e712bd750 (diff) |
refactor: remove node.* and util.* and move 3rdparty libs into separate directory
Diffstat (limited to 'src/util.test.c')
-rw-r--r-- | src/util.test.c | 57 |
1 files changed, 0 insertions, 57 deletions
diff --git a/src/util.test.c b/src/util.test.c deleted file mode 100644 index c2f8462..0000000 --- a/src/util.test.c +++ /dev/null @@ -1,57 +0,0 @@ -#include <stdlib.h> - -#include <kalmia.h> -#include "util.h" -#include "test/test.h" - -void next_array_element(); - -void suite_util() -{ - lily_run_test(next_array_element); -} - -void next_array_element() -{ - int *arr = NULL; - size_t count = 0; - size_t max = 0; - - int *next = kai_next_array_element((void**) &arr, &count, &max, sizeof(int)); - lily_assert_not_null(arr); - lily_assert_not_null(next); - - lily_assert_ptr_equal(arr+0, next); - lily_assert_int_equal(count, 1); - lily_assert_int_equal(max, 1); - *next = 2; - - next = kai_next_array_element((void**) &arr, &count, &max, sizeof(int)); - - lily_assert_not_null(next); - lily_assert_ptr_equal(arr+1, next); - lily_assert_int_equal(count, 2); - lily_assert_int_equal(max, 2); - *next = 1; - - next = kai_next_array_element((void**) &arr, &count, &max, sizeof(int)); - - lily_assert_not_null(next); - lily_assert_ptr_equal(arr+2, next); - lily_assert_int_equal(count, 3); - lily_assert_int_equal(max, 4); - *next = 3; - - next = kai_next_array_element((void**) &arr, &count, &max, sizeof(int)); - - lily_assert_not_null(next); - lily_assert_ptr_equal(arr+3, next); - lily_assert_int_equal(count, 4); - lily_assert_int_equal(max, 4); - *next = 4; - - int expected[] = { 2, 1, 3, 4 }; - lily_assert_memory_equal(expected, arr, 4 * sizeof(int)); - - free(arr); -} |