aboutsummaryrefslogtreecommitdiff
path: root/tests/lltests.c
diff options
context:
space:
mode:
authorBlake Romero <blake@blkrom.com>2024-09-18 00:32:53 +0100
committerBlake Romero <blake@blkrom.com>2024-10-30 10:13:26 +0000
commit45c1fbf4dfe5c7a7243b625eb8a600bdce6c748f (patch)
tree0c19f2d45941d2027ae5f07586af4bd427a5cdf6 /tests/lltests.c
parentd1841d4d2a087d1681d1fb483301b4a7e4722f98 (diff)
Add makefile & tests
Diffstat (limited to 'tests/lltests.c')
-rw-r--r--tests/lltests.c46
1 files changed, 46 insertions, 0 deletions
diff --git a/tests/lltests.c b/tests/lltests.c
new file mode 100644
index 0000000..265a276
--- /dev/null
+++ b/tests/lltests.c
@@ -0,0 +1,46 @@
+#include <criterion/criterion.h>
+#include "../src/ll.h"
+
+Node* head = NULL;
+
+// Run on every test
+void setup() {
+ head = llnode(7);
+}
+
+// Run after every test
+void teardown() {}
+
+TestSuite(lltest, .init=setup, .fini=teardown);
+
+// Node
+Test(lltest, llnode) {
+ int val = 17;
+ head = llnode(val);
+ cr_expect(head != NULL && head->value == val);
+}
+
+// Push
+Test(lltest,llpush) {
+ int val = 12;
+ llpush(&head,val);
+ cr_expect(head->next->value == val);
+}
+
+// Pop
+// ...
+
+// Append
+// ...
+
+// Insert
+// ...
+
+// Remove
+// ...
+
+// Length
+// ...
+
+// Free
+// ...