summaryrefslogtreecommitdiff
path: root/src/tests
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2016-04-21 18:10:30 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2016-04-26 11:36:23 +0900
commit24177057d039065056b1bc924641ddf9b257ffe5 (patch)
tree039854a1dbf0cd2d49d17a722774a33d529a5b9a /src/tests
parent27573e6e0bfeee08d7e133382729f14ceedac44a (diff)
Edje tests: Add test case for access_part_list
This tests eo and legacy apis
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/edje/data/test_layout.edc49
-rw-r--r--src/tests/edje/edje_test_edje.c44
2 files changed, 93 insertions, 0 deletions
diff --git a/src/tests/edje/data/test_layout.edc b/src/tests/edje/data/test_layout.edc
index f1309cceb1..46afb454b8 100644
--- a/src/tests/edje/data/test_layout.edc
+++ b/src/tests/edje/data/test_layout.edc
@@ -20,6 +20,55 @@ collections {
20 } 20 }
21 } 21 }
22 } 22 }
23 part {
24 name: "access_1";
25 type: TEXT;
26 access: 1;
27 effect: GLOW;
28
29 description {
30 state: "default" 0.0;
31
32 rel1 {
33 relative: 0.0 0.0;
34 }
35 rel2 {
36 relative: 1.0 0.5;
37 }
38
39 text {
40 text: "Hello";
41 font: "Sans";
42 size: 48;
43 ellipsis: -1;
44 }
45 }
46 }
47 part {
48 name: "access_2";
49 type: TEXT;
50 access: 1;
51 effect: GLOW;
52
53 description {
54 state: "default" 0.0;
55
56 rel1 {
57 relative: 0.0 0.0;
58 to: "access_1";
59 }
60 rel2 {
61 relative: 1.0 1.0;
62 }
63
64 text {
65 text: "Hello";
66 font: "Sans";
67 size: 48;
68 ellipsis: -1;
69 }
70 }
71 }
23 } 72 }
24 } 73 }
25} 74}
diff --git a/src/tests/edje/edje_test_edje.c b/src/tests/edje/edje_test_edje.c
index 50fdcac3f6..3bd890e3fb 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)
412} 412}
413END_TEST 413END_TEST
414 414
415START_TEST(edje_test_access)
416{
417 Evas *evas = EDJE_TEST_INIT_EVAS();
418 const char *name;
419 Evas_Object *obj;
420 Eina_Iterator *it;
421 Eina_List *list;
422 char buf[20];
423 int i = 0;
424
425 obj = edje_object_add(evas);
426 fail_unless(edje_object_file_set(obj, test_layout_get("test_layout.edj"), "test_group"));
427
428 /* eo api */
429 it = edje_obj_access_part_iterate(obj);
430 fail_if(!it);
431
432 EINA_ITERATOR_FOREACH(it, name)
433 {
434 i++;
435 sprintf(buf, "access_%d", i);
436 fail_if(!name || strcmp(name, buf) != 0);
437 }
438 fail_if(i != 2);
439 eina_iterator_free(it);
440
441 i = 0;
442
443 /* legacy api */
444 list = edje_object_access_part_list_get(obj);
445 fail_if(!list);
446 EINA_LIST_FREE(list, name)
447 {
448 i++;
449 sprintf(buf, "access_%d", i);
450 fail_if(!name || strcmp(name, buf) != 0);
451 }
452 fail_if(i != 2);
453
454 EDJE_TEST_FREE_EVAS();
455}
456END_TEST
457
415START_TEST(edje_test_box) 458START_TEST(edje_test_box)
416{ 459{
417 Evas *evas; 460 Evas *evas;
@@ -466,5 +509,6 @@ void edje_test_edje(TCase *tc)
466 tcase_add_test(tc, edje_test_color_class); 509 tcase_add_test(tc, edje_test_color_class);
467 tcase_add_test(tc, edje_test_swallows); 510 tcase_add_test(tc, edje_test_swallows);
468 tcase_add_test(tc, edje_test_swallows_eoapi); 511 tcase_add_test(tc, edje_test_swallows_eoapi);
512 tcase_add_test(tc, edje_test_access);
469 tcase_add_test(tc, edje_test_box); 513 tcase_add_test(tc, edje_test_box);
470} 514}