MCPcopy Create free account
hub / github.com/codr7/hacktical-c / list_tests

Function list_tests

list/tests.c:9–26  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7};
8
9void list_tests() {
10 struct hc_list head;
11 hc_list_init(&head);
12
13 const int n = 10;
14 struct list_item items[n];
15
16 for (int i = 0; i < n; i++) {
17 items[i].value = i;
18 hc_list_push_back(&head, &items[i].ls);
19 }
20
21 int i = 0;
22
23 hc_list_do(&head, il) {
24 assert(hc_baseof(il, struct list_item, ls)->value == i++);
25 }
26}

Callers 1

mainFunction · 0.85

Calls 2

hc_list_initFunction · 0.85
hc_list_push_backFunction · 0.85

Tested by

no test coverage detected