jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=24177057d039065056b1bc924641ddf9b257ffe5

commit 24177057d039065056b1bc924641ddf9b257ffe5
Author: Jean-Philippe Andre <jp.an...@samsung.com>
Date:   Thu Apr 21 18:10:30 2016 +0900

    Edje tests: Add test case for access_part_list
    
    This tests eo and legacy apis
---
 src/tests/edje/data/test_layout.edc | 49 +++++++++++++++++++++++++++++++++++++
 src/tests/edje/edje_test_edje.c     | 44 +++++++++++++++++++++++++++++++++
 2 files changed, 93 insertions(+)

diff --git a/src/tests/edje/data/test_layout.edc 
b/src/tests/edje/data/test_layout.edc
index f1309cc..46afb45 100644
--- a/src/tests/edje/data/test_layout.edc
+++ b/src/tests/edje/data/test_layout.edc
@@ -20,6 +20,55 @@ collections {
                }
             }
          }
+         part {
+            name: "access_1";
+            type: TEXT;
+            access: 1;
+            effect: GLOW;
+
+            description {
+               state: "default" 0.0;
+
+               rel1 {
+                  relative: 0.0 0.0;
+               }
+               rel2 {
+                  relative: 1.0 0.5;
+               }
+
+               text {
+                  text: "Hello";
+                  font: "Sans";
+                  size: 48;
+                  ellipsis: -1;
+               }
+            }
+         }
+         part {
+            name: "access_2";
+            type: TEXT;
+            access: 1;
+            effect: GLOW;
+
+            description {
+               state: "default" 0.0;
+
+               rel1 {
+                  relative: 0.0 0.0;
+                  to: "access_1";
+               }
+               rel2 {
+                  relative: 1.0 1.0;
+               }
+
+               text {
+                  text: "Hello";
+                  font: "Sans";
+                  size: 48;
+                  ellipsis: -1;
+               }
+            }
+         }
       }
    }
 }
diff --git a/src/tests/edje/edje_test_edje.c b/src/tests/edje/edje_test_edje.c
index 50fdcac..3bd890e 100644
--- a/src/tests/edje/edje_test_edje.c
+++ b/src/tests/edje/edje_test_edje.c
@@ -412,6 +412,49 @@ START_TEST(edje_test_swallows_eoapi)
 }
 END_TEST
 
+START_TEST(edje_test_access)
+{
+   Evas *evas = EDJE_TEST_INIT_EVAS();
+   const char *name;
+   Evas_Object *obj;
+   Eina_Iterator *it;
+   Eina_List *list;
+   char buf[20];
+   int i = 0;
+
+   obj = edje_object_add(evas);
+   fail_unless(edje_object_file_set(obj, test_layout_get("test_layout.edj"), 
"test_group"));
+
+   /* eo api */
+   it = edje_obj_access_part_iterate(obj);
+   fail_if(!it);
+
+   EINA_ITERATOR_FOREACH(it, name)
+     {
+        i++;
+        sprintf(buf, "access_%d", i);
+        fail_if(!name || strcmp(name, buf) != 0);
+     }
+   fail_if(i != 2);
+   eina_iterator_free(it);
+
+   i = 0;
+
+   /* legacy api */
+   list = edje_object_access_part_list_get(obj);
+   fail_if(!list);
+   EINA_LIST_FREE(list, name)
+     {
+        i++;
+        sprintf(buf, "access_%d", i);
+        fail_if(!name || strcmp(name, buf) != 0);
+     }
+   fail_if(i != 2);
+
+   EDJE_TEST_FREE_EVAS();
+}
+END_TEST
+
 START_TEST(edje_test_box)
 {
    Evas *evas;
@@ -466,5 +509,6 @@ void edje_test_edje(TCase *tc)
    tcase_add_test(tc, edje_test_color_class);
    tcase_add_test(tc, edje_test_swallows);
    tcase_add_test(tc, edje_test_swallows_eoapi);
+   tcase_add_test(tc, edje_test_access);
    tcase_add_test(tc, edje_test_box);
 }

-- 


Reply via email to