summaryrefslogtreecommitdiff
path: root/src/tests/edje/edje_test_edje.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/tests/edje/edje_test_edje.c')
-rw-r--r--src/tests/edje/edje_test_edje.c53
1 files changed, 53 insertions, 0 deletions
diff --git a/src/tests/edje/edje_test_edje.c b/src/tests/edje/edje_test_edje.c
index 2cca72bd87..9f7fa991a3 100644
--- a/src/tests/edje/edje_test_edje.c
+++ b/src/tests/edje/edje_test_edje.c
@@ -84,6 +84,8 @@ START_TEST(edje_test_simple_layout_geometry)
84 obj = edje_object_add(evas); 84 obj = edje_object_add(evas);
85 fail_unless(edje_object_file_set(obj, test_layout_get("test_layout.edj"), "test_group")); 85 fail_unless(edje_object_file_set(obj, test_layout_get("test_layout.edj"), "test_group"));
86 86
87 /* rel1.relative: 0.0 0.0;
88 * rel2.relative: 1.0 1.0; */
87 evas_object_resize(obj, 1000, 1000); 89 evas_object_resize(obj, 1000, 1000);
88 edje_object_part_geometry_get(obj, "background", &x, &y, &w, &h); 90 edje_object_part_geometry_get(obj, "background", &x, &y, &w, &h);
89 91
@@ -100,10 +102,61 @@ START_TEST(edje_test_simple_layout_geometry)
100} 102}
101END_TEST 103END_TEST
102 104
105START_TEST(edje_test_complex_layout)
106{
107 int x, y, w, h;
108 Evas *evas = EDJE_TEST_INIT_EVAS();
109 Evas_Object *obj;
110
111 obj = edje_object_add(evas);
112 fail_unless(edje_object_file_set(obj, test_layout_get("complex_layout.edj"), "test_group"));
113 evas_object_resize(obj, 1000, 1000);
114
115 /* Apparently rel2 offsets are retarded and you have to introduce off-by-one
116 * madness (rel2.offset: -1 -1; acts like there is zero offset...)
117 * Take that into account when checking w and h */
118
119 /* rel1.relative: 0.0 0.0; rel1.offset: 0 0;
120 * rel2.relative: 1.0 1.0; rel2.offset -1 -1; */
121 edje_object_part_geometry_get(obj, "background", &x, &y, &w, &h);
122 fail_if(x != 0 || y != 0);
123 fail_if(w != 1000-1 + 1 || h != 1000-1 + 1);
124
125 /* rel1.relative: 0.0 0.0; rel1.offset: 1 1;
126 * rel2.relative: 1.0 1.0; rel2.offset 0 0; */
127 edje_object_part_geometry_get(obj, "background2", &x, &y, &w, &h);
128 fail_if(x != 1 || y != 1);
129 fail_if(w != 1000-1 + 1 || h != 1000-1 + 1);
130
131 /* rel1.relative: 0.0 0.0; rel1.offset: 5 5;
132 * rel2.relative: 0.5 0.5; rel2.offset -2 -2; */
133 edje_object_part_geometry_get(obj, "ul", &x, &y, &w, &h);
134 fail_if(x != 5 || y != 5);
135 fail_if(w != 500-5-2 + 1 || h != 500-5-2 + 1);
136
137 /* rel1.relative: 0.5 0.0; rel1.offset: 2 5;
138 * rel2.relative: 1.0 0.5; rel2.offset -5 -2; */
139 edje_object_part_geometry_get(obj, "ur", &x, &y, &w, &h);
140 fail_if(x != 500+2 || y != 5);
141 fail_if(w != 500-5-2 + 1 || h != 500-5-2 + 1);
142
143 /* rel1.relative: 0.0 0.5; rel1.offset: 5 2;
144 * rel2.relative: 1.0 1.0; rel2.offset -5 -5; */
145 edje_object_part_geometry_get(obj, "l", &x, &y, &w, &h);
146 fail_if(x != 5 || y != 500+2);
147 fail_if(w != 1000-5-5 + 1 || h != 500-5-2 + 1);
148
149
150
151 EDJE_TEST_FREE_EVAS();
152}
153END_TEST
154
103void edje_test_edje(TCase *tc) 155void edje_test_edje(TCase *tc)
104{ 156{
105 tcase_add_test(tc, edje_test_edje_init); 157 tcase_add_test(tc, edje_test_edje_init);
106 tcase_add_test(tc,edje_test_load_simple_layout); 158 tcase_add_test(tc,edje_test_load_simple_layout);
107 tcase_add_test(tc, edje_test_edje_load); 159 tcase_add_test(tc, edje_test_edje_load);
108 tcase_add_test(tc, edje_test_simple_layout_geometry); 160 tcase_add_test(tc, edje_test_simple_layout_geometry);
161 tcase_add_test(tc, edje_test_complex_layout);
109} 162}