aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJee-Yong Um <jc9.um@samsung.com>2016-02-05 07:51:31 +0100
committerCedric BAIL <cedric@osg.samsung.com>2016-02-05 07:51:34 +0100
commita416f73790aa9cd851cc4748a881df169d480d9f (patch)
tree1bc0dd97f6974d6c9550c81e1ccecabe1c5b1a23
parentevas: add native surface with TBM Surface for wayland_shm engine (diff)
downloadefl-a416f73790aa9cd851cc4748a881df169d480d9f.tar.gz
edje: add test for omitting "name" keyword in color_classes.color_class block
Summary: This test checks whether omitting "name" keyword in color_classes.color_class block in EDC work normally. Depends on https://phab.enlightenment.org/D3598 Test Plan: make check Reviewers: cedric, jpeg Differential Revision: https://phab.enlightenment.org/D3615 Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
-rw-r--r--src/Makefile_Edje.am8
-rw-r--r--src/tests/edje/data/test_color_class.edc17
-rw-r--r--src/tests/edje/edje_test_edje.c36
3 files changed, 59 insertions, 2 deletions
diff --git a/src/Makefile_Edje.am b/src/Makefile_Edje.am
index 4fa0ecf09f..57f73b0750 100644
--- a/src/Makefile_Edje.am
+++ b/src/Makefile_Edje.am
@@ -256,6 +256,7 @@ tests/edje/data/test_masking.edc \
tests/edje/data/test_filters.edc \
tests/edje/data/test_snapshot.edc \
tests/edje/data/test_size_class.edc \
+tests/edje/data/test_color_class.edc \
tests/edje/data/filter.lua
@@ -299,6 +300,7 @@ EDJE_DATA_FILES = tests/edje/data/test_layout.edc \
tests/edje/data/test_filters.edc \
tests/edje/data/test_snapshot.edc \
tests/edje/data/test_size_class.edc \
+ tests/edje/data/test_color_class.edc \
tests/edje/data/filter.lua
edjedatafilesdir = $(datadir)/edje/data
@@ -308,7 +310,8 @@ edjedatafiles_DATA = tests/edje/data/test_layout.edj \
tests/edje/data/test_masking.edj \
tests/edje/data/test_filters.edj \
tests/edje/data/test_snapshot.edj \
- tests/edje/data/test_size_class.edj
+ tests/edje/data/test_size_class.edj \
+ tests/edje/data/test_color_class.edj
CLEANFILES += tests/edje/data/test_layout.edj \
tests/edje/data/complex_layout.edj \
@@ -316,7 +319,8 @@ CLEANFILES += tests/edje/data/test_layout.edj \
tests/edje/data/test_masking.edj \
tests/edje/data/test_filters.edj \
tests/edje/data/test_snapshot.edj \
- tests/edje/data/test_size_class.edj
+ tests/edje/data/test_size_class.edj \
+ tests/edje/data/test_color_class.edj
endif
diff --git a/src/tests/edje/data/test_color_class.edc b/src/tests/edje/data/test_color_class.edc
new file mode 100644
index 0000000000..30c7b456c5
--- /dev/null
+++ b/src/tests/edje/data/test_color_class.edc
@@ -0,0 +1,17 @@
+collections {
+ color_classes {
+ color_class { "test_color_class";
+ color: 100 100 100 100;
+ }
+ }
+ group { name: "test_group";
+ parts {
+ rect { "rect";
+ desc { "default";
+ color_class: "test_color_class";
+ }
+ }
+ }
+ }
+}
+
diff --git a/src/tests/edje/edje_test_edje.c b/src/tests/edje/edje_test_edje.c
index 536de1db44..407ff9af30 100644
--- a/src/tests/edje/edje_test_edje.c
+++ b/src/tests/edje/edje_test_edje.c
@@ -327,6 +327,41 @@ START_TEST(edje_test_size_class)
}
END_TEST
+START_TEST(edje_test_color_class)
+{
+ Evas *evas = EDJE_TEST_INIT_EVAS();
+
+ Eina_File *f;
+ Eina_Iterator *it;
+ Edje_Color_Class *itcc, *cc = NULL;
+ char *filename;
+
+ filename = realpath(test_layout_get("test_color_class.edj"), NULL);
+ fail_if(!filename);
+
+ f = eina_file_open(filename, EINA_FALSE);
+ fail_if(!f);
+
+ it = edje_mmap_color_class_iterator_new(f);
+ fail_if(!it);
+ EINA_ITERATOR_FOREACH(it, itcc)
+ {
+ if (!strcmp(itcc->name, "test_color_class"))
+ {
+ cc = itcc;
+ break;
+ }
+ }
+ fail_if((!cc) || (cc->r != 100) || (cc->g != 100) || (cc->b != 100) || (cc->a != 100));
+
+ eina_iterator_free(it);
+ eina_file_close(f);
+ free(filename);
+
+ EDJE_TEST_FREE_EVAS();
+}
+END_TEST
+
void edje_test_edje(TCase *tc)
{
tcase_add_test(tc, edje_test_edje_init);
@@ -339,4 +374,5 @@ void edje_test_edje(TCase *tc)
tcase_add_test(tc, edje_test_filters);
tcase_add_test(tc, edje_test_snapshot);
tcase_add_test(tc, edje_test_size_class);
+ tcase_add_test(tc, edje_test_color_class);
}