Lines Matching full:foo

43     int foo;  member
215 struct foo { struct
217 struct foo *next; argument
224 struct foo foo; in test_nt_list_init() local
226 foo.a = 10; in test_nt_list_init()
227 foo.b = 20; in test_nt_list_init()
228 nt_list_init(&foo, next); in test_nt_list_init()
230 assert(foo.a == 10); in test_nt_list_init()
231 assert(foo.b == 20); in test_nt_list_init()
232 assert(foo.next == NULL); in test_nt_list_init()
233 assert(nt_list_next(&foo, next) == NULL); in test_nt_list_init()
240 struct foo *foo = calloc(10, sizeof(struct foo)); in test_nt_list_append() local
241 struct foo *item; in test_nt_list_append()
243 for (item = foo, i = 1; i <= 10; i++, item++) { in test_nt_list_append()
248 if (item != foo) in test_nt_list_append()
249 nt_list_append(item, foo, struct foo, next); in test_nt_list_append()
253 for (item = foo, i = 1; i <= 10; i++, item = nt_list_next(item, next)) { in test_nt_list_append()
260 nt_list_for_each_entry(item, foo, next) { in test_nt_list_append()
272 struct foo *foo = calloc(10, sizeof(struct foo)); in test_nt_list_insert() local
273 struct foo *item; in test_nt_list_insert()
275 foo->a = 1; in test_nt_list_insert()
276 foo->b = 2; in test_nt_list_insert()
277 nt_list_init(foo, next); in test_nt_list_insert()
279 for (item = &foo[1], i = 10; i > 1; i--, item++) { in test_nt_list_insert()
283 nt_list_insert(item, foo, struct foo, next); in test_nt_list_insert()
287 for (item = foo, i = 1; i <= 10; i++, item = nt_list_next(item, next)) { in test_nt_list_insert()
294 nt_list_for_each_entry(item, foo, next) { in test_nt_list_insert()
306 struct foo *list = calloc(10, sizeof(struct foo)); in test_nt_list_delete()
307 struct foo *foo = list; in test_nt_list_delete() local
308 struct foo *item, *tmp; in test_nt_list_delete()
309 struct foo *empty_list = foo; in test_nt_list_delete()
312 nt_list_del(empty_list, empty_list, struct foo, next); in test_nt_list_delete()
316 for (item = foo, i = 1; i <= 10; i++, item++) { in test_nt_list_delete()
321 if (item != foo) in test_nt_list_delete()
322 nt_list_append(item, foo, struct foo, next); in test_nt_list_delete()
326 nt_list_for_each_entry(item, foo, next) { in test_nt_list_delete()
332 nt_list_del(&foo[9], foo, struct foo, next); in test_nt_list_delete()
335 nt_list_for_each_entry(item, foo, next) { in test_nt_list_delete()
342 nt_list_del(foo->next, foo, struct foo, next); in test_nt_list_delete()
344 assert(foo->next->a == 3); in test_nt_list_delete()
347 nt_list_for_each_entry(item, foo, next) { in test_nt_list_delete()
354 item = foo; in test_nt_list_delete()
356 nt_list_del(foo, foo, struct foo, next); in test_nt_list_delete()
358 assert(item != foo); in test_nt_list_delete()
360 assert(foo->a == 3); in test_nt_list_delete()
361 assert(foo->next->a == 4); in test_nt_list_delete()
363 nt_list_for_each_entry_safe(item, tmp, foo, next) { in test_nt_list_delete()
364 nt_list_del(item, foo, struct foo, next); in test_nt_list_delete()
367 assert(!foo); in test_nt_list_delete()