From: Yong Bakos Date: Sun, 4 Sep 2016 20:23:05 +0000 (-0700) Subject: tests: Add test for wl_list_length X-Git-Tag: 1.11.93~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2bdbb741e2ac0ec9ecc564463a59b3ef8f499f6a;p=platform%2Fupstream%2Fwayland.git tests: Add test for wl_list_length list-test.c did not cover wl_list_length, so add one test that specifically tests this method. Signed-off-by: Yong Bakos Reviewed-by: Eric Engestrom Reviewed-by: Pekka Paalanen --- diff --git a/tests/list-test.c b/tests/list-test.c index 21ca4ec..0752618 100644 --- a/tests/list-test.c +++ b/tests/list-test.c @@ -57,6 +57,19 @@ TEST(list_insert) assert(e.link.prev == &list); } +TEST(list_length) +{ + struct wl_list list; + struct element e; + + wl_list_init(&list); + assert(wl_list_length(&list) == 0); + wl_list_insert(&list, &e.link); + assert(wl_list_length(&list) == 1); + wl_list_remove(&e.link); + assert(wl_list_length(&list) == 0); +} + TEST(list_iterator) { struct wl_list list;