aboutsummaryrefslogtreecommitdiffstats
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
parentedje_test: Test geometry and color of edje part (diff)
downloadefl-devs/asdfuser/edje_tests.tar.gz
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) \
tests_edje_edje_suite_LDADD = @CHECK_LIBS@ $(USE_EDJE_BIN_LIBS)
tests_edje_edje_suite_DEPENDENCIES = @USE_EDJE_INTERNAL_LIBS@
-tests/edje/data/test_layout.edj: tests/edje/data/test_layout.edc bin/edje/edje_cc${EXEEXT}
+tests/edje/data/%.edj: tests/edje/data/%.edc bin/edje/edje_cc${EXEEXT}
@$(MKDIR_P) tests/edje/data
$(AM_V_EDJ)$(EDJE_CC) $(EDJE_CC_FLAGS) -id $(srcdir)/tests/edje/data $< $@
-EDJE_DATA_FILES = tests/edje/data/test_layout.edc
+EDJE_DATA_FILES = tests/edje/data/test_layout.edc \
+ tests/edje/data/complex_layout.edc
edjedatafilesdir = $(datadir)/edje/data
-edjedatafiles_DATA = tests/edje/data/test_layout.edj
-CLEANFILES += tests/edje/data/test_layout.edj
+edjedatafiles_DATA = tests/edje/data/test_layout.edj \
+ tests/edje/data/complex_layout.edj
+CLEANFILES += tests/edje/data/test_layout.edj \
+ tests/edje/data/complex_layout.edj
endif
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 @@
+collections {
+ group {
+ name: "test_group";
+
+ parts {
+ part {
+ name: "background";
+ type: RECT;
+ mouse_events: 0;
+
+ description {
+ state: "default" 0.0;
+ color: 0 0 0 0;
+
+ rel1 {
+ relative: 0.0 0.0;
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ }
+ }
+ }
+ part {
+ name: "ul";
+ type: RECT;
+
+ description {
+ state: "default" 0.0;
+
+ rel1 {
+ relative: 0.0 0.0;
+ offset: 5 5;
+ }
+ rel2 {
+ relative: 0.5 0.5;
+ offset: -2 -2;
+ }
+ }
+ }
+ part {
+ name: "ur";
+ type: RECT;
+
+ description {
+ state: "default" 0.0;
+
+ rel1 {
+ relative: 0.5 0.0;
+ offset: 2 5;
+ }
+ rel2 {
+ relative: 1.0 0.5;
+ offset: -5 -2;
+ }
+ }
+ }
+ part {
+ name: "l";
+ type: RECT;
+
+ description {
+ state: "default" 0.0;
+
+ rel1 {
+ relative: 0.0 0.5;
+ offset: 5 2;
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ offset: -5 -5;
+ }
+ }
+ }
+ }
+ }
+}
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)
}
END_TEST
+START_TEST(edje_test_complex_layout)
+{
+ int x, y, w, h;
+ Evas *evas = EDJE_TEST_INIT_EVAS();
+ Evas_Object *obj;
+
+ obj = edje_object_add(evas);
+ fail_unless(edje_object_file_set(obj, test_layout_get("complex_layout.edj"), "test_group"));
+ evas_object_resize(obj, 1000, 1000);
+ edje_object_part_geometry_get(obj, "background", &x, &y, &w, &h);
+
+ fail_if(x != 0 || y != 0);
+ fail_if(w != 1000 || h != 1000);
+
+ /* rel1.relative: 0.0 0.0; rel1.offset: 5 5;
+ * rel2.relative: 0.5 0.5; rel2.offset -2 -2; */
+ edje_object_part_geometry_get(obj, "ul", &x, &y, &w, &h);
+ printf("(%i, %i) (%i, %i)\n", x, y, w, h);
+ fail_if(x != 5 || y != 5);
+ //fail_if(w != 500-5-2 || h != 500-5-2);
+
+ /* rel1.relative: 0.5 0.0; rel1.offset: 2 5;
+ * rel2.relative: 1.0 0.5; rel2.offset -5 -2; */
+ edje_object_part_geometry_get(obj, "ur", &x, &y, &w, &h);
+ printf("(%i, %i) (%i, %i)\n", x, y, w, h);
+ fail_if(x != 500+2 || y != 5);
+ //fail_if(w != 500-5-2 || h != 500-5-2);
+
+ /* rel1.relative: 0.0 0.5; rel1.offset: 5 2;
+ * rel2.relative: 1.0 1.0; rel2.offset -5 -5; */
+ edje_object_part_geometry_get(obj, "l", &x, &y, &w, &h);
+ printf("(%i, %i) (%i, %i)\n", x, y, w, h);
+ fail_if(x != 5 || y != 500+2);
+ //fail_if(w != 1000-5-5 || h != 500-5-2);
+
+
+
+ EDJE_TEST_FREE_EVAS();
+}
+END_TEST
+
void edje_test_edje(TCase *tc)
{
tcase_add_test(tc, edje_test_edje_init);
tcase_add_test(tc,edje_test_load_simple_layout);
tcase_add_test(tc, edje_test_edje_load);
tcase_add_test(tc, edje_test_simple_layout_geometry);
+ tcase_add_test(tc, edje_test_complex_layout);
}