Lines Matching full:list
27 static int len(struct kmod_list *list) in len() argument
31 kmod_list_foreach(l, list) in len()
39 struct kmod_list *list = NULL, *last; in test_list_last() local
45 list = kmod_list_append(list, v[i]); in test_list_last()
46 assert_return(len(list) == N, EXIT_FAILURE); in test_list_last()
48 last = kmod_list_last(list); in test_list_last()
54 .description = "test for the last element of a list");
59 struct kmod_list *list = NULL, *l, *p; in test_list_prev() local
64 l = kmod_list_prev(list, list); in test_list_prev()
68 list = kmod_list_append(list, v[i]); in test_list_prev()
70 l = kmod_list_prev(list, list); in test_list_prev()
73 l = list; in test_list_prev()
75 l = kmod_list_next(list, l); in test_list_prev()
76 p = kmod_list_prev(list, l); in test_list_prev()
83 .description = "test list prev");
88 struct kmod_list *list = NULL, *l; in test_list_remove_n_latest() local
94 list = kmod_list_append(list, v[i]); in test_list_remove_n_latest()
95 assert_return(len(list) == N, EXIT_FAILURE); in test_list_remove_n_latest()
97 list = kmod_list_remove_n_latest(list, M); in test_list_remove_n_latest()
98 assert_return(len(list) == N - M, EXIT_FAILURE); in test_list_remove_n_latest()
101 kmod_list_foreach (l, list) { in test_list_remove_n_latest()
109 .description = "test list function to remove n latest elements");
114 struct kmod_list *list = NULL, *l; in test_list_remove_data() local
120 list = kmod_list_append(list, v[i]); in test_list_remove_data()
123 list = kmod_list_remove_data(list, removed); in test_list_remove_data()
124 assert_return(len(list) == N - 1, EXIT_FAILURE); in test_list_remove_data()
126 kmod_list_foreach (l, list) in test_list_remove_data()
132 .description = "test list function to remove element by data");
168 .description = "test list function to append another list");
173 struct kmod_list *list = NULL, *l; in test_list_insert_before() local
176 list = kmod_list_insert_before(list, v3); in test_list_insert_before()
177 assert_return(len(list) == 1, EXIT_FAILURE); in test_list_insert_before()
179 list = kmod_list_insert_before(list, v2); in test_list_insert_before()
180 list = kmod_list_insert_before(list, v1); in test_list_insert_before()
181 assert_return(len(list) == 3, EXIT_FAILURE); in test_list_insert_before()
183 l = list; in test_list_insert_before()
186 l = kmod_list_next(list, l); in test_list_insert_before()
190 assert_return(len(list) == 4, EXIT_FAILURE); in test_list_insert_before()
193 l = kmod_list_next(list, l); in test_list_insert_before()
196 l = kmod_list_next(list, l); in test_list_insert_before()
202 .description = "test list function to insert before element");
207 struct kmod_list *list = NULL, *l; in test_list_insert_after() local
210 list = kmod_list_insert_after(list, v1); in test_list_insert_after()
211 assert_return(len(list) == 1, EXIT_FAILURE); in test_list_insert_after()
213 list = kmod_list_insert_after(list, v3); in test_list_insert_after()
214 list = kmod_list_insert_after(list, v2); in test_list_insert_after()
215 assert_return(len(list) == 3, EXIT_FAILURE); in test_list_insert_after()
217 l = list; in test_list_insert_after()
221 assert_return(len(list) == 4, EXIT_FAILURE); in test_list_insert_after()
224 l = kmod_list_next(list, l); in test_list_insert_after()
227 l = kmod_list_next(list, l); in test_list_insert_after()
230 l = kmod_list_next(list, l); in test_list_insert_after()
236 .description = "test list function to insert after element");