summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 \
256tests/edje/data/test_filters.edc \ 256tests/edje/data/test_filters.edc \
257tests/edje/data/test_snapshot.edc \ 257tests/edje/data/test_snapshot.edc \
258tests/edje/data/test_size_class.edc \ 258tests/edje/data/test_size_class.edc \
259tests/edje/data/test_color_class.edc \
259tests/edje/data/filter.lua 260tests/edje/data/filter.lua
260 261
261 262
@@ -299,6 +300,7 @@ EDJE_DATA_FILES = tests/edje/data/test_layout.edc \
299 tests/edje/data/test_filters.edc \ 300 tests/edje/data/test_filters.edc \
300 tests/edje/data/test_snapshot.edc \ 301 tests/edje/data/test_snapshot.edc \
301 tests/edje/data/test_size_class.edc \ 302 tests/edje/data/test_size_class.edc \
303 tests/edje/data/test_color_class.edc \
302 tests/edje/data/filter.lua 304 tests/edje/data/filter.lua
303 305
304edjedatafilesdir = $(datadir)/edje/data 306edjedatafilesdir = $(datadir)/edje/data
@@ -308,7 +310,8 @@ edjedatafiles_DATA = tests/edje/data/test_layout.edj \
308 tests/edje/data/test_masking.edj \ 310 tests/edje/data/test_masking.edj \
309 tests/edje/data/test_filters.edj \ 311 tests/edje/data/test_filters.edj \
310 tests/edje/data/test_snapshot.edj \ 312 tests/edje/data/test_snapshot.edj \
311 tests/edje/data/test_size_class.edj 313 tests/edje/data/test_size_class.edj \
314 tests/edje/data/test_color_class.edj
312 315
313CLEANFILES += tests/edje/data/test_layout.edj \ 316CLEANFILES += tests/edje/data/test_layout.edj \
314 tests/edje/data/complex_layout.edj \ 317 tests/edje/data/complex_layout.edj \
@@ -316,7 +319,8 @@ CLEANFILES += tests/edje/data/test_layout.edj \
316 tests/edje/data/test_masking.edj \ 319 tests/edje/data/test_masking.edj \
317 tests/edje/data/test_filters.edj \ 320 tests/edje/data/test_filters.edj \
318 tests/edje/data/test_snapshot.edj \ 321 tests/edje/data/test_snapshot.edj \
319 tests/edje/data/test_size_class.edj 322 tests/edje/data/test_size_class.edj \
323 tests/edje/data/test_color_class.edj
320 324
321endif 325endif
322 326
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 @@
1collections {
2 color_classes {
3 color_class { "test_color_class";
4 color: 100 100 100 100;
5 }
6 }
7 group { name: "test_group";
8 parts {
9 rect { "rect";
10 desc { "default";
11 color_class: "test_color_class";
12 }
13 }
14 }
15 }
16}
17
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)
327} 327}
328END_TEST 328END_TEST
329 329
330START_TEST(edje_test_color_class)
331{
332 Evas *evas = EDJE_TEST_INIT_EVAS();
333
334 Eina_File *f;
335 Eina_Iterator *it;
336 Edje_Color_Class *itcc, *cc = NULL;
337 char *filename;
338
339 filename = realpath(test_layout_get("test_color_class.edj"), NULL);
340 fail_if(!filename);
341
342 f = eina_file_open(filename, EINA_FALSE);
343 fail_if(!f);
344
345 it = edje_mmap_color_class_iterator_new(f);
346 fail_if(!it);
347 EINA_ITERATOR_FOREACH(it, itcc)
348 {
349 if (!strcmp(itcc->name, "test_color_class"))
350 {
351 cc = itcc;
352 break;
353 }
354 }
355 fail_if((!cc) || (cc->r != 100) || (cc->g != 100) || (cc->b != 100) || (cc->a != 100));
356
357 eina_iterator_free(it);
358 eina_file_close(f);
359 free(filename);
360
361 EDJE_TEST_FREE_EVAS();
362}
363END_TEST
364
330void edje_test_edje(TCase *tc) 365void edje_test_edje(TCase *tc)
331{ 366{
332 tcase_add_test(tc, edje_test_edje_init); 367 tcase_add_test(tc, edje_test_edje_init);
@@ -339,4 +374,5 @@ void edje_test_edje(TCase *tc)
339 tcase_add_test(tc, edje_test_filters); 374 tcase_add_test(tc, edje_test_filters);
340 tcase_add_test(tc, edje_test_snapshot); 375 tcase_add_test(tc, edje_test_snapshot);
341 tcase_add_test(tc, edje_test_size_class); 376 tcase_add_test(tc, edje_test_size_class);
377 tcase_add_test(tc, edje_test_color_class);
342} 378}