aboutsummaryrefslogtreecommitdiff
path: root/tests/lltests.c
diff options
context:
space:
mode:
authorBlake Romero <blake@blkrom.com>2024-09-18 14:17:54 +0100
committerBlake Romero <blake@blkrom.com>2024-10-30 10:13:26 +0000
commit0ea8c07ed48b9ce4cf9ee74a559ba6378d467866 (patch)
tree387961b037094f3b997836262b10d064749f93a3 /tests/lltests.c
parente98c4d1dd52c5c5899a956a14b9d9fb43fdfa319 (diff)
Add llpop test
Diffstat (limited to 'tests/lltests.c')
-rw-r--r--tests/lltests.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/tests/lltests.c b/tests/lltests.c
index 212178c..2c44bc0 100644
--- a/tests/lltests.c
+++ b/tests/lltests.c
@@ -6,6 +6,7 @@ Node* head = NULL;
// Run on every test
void setup() {
head = llnode(7);
+ llpush(&head,9);
}
// Run after every test
@@ -14,7 +15,7 @@ void teardown() {}
TestSuite(lltest, .init=setup, .fini=teardown);
// Node
-Test(lltest, llnode) {
+Test(lltest,llnode) {
int val = 17;
head = llnode(val);
cr_expect(head != NULL);
@@ -30,7 +31,11 @@ Test(lltest,llpush) {
}
// Pop
-// ...
+Test(lltest,llpop) {
+ int val = llpop(&head);
+ cr_expect(val == 9);
+ cr_expect(lllength(head) == 1);
+}
// Append
// ...