aboutsummaryrefslogtreecommitdiffstats
path: root/tests/liballoc_tests.c
diff options
context:
space:
mode:
authorDouglas B. Rumbaugh <doug@douglasrumbaugh.com>2025-11-02 15:51:24 -0500
committerDouglas B. Rumbaugh <doug@douglasrumbaugh.com>2025-11-02 15:51:24 -0500
commit3d2b1b82bd1bf016d6fc5091bcec5c61bacabd70 (patch)
tree5df8feb9c8c974be0d5370e28f641286a8a17b05 /tests/liballoc_tests.c
parenta66d9582a16eb3c15bf727db84431660ae20b2f2 (diff)
downloadliballoc-3d2b1b82bd1bf016d6fc5091bcec5c61bacabd70.tar.gz
Added an interface to access free list and updated tests to use it
Diffstat (limited to 'tests/liballoc_tests.c')
-rw-r--r--tests/liballoc_tests.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/liballoc_tests.c b/tests/liballoc_tests.c
index ad9635f..cfd976a 100644
--- a/tests/liballoc_tests.c
+++ b/tests/liballoc_tests.c
@@ -51,7 +51,11 @@ START_TEST(basic_release) {
release(memory);
- // TODO: verify entry on the free list
+ free_nd *list_head = free_list_head();
+ ck_assert_ptr_nonnull(list_head);
+ ck_assert_ptr_eq(list_head, memory);
+ ck_assert_int_eq(list_head->size, ALIGNMENT*3);
+ ck_assert_ptr_null(list_head->next);
}
END_TEST
@@ -59,7 +63,7 @@ START_TEST(release_null) {
/* releasing NULL should take no action */
release(NULL);
- // TODO: verify no entry on free list
+ ck_assert_ptr_null(free_list_head());
}
END_TEST