summaryrefslogtreecommitdiff
path: root/src/tests/edje
diff options
context:
space:
mode:
authorTom Hacohen <tom@stosb.com>2016-04-15 17:45:52 +0100
committerTom Hacohen <tom@stosb.com>2016-04-18 10:10:23 +0100
commit70537370a1116a92e8a2caef13672cbcf8398ecf (patch)
tree1a8c4e0e25c034b7063e1cd1418a34fc97a0c6b2 /src/tests/edje
parentcd26435434efb8c84bac15f0ade75a149b6c83c4 (diff)
Edje tests: Add parent upadting tests to edje.
Diffstat (limited to 'src/tests/edje')
-rw-r--r--src/tests/edje/data/test_swallows.edc23
-rw-r--r--src/tests/edje/edje_test_edje.c32
2 files changed, 55 insertions, 0 deletions
diff --git a/src/tests/edje/data/test_swallows.edc b/src/tests/edje/data/test_swallows.edc
new file mode 100644
index 0000000000..b1b9e91e42
--- /dev/null
+++ b/src/tests/edje/data/test_swallows.edc
@@ -0,0 +1,23 @@
1collections {
2 group {
3 name: "test_group";
4
5 parts {
6 part {
7 name: "swallow";
8 type: SWALLOW;
9
10 description {
11 state: "default" 0.0;
12
13 rel1 {
14 relative: 0.0 0.0;
15 }
16 rel2 {
17 relative: 1.0 1.0;
18 }
19 }
20 }
21 }
22 }
23}
diff --git a/src/tests/edje/edje_test_edje.c b/src/tests/edje/edje_test_edje.c
index 8a3d6451a8..658f115d89 100644
--- a/src/tests/edje/edje_test_edje.c
+++ b/src/tests/edje/edje_test_edje.c
@@ -350,6 +350,37 @@ START_TEST(edje_test_color_class)
350} 350}
351END_TEST 351END_TEST
352 352
353START_TEST(edje_test_swallows)
354{
355 Evas *evas = EDJE_TEST_INIT_EVAS();
356 Evas_Object *ly, *o1, *o2;
357
358 ly = eo_add(EDJE_OBJECT_CLASS, evas);
359 fail_unless(edje_object_file_set(ly, test_layout_get("test_swallows.edj"), "test_group"));
360
361 fail_unless(edje_object_part_exists(ly, "swallow"));
362
363
364 o1 = eo_add(EDJE_OBJECT_CLASS, ly);
365 fail_if(!edje_obj_part_swallow(ly, "swallow", o1));
366 ck_assert_ptr_eq(eo_parent_get(o1), ly);
367
368 edje_obj_part_unswallow(ly, o1);
369 ck_assert_ptr_eq(eo_parent_get(o1), evas_common_evas_get(o1));
370
371 fail_if(!edje_obj_part_swallow(ly, "swallow", o1));
372 ck_assert_ptr_eq(eo_parent_get(o1), ly);
373
374 o2 = eo_add(EDJE_OBJECT_CLASS, ly);
375 fail_if(!edje_obj_part_swallow(ly, "swallow", o2));
376 ck_assert_ptr_eq(eo_parent_get(o2), ly);
377 /* o1 is deleted at this point. */
378 ck_assert_ptr_eq(eo_parent_get(o1), evas_common_evas_get(o1));
379
380 EDJE_TEST_FREE_EVAS();
381}
382END_TEST
383
353void edje_test_edje(TCase *tc) 384void edje_test_edje(TCase *tc)
354{ 385{
355 tcase_add_test(tc, edje_test_edje_init); 386 tcase_add_test(tc, edje_test_edje_init);
@@ -363,4 +394,5 @@ void edje_test_edje(TCase *tc)
363 tcase_add_test(tc, edje_test_snapshot); 394 tcase_add_test(tc, edje_test_snapshot);
364 tcase_add_test(tc, edje_test_size_class); 395 tcase_add_test(tc, edje_test_size_class);
365 tcase_add_test(tc, edje_test_color_class); 396 tcase_add_test(tc, edje_test_color_class);
397 tcase_add_test(tc, edje_test_swallows);
366} 398}