From 7628bd76ed083e4c24b23f4ad9e1b7d862d624f8 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Mon, 28 Jan 2019 14:38:38 -0500 Subject: [PATCH] tests: move image_zoomable into efl_ui_suite ref T6815 Reviewed-by: Stefan Schmidt Differential Revision: https://phab.enlightenment.org/D7807 --- src/Makefile_Elementary.am | 1 + src/tests/elementary/efl_ui_suite.c | 1 + src/tests/elementary/efl_ui_suite.h | 1 + .../elementary/efl_ui_test_image_zoomable.c | 37 +++++++++++++++++++ src/tests/elementary/elm_test_photocam.c | 25 ------------- src/tests/elementary/meson.build | 1 + 6 files changed, 41 insertions(+), 25 deletions(-) create mode 100644 src/tests/elementary/efl_ui_test_image_zoomable.c diff --git a/src/Makefile_Elementary.am b/src/Makefile_Elementary.am index 0694bb5e04..db06766362 100644 --- a/src/Makefile_Elementary.am +++ b/src/Makefile_Elementary.am @@ -1609,6 +1609,7 @@ tests_elementary_efl_ui_suite_SOURCES = \ tests/elementary/efl_ui_suite.c \ tests/elementary/elm_test_init.c \ tests/elementary/efl_ui_test_atspi.c \ + tests/elementary/efl_ui_test_image_zoomable.c \ tests/elementary/efl_ui_test_grid.c tests_elementary_efl_ui_suite_CPPFLAGS = \ diff --git a/src/tests/elementary/efl_ui_suite.c b/src/tests/elementary/efl_ui_suite.c index 9f4fbda98b..1fc0b49c6b 100644 --- a/src/tests/elementary/efl_ui_suite.c +++ b/src/tests/elementary/efl_ui_suite.c @@ -14,6 +14,7 @@ static const Efl_Test_Case etc[] = { //{ "elm_widget_focus", elm_test_widget_focus}, { "efl_ui_atspi", efl_ui_test_atspi}, { "efl_ui_grid", efl_ui_test_grid}, + { "efl_ui_image_zoomable", efl_ui_test_image_zoomable}, { NULL, NULL } }; diff --git a/src/tests/elementary/efl_ui_suite.h b/src/tests/elementary/efl_ui_suite.h index 720bc1a067..0fabdcfd47 100644 --- a/src/tests/elementary/efl_ui_suite.h +++ b/src/tests/elementary/efl_ui_suite.h @@ -18,6 +18,7 @@ #include void efl_ui_test_grid(TCase *tc); void efl_ui_test_atspi(TCase *tc); +void efl_ui_test_image_zoomable(TCase *tc); Eo *win_add(); Eo *win_add_focused(); diff --git a/src/tests/elementary/efl_ui_test_image_zoomable.c b/src/tests/elementary/efl_ui_test_image_zoomable.c new file mode 100644 index 0000000000..cbb16ad169 --- /dev/null +++ b/src/tests/elementary/efl_ui_test_image_zoomable.c @@ -0,0 +1,37 @@ +#ifdef HAVE_CONFIG_H +# include "elementary_config.h" +#endif +#define EFL_NOLEGACY_API_SUPPORT + +#include +#include "efl_ui_suite.h" + + +EFL_START_TEST(efl_ui_test_image_zoomable_icon) +{ + Evas_Object *win, *img_zoomable; + Eina_Bool ok; + const char *icon_name; + + win = win_add(NULL, "photocam", EFL_UI_WIN_BASIC); + + img_zoomable = efl_add(EFL_UI_IMAGE_ZOOMABLE_CLASS, win); + efl_gfx_entity_visible_set(img_zoomable, EINA_TRUE); + + ok = efl_ui_image_icon_set(img_zoomable, "folder"); + ck_assert(ok); + icon_name = efl_ui_image_icon_get(img_zoomable); + ck_assert_str_eq(icon_name, "folder"); + + ok = efl_ui_image_icon_set(img_zoomable, "None"); + ck_assert(ok == 0); + icon_name = efl_ui_image_icon_get(img_zoomable); + ck_assert(icon_name == NULL); + +} +EFL_END_TEST + +void efl_ui_test_image_zoomable(TCase *tc) +{ + tcase_add_test(tc, efl_ui_test_image_zoomable_icon); +} diff --git a/src/tests/elementary/elm_test_photocam.c b/src/tests/elementary/elm_test_photocam.c index 36a09488cf..b2bf4ecc12 100644 --- a/src/tests/elementary/elm_test_photocam.c +++ b/src/tests/elementary/elm_test_photocam.c @@ -41,33 +41,8 @@ EFL_START_TEST(elm_atspi_role_get) } EFL_END_TEST -EFL_START_TEST(efl_ui_image_zoomable_icon) -{ - Evas_Object *win, *img_zoomable; - Eina_Bool ok; - const char *icon_name; - - win = win_add(NULL, "photocam", ELM_WIN_BASIC); - - img_zoomable = efl_add(EFL_UI_IMAGE_ZOOMABLE_CLASS, win); - evas_object_show(img_zoomable); - - ok = efl_ui_image_icon_set(img_zoomable, "folder"); - ck_assert(ok); - icon_name = efl_ui_image_icon_get(img_zoomable); - ck_assert_str_eq(icon_name, "folder"); - - ok = efl_ui_image_icon_set(img_zoomable, "None"); - ck_assert(ok == 0); - icon_name = efl_ui_image_icon_get(img_zoomable); - ck_assert(icon_name == NULL); - -} -EFL_END_TEST - void elm_test_photocam(TCase *tc) { tcase_add_test(tc, elm_photocam_legacy_type_check); tcase_add_test(tc, elm_atspi_role_get); - tcase_add_test(tc, efl_ui_image_zoomable_icon); } diff --git a/src/tests/elementary/meson.build b/src/tests/elementary/meson.build index b1bf27e97e..4821f3bbe3 100644 --- a/src/tests/elementary/meson.build +++ b/src/tests/elementary/meson.build @@ -122,6 +122,7 @@ efl_ui_suite_src = [ 'elm_test_init.c', 'efl_ui_test_atspi.c', 'efl_ui_test_grid.c', + 'efl_ui_test_image_zoomable.c', ] efl_ui_suite = executable('efl_ui_suite',