unsigned int i;
struct list_head list = LIST_HEAD_INIT(list);
- plan_tests(49);
+ plan_tests(53);
/* Test LIST_HEAD, LIST_HEAD_INIT, list_empty and check_list */
ok1(list_empty(&static_list));
ok1(list_check(&static_list, NULL));
}
ok1(i == 3);
+ /* Test list_for_each_rev. */
+ i = 0;
+ list_for_each_rev(&parent.children, c, list) {
+ switch (i++) {
+ case 0:
+ ok1(c == &c3);
+ break;
+ case 1:
+ ok1(c == &c2);
+ break;
+ case 2:
+ ok1(c == &c1);
+ break;
+ }
+ if (i > 2)
+ break;
+ }
+ ok1(i == 3);
+
/* Test list_for_each_safe, list_del and list_del_from. */
i = 0;
list_for_each_safe(&parent.children, c, n, list) {