summaryrefslogtreecommitdiff
path: root/src/tests/elm_test_colorselector.c
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/elm_test_colorselector.c
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 '')
-rw-r--r--src/tests/elm_test_colorselector.c38
1 files changed, 38 insertions, 0 deletions
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}