summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2020-02-25 09:23:44 -0500
committerMike Blumenkrantz <zmike@samsung.com>2020-02-25 09:23:44 -0500
commit1b5ad4740e19be9e49432fbf895ae15a81c05a18 (patch)
treec12c1ceebcbb690334249945e476d46c619553a2
parentd8da207f5f4937a6a99576b04bffa8ff9bfa9cbe (diff)
tests/elm: fix elm_icon test
Summary: * this was left as a duplicated efl_ui_image test * elm_image doesn't have a legacy api for setting icons * elm_icon doesn't actually have any tests for icon loading Depends on D11396 Reviewers: kimcinoo, Hermet Reviewed By: Hermet Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11397
-rw-r--r--src/tests/elementary/elm_test_icon.c26
-rw-r--r--src/tests/elementary/elm_test_image.c25
2 files changed, 26 insertions, 25 deletions
diff --git a/src/tests/elementary/elm_test_icon.c b/src/tests/elementary/elm_test_icon.c
index 517ace64a2..cf5329cc25 100644
--- a/src/tests/elementary/elm_test_icon.c
+++ b/src/tests/elementary/elm_test_icon.c
@@ -41,8 +41,34 @@ EFL_START_TEST(elm_atspi_role_get)
41} 41}
42EFL_END_TEST 42EFL_END_TEST
43 43
44EFL_START_TEST(elm_test_icon_set)
45{
46 Evas_Object *win, *image;
47 Eina_Bool ok;
48 const char *icon_name;
49
50 win = win_add(NULL, "icon", ELM_WIN_BASIC);
51
52 image = elm_icon_add(win);
53 evas_object_show(image);
54
55 ok = elm_icon_standard_set(image, "folder");
56 ck_assert(ok);
57 icon_name = elm_icon_standard_get(image);
58 ck_assert_str_eq(icon_name, "folder");
59
60 ok = elm_icon_standard_set(image, "None");
61 ck_assert(ok == 0);
62 icon_name = elm_icon_standard_get(image);
63 /* elm_icon only changes internal name on success */
64 ck_assert_str_eq(icon_name, "folder");
65
66}
67EFL_END_TEST
68
44void elm_test_icon(TCase *tc) 69void elm_test_icon(TCase *tc)
45{ 70{
46 tcase_add_test(tc, elm_icon_legacy_type_check); 71 tcase_add_test(tc, elm_icon_legacy_type_check);
47 tcase_add_test(tc, elm_atspi_role_get); 72 tcase_add_test(tc, elm_atspi_role_get);
73 tcase_add_test(tc, elm_test_icon_set);
48} 74}
diff --git a/src/tests/elementary/elm_test_image.c b/src/tests/elementary/elm_test_image.c
index 6d6ff52f6f..36e9aa2a84 100644
--- a/src/tests/elementary/elm_test_image.c
+++ b/src/tests/elementary/elm_test_image.c
@@ -227,30 +227,6 @@ EFL_START_TEST(elm_image_evas_image_get)
227} 227}
228EFL_END_TEST 228EFL_END_TEST
229 229
230EFL_START_TEST(efl_ui_image_icon)
231{
232 Evas_Object *win, *image;
233 Eina_Bool ok;
234 const char *icon_name;
235
236 win = win_add(NULL, "image", ELM_WIN_BASIC);
237
238 image = efl_add(EFL_UI_IMAGE_CLASS, win);
239 evas_object_show(image);
240
241 ok = efl_ui_image_icon_set(image, "folder");
242 ck_assert(ok);
243 icon_name = efl_ui_image_icon_get(image);
244 ck_assert_str_eq(icon_name, "folder");
245
246 ok = efl_ui_image_icon_set(image, "None");
247 ck_assert(ok == 0);
248 icon_name = efl_ui_image_icon_get(image);
249 ck_assert(icon_name == NULL);
250
251}
252EFL_END_TEST
253
254void elm_test_image(TCase *tc) 230void elm_test_image(TCase *tc)
255{ 231{
256 tcase_add_test(tc, elm_image_legacy_type_check); 232 tcase_add_test(tc, elm_image_legacy_type_check);
@@ -259,5 +235,4 @@ void elm_test_image(TCase *tc)
259 tcase_add_test(tc, elm_image_async_mmap); 235 tcase_add_test(tc, elm_image_async_mmap);
260 tcase_add_test(tc, elm_image_evas_object_color_set); 236 tcase_add_test(tc, elm_image_evas_object_color_set);
261 tcase_add_test(tc, elm_image_evas_image_get); 237 tcase_add_test(tc, elm_image_evas_image_get);
262 tcase_add_test(tc, efl_ui_image_icon);
263} 238}