aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/test_list.c (renamed from tests/lltests.c)26
1 files changed, 13 insertions, 13 deletions
diff --git a/tests/lltests.c b/test/test_list.c
index a2c8195..d5d5123 100644
--- a/tests/lltests.c
+++ b/test/test_list.c
@@ -1,47 +1,47 @@
#include <criterion/criterion.h>
-#include "../src/ll.h"
+#include "../src/lib/list.h"
Node* head = NULL;
// Run on every test
void setup() {
- head = llnode(7);
+ head = node_init(7);
}
// Run after every test
void teardown() {
- llfree(&head);
+ list_free(&head);
}
// Configure test suite
-TestSuite(lltest, .init=setup, .fini=teardown);
+TestSuite(list, .init=setup, .fini=teardown);
// Node
-Test(lltest,llnode) {
+Test(list,init) {
int val = 17;
- head = llnode(val);
+ head = node_init(val);
cr_expect(head != NULL);
cr_expect(head->value == val);
}
// Length
-Test(lltest,lllength) {
- cr_expect(lllength(head) == 1);
+Test(list,length) {
+ cr_expect(list_length(head) == 1);
}
// Push
-Test(lltest,llpush) {
+Test(list,push) {
int val = 12;
- llpush(&head,val);
+ list_push(&head,val);
cr_expect(head->next != NULL);
cr_expect(head->value == val);
}
// Pop
-Test(lltest,llpop) {
- int val = llpop(&head);
+Test(list,pop) {
+ int val = list_pop(&head);
cr_expect(val == 7);
- cr_expect(lllength(head) == 0);
+ cr_expect(list_length(head) == 0);
}
// Append