cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=a416f73790aa9cd851cc4748a881df169d480d9f
commit a416f73790aa9cd851cc4748a881df169d480d9f Author: Jee-Yong Um <[email protected]> Date: Fri Feb 5 07:51:31 2016 +0100 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 D3598 Test Plan: make check Reviewers: cedric, jpeg Differential Revision: https://phab.enlightenment.org/D3615 Signed-off-by: Cedric BAIL <[email protected]> --- src/Makefile_Edje.am | 8 +++++-- src/tests/edje/data/test_color_class.edc | 17 +++++++++++++++ src/tests/edje/edje_test_edje.c | 36 ++++++++++++++++++++++++++++++++ 3 files changed, 59 insertions(+), 2 deletions(-) diff --git a/src/Makefile_Edje.am b/src/Makefile_Edje.am index 4fa0ecf..57f73b0 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 0000000..30c7b45 --- /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 536de1d..407ff9a 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); } --
