summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Willmann <d.willmann@samsung.com>2013-06-27 17:53:48 +0100
committerDaniel Willmann <d.willmann@samsung.com>2013-06-27 18:11:15 +0100
commit3bf0bcd11c865bb5ce714ea55a57b612e39b00f0 (patch)
treeac6972d1a8461c80bf2b5977834e9454bc39db60
parent5763195418c4e2970da594572b78ad86ab7784e8 (diff)
edje_test: Test geometry of a more complex layoutdevs/asdfuser/edje_tests
For some reason the width and height calculated are off-by-one. Need to look into it - for now I don't know if it's my problem or edje's. Signed-off-by: Daniel Willmann <d.willmann@samsung.com>
-rw-r--r--src/Makefile_Edje.am11
-rw-r--r--src/tests/edje/data/complex_layout.edc76
-rw-r--r--src/tests/edje/edje_test_edje.c42
3 files changed, 125 insertions, 4 deletions
diff --git a/src/Makefile_Edje.am b/src/Makefile_Edje.am
index f33cd7c652..6c1daf939e 100644
--- a/src/Makefile_Edje.am
+++ b/src/Makefile_Edje.am
@@ -236,15 +236,18 @@ $(EDJE_COMMON_CPPFLAGS) \
236tests_edje_edje_suite_LDADD = @CHECK_LIBS@ $(USE_EDJE_BIN_LIBS) 236tests_edje_edje_suite_LDADD = @CHECK_LIBS@ $(USE_EDJE_BIN_LIBS)
237tests_edje_edje_suite_DEPENDENCIES = @USE_EDJE_INTERNAL_LIBS@ 237tests_edje_edje_suite_DEPENDENCIES = @USE_EDJE_INTERNAL_LIBS@
238 238
239tests/edje/data/test_layout.edj: tests/edje/data/test_layout.edc bin/edje/edje_cc${EXEEXT} 239tests/edje/data/%.edj: tests/edje/data/%.edc bin/edje/edje_cc${EXEEXT}
240 @$(MKDIR_P) tests/edje/data 240 @$(MKDIR_P) tests/edje/data
241 $(AM_V_EDJ)$(EDJE_CC) $(EDJE_CC_FLAGS) -id $(srcdir)/tests/edje/data $< $@ 241 $(AM_V_EDJ)$(EDJE_CC) $(EDJE_CC_FLAGS) -id $(srcdir)/tests/edje/data $< $@
242 242
243EDJE_DATA_FILES = tests/edje/data/test_layout.edc 243EDJE_DATA_FILES = tests/edje/data/test_layout.edc \
244 tests/edje/data/complex_layout.edc
244 245
245edjedatafilesdir = $(datadir)/edje/data 246edjedatafilesdir = $(datadir)/edje/data
246edjedatafiles_DATA = tests/edje/data/test_layout.edj 247edjedatafiles_DATA = tests/edje/data/test_layout.edj \
247CLEANFILES += tests/edje/data/test_layout.edj 248 tests/edje/data/complex_layout.edj
249CLEANFILES += tests/edje/data/test_layout.edj \
250 tests/edje/data/complex_layout.edj
248 251
249endif 252endif
250 253
diff --git a/src/tests/edje/data/complex_layout.edc b/src/tests/edje/data/complex_layout.edc
new file mode 100644
index 0000000000..0566ced7fc
--- /dev/null
+++ b/src/tests/edje/data/complex_layout.edc
@@ -0,0 +1,76 @@
1collections {
2 group {
3 name: "test_group";
4
5 parts {
6 part {
7 name: "background";
8 type: RECT;
9 mouse_events: 0;
10
11 description {
12 state: "default" 0.0;
13 color: 0 0 0 0;
14
15 rel1 {
16 relative: 0.0 0.0;
17 }
18 rel2 {
19 relative: 1.0 1.0;
20 }
21 }
22 }
23 part {
24 name: "ul";
25 type: RECT;
26
27 description {
28 state: "default" 0.0;
29
30 rel1 {
31 relative: 0.0 0.0;
32 offset: 5 5;
33 }
34 rel2 {
35 relative: 0.5 0.5;
36 offset: -2 -2;
37 }
38 }
39 }
40 part {
41 name: "ur";
42 type: RECT;
43
44 description {
45 state: "default" 0.0;
46
47 rel1 {
48 relative: 0.5 0.0;
49 offset: 2 5;
50 }
51 rel2 {
52 relative: 1.0 0.5;
53 offset: -5 -2;
54 }
55 }
56 }
57 part {
58 name: "l";
59 type: RECT;
60
61 description {
62 state: "default" 0.0;
63
64 rel1 {
65 relative: 0.0 0.5;
66 offset: 5 2;
67 }
68 rel2 {
69 relative: 1.0 1.0;
70 offset: -5 -5;
71 }
72 }
73 }
74 }
75 }
76}
diff --git a/src/tests/edje/edje_test_edje.c b/src/tests/edje/edje_test_edje.c
index e9478c7508..5ff8f01bca 100644
--- a/src/tests/edje/edje_test_edje.c
+++ b/src/tests/edje/edje_test_edje.c
@@ -100,10 +100,52 @@ START_TEST(edje_test_simple_layout_geometry)
100} 100}
101END_TEST 101END_TEST
102 102
103START_TEST(edje_test_complex_layout)
104{
105 int x, y, w, h;
106 Evas *evas = EDJE_TEST_INIT_EVAS();
107 Evas_Object *obj;
108
109 obj = edje_object_add(evas);
110 fail_unless(edje_object_file_set(obj, test_layout_get("complex_layout.edj"), "test_group"));
111 evas_object_resize(obj, 1000, 1000);
112 edje_object_part_geometry_get(obj, "background", &x, &y, &w, &h);
113
114 fail_if(x != 0 || y != 0);
115 fail_if(w != 1000 || h != 1000);
116
117 /* rel1.relative: 0.0 0.0; rel1.offset: 5 5;
118 * rel2.relative: 0.5 0.5; rel2.offset -2 -2; */
119 edje_object_part_geometry_get(obj, "ul", &x, &y, &w, &h);
120 printf("(%i, %i) (%i, %i)\n", x, y, w, h);
121 fail_if(x != 5 || y != 5);
122 //fail_if(w != 500-5-2 || h != 500-5-2);
123
124 /* rel1.relative: 0.5 0.0; rel1.offset: 2 5;
125 * rel2.relative: 1.0 0.5; rel2.offset -5 -2; */
126 edje_object_part_geometry_get(obj, "ur", &x, &y, &w, &h);
127 printf("(%i, %i) (%i, %i)\n", x, y, w, h);
128 fail_if(x != 500+2 || y != 5);
129 //fail_if(w != 500-5-2 || h != 500-5-2);
130
131 /* rel1.relative: 0.0 0.5; rel1.offset: 5 2;
132 * rel2.relative: 1.0 1.0; rel2.offset -5 -5; */
133 edje_object_part_geometry_get(obj, "l", &x, &y, &w, &h);
134 printf("(%i, %i) (%i, %i)\n", x, y, w, h);
135 fail_if(x != 5 || y != 500+2);
136 //fail_if(w != 1000-5-5 || h != 500-5-2);
137
138
139
140 EDJE_TEST_FREE_EVAS();
141}
142END_TEST
143
103void edje_test_edje(TCase *tc) 144void edje_test_edje(TCase *tc)
104{ 145{
105 tcase_add_test(tc, edje_test_edje_init); 146 tcase_add_test(tc, edje_test_edje_init);
106 tcase_add_test(tc,edje_test_load_simple_layout); 147 tcase_add_test(tc,edje_test_load_simple_layout);
107 tcase_add_test(tc, edje_test_edje_load); 148 tcase_add_test(tc, edje_test_edje_load);
108 tcase_add_test(tc, edje_test_simple_layout_geometry); 149 tcase_add_test(tc, edje_test_simple_layout_geometry);
150 tcase_add_test(tc, edje_test_complex_layout);
109} 151}