summaryrefslogtreecommitdiff
path: root/src/tests/edje/edje_test_edje.c
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2016-04-22 14:58:49 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2016-04-26 11:36:23 +0900
commite2176ed6a3b52c015dd503df592ee24fd5ddf955 (patch)
tree48e518e9e6227c1d90f7f547b77928bd43825f90 /src/tests/edje/edje_test_edje.c
parent32b622f08d27a278bf15ab34b9a1b66cd4d54e09 (diff)
Edje: Replace edje_box_part with a fake eo proxy
This is basically an implementation of eo_part() but only for Edje Box APIs. Legacy API is implemented on top of the EO API.
Diffstat (limited to '')
-rw-r--r--src/tests/edje/edje_test_edje.c69
1 files changed, 68 insertions, 1 deletions
diff --git a/src/tests/edje/edje_test_edje.c b/src/tests/edje/edje_test_edje.c
index 3bd890e3fb..1ac5971da3 100644
--- a/src/tests/edje/edje_test_edje.c
+++ b/src/tests/edje/edje_test_edje.c
@@ -494,10 +494,76 @@ START_TEST(edje_test_box)
494} 494}
495END_TEST 495END_TEST
496 496
497START_TEST(edje_test_box_eoapi)
498{
499 Evas *evas;
500 Evas_Object *obj, *sobj, *sobjs[5];
501 Eina_Iterator *it;
502 Eo *box;
503 int i;
504
505 evas = EDJE_TEST_INIT_EVAS();
506
507 obj = edje_object_add(evas);
508 fail_unless(edje_object_file_set(obj, test_layout_get("test_box.edj"), "test_group"));
509
510 for (i = 0; i < 5; i++)
511 {
512 sobjs[i] = evas_object_rectangle_add(evas);
513 fail_if(!sobjs[i]);
514 }
515
516 /* same test case as legacy api above */
517 box = efl_content_get(obj, "box");
518 fail_if(!box);
519
520 efl_pack_end(box, sobjs[3]);
521 efl_pack_begin(box, sobjs[1]);
522 efl_pack_before(box, sobjs[0], sobjs[1]);
523 efl_pack_after(box, sobjs[4], sobjs[3]);
524 efl_pack_insert(box, sobjs[2], 2);
525 fail_if(efl_content_count(box) != 5);
526
527 it = efl_content_iterate(box);
528 i = 0;
529 EINA_ITERATOR_FOREACH(it, sobj)
530 fail_if(sobj != sobjs[i++]);
531 fail_if(i != 5);
532 eina_iterator_free(it);
533
534 /* clear up and test a bit more */
535 efl_pack_unpack_all(box);
536 fail_if(efl_content_count(box) != 0);
537
538 efl_pack(box, sobjs[1]);
539 efl_pack_insert(box, sobjs[0], 0);
540 efl_pack_insert(box, sobjs[2], -1);
541 it = efl_content_iterate(box);
542 i = 0;
543 EINA_ITERATOR_FOREACH(it, sobj)
544 fail_if(sobj != sobjs[i++]);
545 fail_if(i != 3);
546 eina_iterator_free(it);
547
548 fail_if(!efl_content_remove(box, sobjs[0]));
549 fail_if(efl_content_count(box) != 2);
550 fail_if(!efl_pack_content_at_remove(box, 1));
551 fail_if(efl_content_count(box) != 1);
552 fail_if(efl_pack_content_index_get(box, sobjs[1]) != 0);
553
554 efl_pack_clear(box);
555 fail_if(efl_content_count(box) != 0);
556
557 eo_del(box);
558
559 EDJE_TEST_FREE_EVAS();
560}
561END_TEST
562
497void edje_test_edje(TCase *tc) 563void edje_test_edje(TCase *tc)
498{ 564{
499 tcase_add_test(tc, edje_test_edje_init); 565 tcase_add_test(tc, edje_test_edje_init);
500 tcase_add_test(tc,edje_test_load_simple_layout); 566 tcase_add_test(tc, edje_test_load_simple_layout);
501 tcase_add_test(tc, edje_test_edje_load); 567 tcase_add_test(tc, edje_test_edje_load);
502 tcase_add_test(tc, edje_test_simple_layout_geometry); 568 tcase_add_test(tc, edje_test_simple_layout_geometry);
503 tcase_add_test(tc, edje_test_complex_layout); 569 tcase_add_test(tc, edje_test_complex_layout);
@@ -511,4 +577,5 @@ void edje_test_edje(TCase *tc)
511 tcase_add_test(tc, edje_test_swallows_eoapi); 577 tcase_add_test(tc, edje_test_swallows_eoapi);
512 tcase_add_test(tc, edje_test_access); 578 tcase_add_test(tc, edje_test_access);
513 tcase_add_test(tc, edje_test_box); 579 tcase_add_test(tc, edje_test_box);
580 tcase_add_test(tc, edje_test_box_eoapi);
514} 581}