aboutsummaryrefslogtreecommitdiff
path: root/tests/lltests.c
blob: 212178c2d10ebc2b2f389cc77c76b710abd53a0c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#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);
  cr_expect(head->value == val);
}

// Push
Test(lltest,llpush) {
  int val = 12;
  llpush(&head,val);
  cr_expect(head->next != NULL);
  cr_expect(head->value == val);
}

// Pop
// ...

// Append
// ...

// Insert
// ...

// Remove
// ...

// Length
// ...

// Free
// ...