summaryrefslogtreecommitdiff
path: root/src/tests/edje
diff options
context:
space:
mode:
authorJee-Yong Um <jc9.um@samsung.com>2016-04-18 16:17:45 -0700
committerCedric BAIL <cedric@osg.samsung.com>2016-04-18 16:21:07 -0700
commit11cdd13945f43fa720672587565e6f4ccaa122ae (patch)
treeb9766daae50027f792893d44e576c2825daeb168 /src/tests/edje
parent648422c60b216b99f3fdf37c7f676b1885e64ef7 (diff)
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 <cedric@osg.samsung.com>
Diffstat (limited to 'src/tests/edje')
-rw-r--r--src/tests/edje/data/test_box.edc14
-rw-r--r--src/tests/edje/edje_test_edje.c40
2 files changed, 54 insertions, 0 deletions
diff --git a/src/tests/edje/data/test_box.edc b/src/tests/edje/data/test_box.edc
new file mode 100644
index 0000000000..b89fa84cf0
--- /dev/null
+++ b/src/tests/edje/data/test_box.edc
@@ -0,0 +1,14 @@
1collections {
2 group { "test_group";
3 parts {
4 part { name: "box";
5 type: BOX;
6 description { state: "default" 0.0;
7 box {
8 layout: "horizontal";
9 }
10 }
11 }
12 }
13 }
14}
diff --git a/src/tests/edje/edje_test_edje.c b/src/tests/edje/edje_test_edje.c
index 658f115d89..a576ac3068 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)
381} 381}
382END_TEST 382END_TEST
383 383
384START_TEST(edje_test_box)
385{
386 Evas *evas;
387 Evas_Object *obj, *sobj, *sobjs[5];
388 const Evas_Object *box;
389 Eina_Iterator *it;
390 int i;
391
392 evas = EDJE_TEST_INIT_EVAS();
393
394 obj = edje_object_add(evas);
395 fail_unless(edje_object_file_set(obj, test_layout_get("test_box.edj"), "test_group"));
396
397 for (i = 0; i < 5; i++)
398 {
399 sobjs[i] = evas_object_rectangle_add(evas);
400 fail_if(!sobjs[i]);
401 }
402
403 edje_object_part_box_append(obj, "box", sobjs[3]);
404 edje_object_part_box_prepend(obj, "box", sobjs[1]);
405 edje_object_part_box_insert_before(obj, "box", sobjs[0], sobjs[1]);
406 edje_object_part_box_insert_after(obj, "box", sobjs[4], sobjs[3]);
407 edje_object_part_box_insert_at(obj, "box", sobjs[2], 2);
408
409 box = edje_object_part_object_get(obj, "box");
410 it = evas_object_box_iterator_new(box);
411
412 i = 0;
413 EINA_ITERATOR_FOREACH(it, sobj)
414 {
415 fail_if(sobj != sobjs[i++]);
416 }
417 eina_iterator_free(it);
418
419 EDJE_TEST_FREE_EVAS();
420}
421END_TEST
422
384void edje_test_edje(TCase *tc) 423void edje_test_edje(TCase *tc)
385{ 424{
386 tcase_add_test(tc, edje_test_edje_init); 425 tcase_add_test(tc, edje_test_edje_init);
@@ -395,4 +434,5 @@ void edje_test_edje(TCase *tc)
395 tcase_add_test(tc, edje_test_size_class); 434 tcase_add_test(tc, edje_test_size_class);
396 tcase_add_test(tc, edje_test_color_class); 435 tcase_add_test(tc, edje_test_color_class);
397 tcase_add_test(tc, edje_test_swallows); 436 tcase_add_test(tc, edje_test_swallows);
437 tcase_add_test(tc, edje_test_box);
398} 438}