libubox
C utility functions for OpenWrt.
test_list.t
Go to the documentation of this file.
1 check that list is producing expected results:
2 
3  $ [ -n "$TEST_BIN_DIR" ] && export PATH="$TEST_BIN_DIR:$PATH"
4  $ valgrind --quiet --leak-check=full test-list
5  init_list: list_empty: yes
6  init_list: list_add_tail: zero one two three four five six seven eight nine ten eleven twelve
7  init_list: list_empty: no
8  test_basics: first=zero last=twelve
9  test_basics: 'zero' is first, yes
10  test_basics: 'twelve' is last, yes
11  test_basics: removing 'twelve' and 'zero'
12  test_basics: first=one last=eleven
13  test_basics: 'one' is first, yes
14  test_basics: 'eleven' is last, yes
15  test_basics: moving 'one' to the tail
16  test_basics: first=two last=one
17  test_basics: 'two' is first, yes
18  test_basics: 'one' is last, yes
19  test_basics: list_for_each_entry: two three four five six seven eight nine ten eleven one
20  test_basics: list_for_each_entry_reverse: one eleven ten nine eight seven six five four three two
21  test_basics: delete all entries
22  test_basics: list_empty: yes
23  init_list: list_empty: yes
24  init_list: list_add_tail: zero one two three four five six seven eight nine ten eleven twelve
25  init_list: list_empty: no
26  test_while_list_empty: delete all entries
27  test_while_list_empty: list_empty: yes
28 
29  $ test-list-san
30  init_list: list_empty: yes
31  init_list: list_add_tail: zero one two three four five six seven eight nine ten eleven twelve
32  init_list: list_empty: no
33  test_basics: first=zero last=twelve
34  test_basics: 'zero' is first, yes
35  test_basics: 'twelve' is last, yes
36  test_basics: removing 'twelve' and 'zero'
37  test_basics: first=one last=eleven
38  test_basics: 'one' is first, yes
39  test_basics: 'eleven' is last, yes
40  test_basics: moving 'one' to the tail
41  test_basics: first=two last=one
42  test_basics: 'two' is first, yes
43  test_basics: 'one' is last, yes
44  test_basics: list_for_each_entry: two three four five six seven eight nine ten eleven one
45  test_basics: list_for_each_entry_reverse: one eleven ten nine eight seven six five four three two
46  test_basics: delete all entries
47  test_basics: list_empty: yes
48  init_list: list_empty: yes
49  init_list: list_add_tail: zero one two three four five six seven eight nine ten eleven twelve
50  init_list: list_empty: no
51  test_while_list_empty: delete all entries
52  test_while_list_empty: list_empty: yes