summaryrefslogtreecommitdiff
path: root/src/tests
diff options
context:
space:
mode:
authorRyuan Choi <ryuan.choi@gmail.com>2014-02-17 21:26:14 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2014-02-17 21:26:14 +0900
commit00dc69e2b45c16c65fe67e6522f363b68180304b (patch)
treec6a3cd1f0a66d059b685d690c9f7ffa7e1b94221 /src/tests
parent35161f75fcedbe1ccffb5e6809f44e287265645d (diff)
colorselector: Do not add custom palette color to the palette of config
Summary: elm_colorselector_palette_color_add() clears the palette if config_load is true. It means that this API will add paletter color only for this colorselector object. Fixes T786 Test Plan: Added elm_colorselector_palette. Reviewers: seoz, raster Maniphest Tasks: T786 Differential Revision: https://phab.enlightenment.org/D557
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/Makefile.am1
-rw-r--r--src/tests/elm_suite.c1
-rw-r--r--src/tests/elm_suite.h1
-rw-r--r--src/tests/elm_test_colorselector.c38
4 files changed, 41 insertions, 0 deletions
diff --git a/src/tests/Makefile.am b/src/tests/Makefile.am
index fa9768603..84c763bb4 100644
--- a/src/tests/Makefile.am
+++ b/src/tests/Makefile.am
@@ -7,6 +7,7 @@ check_PROGRAMS = elm_suite
7elm_suite_SOURCES = \ 7elm_suite_SOURCES = \
8 elm_suite.c \ 8 elm_suite.c \
9 elm_test_check.c \ 9 elm_test_check.c \
10 elm_test_colorselector.c \
10 elm_test_init.c 11 elm_test_init.c
11 12
12elm_suite_CPPFLAGS = \ 13elm_suite_CPPFLAGS = \
diff --git a/src/tests/elm_suite.c b/src/tests/elm_suite.c
index e73a76859..7056b35fe 100644
--- a/src/tests/elm_suite.c
+++ b/src/tests/elm_suite.c
@@ -16,6 +16,7 @@ struct _Elementary_Test_Case
16static const Elementary_Test_Case etc[] = { 16static const Elementary_Test_Case etc[] = {
17 { "Elementary", elm_test_init }, 17 { "Elementary", elm_test_init },
18 { "elm_check", elm_test_check }, 18 { "elm_check", elm_test_check },
19 { "elm_colorselector", elm_test_colorselector },
19 { NULL, NULL } 20 { NULL, NULL }
20}; 21};
21 22
diff --git a/src/tests/elm_suite.h b/src/tests/elm_suite.h
index ec13e38b2..3d4be2948 100644
--- a/src/tests/elm_suite.h
+++ b/src/tests/elm_suite.h
@@ -5,5 +5,6 @@
5 5
6void elm_test_init(TCase *tc); 6void elm_test_init(TCase *tc);
7void elm_test_check(TCase *tc); 7void elm_test_check(TCase *tc);
8void elm_test_colorselector(TCase *tc);
8 9
9#endif /* _ELM_SUITE_H */ 10#endif /* _ELM_SUITE_H */
diff --git a/src/tests/elm_test_colorselector.c b/src/tests/elm_test_colorselector.c
new file mode 100644
index 000000000..3c3cbd18e
--- /dev/null
+++ b/src/tests/elm_test_colorselector.c
@@ -0,0 +1,38 @@
1#ifdef HAVE_CONFIG_H
2# include "elementary_config.h"
3#endif
4
5#include <Elementary.h>
6#include "elm_suite.h"
7
8START_TEST (elm_colorselector_palette)
9{
10 Evas_Object *win, *c;
11 unsigned int palette_cnt;
12
13 elm_init(1, NULL);
14 win = elm_win_add(NULL, "check", ELM_WIN_BASIC);
15
16 c = elm_colorselector_add(win);
17 /* Get the count of default palettes */
18 palette_cnt = eina_list_count(elm_colorselector_palette_items_get(c));
19 evas_object_del(c);
20
21 c = elm_colorselector_add(win);
22 ck_assert(eina_list_count(elm_colorselector_palette_items_get(c)) == palette_cnt);
23 elm_colorselector_palette_color_add(c, 255, 255, 255, 255);
24 ck_assert(eina_list_count(elm_colorselector_palette_items_get(c)) == 1);
25 evas_object_del(c);
26
27 c = elm_colorselector_add(win);
28 ck_assert(eina_list_count(elm_colorselector_palette_items_get(c)) == palette_cnt);
29 evas_object_del(c);
30
31 elm_shutdown();
32}
33END_TEST
34
35void elm_test_colorselector(TCase *tc)
36{
37 tcase_add_test(tc, elm_colorselector_palette);
38}