From: Jee-Yong Um Date: Mon, 18 Apr 2016 23:17:45 +0000 (-0700) Subject: edje: add test for edje_object_part_box_insert_after() X-Git-Tag: upstream/1.20.0~6752 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=11cdd13945f43fa720672587565e6f4ccaa122ae;p=platform%2Fupstream%2Fefl.git edje: add test for edje_object_part_box_insert_after() Summary: This test checks the validity of edje_object_part_box_insert_after(). It depends on D3733. Reviewers: jpeg, cedric Differential Revision: https://phab.enlightenment.org/D3833 Signed-off-by: Cedric BAIL --- diff --git a/src/Makefile_Edje.am b/src/Makefile_Edje.am index 54bf1ce..a25592b 100644 --- a/src/Makefile_Edje.am +++ b/src/Makefile_Edje.am @@ -255,6 +255,7 @@ tests/edje/data/test_snapshot.edc \ tests/edje/data/test_size_class.edc \ tests/edje/data/test_color_class.edc \ tests/edje/data/test_swallows.edc \ +tests/edje/data/test_box.edc \ tests/edje/data/filter.lua @@ -299,7 +300,8 @@ EDJE_TEST_FILES = tests/edje/data/test_layout.edj \ tests/edje/data/test_snapshot.edj \ tests/edje/data/test_size_class.edj \ tests/edje/data/test_swallows.edj \ - tests/edje/data/test_color_class.edj + tests/edje/data/test_color_class.edj \ + tests/edje/data/test_box.edj noinst_DATA += $(EDJE_TEST_FILES) CLEANFILES += $(EDJE_TEST_FILES) diff --git a/src/tests/edje/data/test_box.edc b/src/tests/edje/data/test_box.edc new file mode 100644 index 0000000..b89fa84 --- /dev/null +++ b/src/tests/edje/data/test_box.edc @@ -0,0 +1,14 @@ +collections { + group { "test_group"; + parts { + part { name: "box"; + type: BOX; + description { state: "default" 0.0; + box { + layout: "horizontal"; + } + } + } + } + } +} diff --git a/src/tests/edje/edje_test_edje.c b/src/tests/edje/edje_test_edje.c index 658f115..a576ac3 100644 --- a/src/tests/edje/edje_test_edje.c +++ b/src/tests/edje/edje_test_edje.c @@ -381,6 +381,45 @@ START_TEST(edje_test_swallows) } END_TEST +START_TEST(edje_test_box) +{ + Evas *evas; + Evas_Object *obj, *sobj, *sobjs[5]; + const Evas_Object *box; + Eina_Iterator *it; + int i; + + evas = EDJE_TEST_INIT_EVAS(); + + obj = edje_object_add(evas); + fail_unless(edje_object_file_set(obj, test_layout_get("test_box.edj"), "test_group")); + + for (i = 0; i < 5; i++) + { + sobjs[i] = evas_object_rectangle_add(evas); + fail_if(!sobjs[i]); + } + + edje_object_part_box_append(obj, "box", sobjs[3]); + edje_object_part_box_prepend(obj, "box", sobjs[1]); + edje_object_part_box_insert_before(obj, "box", sobjs[0], sobjs[1]); + edje_object_part_box_insert_after(obj, "box", sobjs[4], sobjs[3]); + edje_object_part_box_insert_at(obj, "box", sobjs[2], 2); + + box = edje_object_part_object_get(obj, "box"); + it = evas_object_box_iterator_new(box); + + i = 0; + EINA_ITERATOR_FOREACH(it, sobj) + { + fail_if(sobj != sobjs[i++]); + } + eina_iterator_free(it); + + EDJE_TEST_FREE_EVAS(); +} +END_TEST + void edje_test_edje(TCase *tc) { tcase_add_test(tc, edje_test_edje_init); @@ -395,4 +434,5 @@ void edje_test_edje(TCase *tc) tcase_add_test(tc, edje_test_size_class); tcase_add_test(tc, edje_test_color_class); tcase_add_test(tc, edje_test_swallows); + tcase_add_test(tc, edje_test_box); }