stefan pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=2137154d2a7d5aed1cebf4ee7cbf198280f718d9

commit 2137154d2a7d5aed1cebf4ee7cbf198280f718d9
Author: Mike Blumenkrantz <[email protected]>
Date:   Tue Jan 29 12:56:32 2019 -0500

    tests: move efl_ui_image test -> efl_ui_suite
    
    ref T6815
    
    Reviewed-by: Stefan Schmidt <[email protected]>
    Differential Revision: https://phab.enlightenment.org/D7825
---
 src/Makefile_Elementary.am               |  3 ++-
 src/tests/elementary/efl_ui_suite.c      |  1 +
 src/tests/elementary/efl_ui_suite.h      |  1 +
 src/tests/elementary/efl_ui_test_image.c | 36 ++++++++++++++++++++++++++++++++
 src/tests/elementary/meson.build         |  1 +
 5 files changed, 41 insertions(+), 1 deletion(-)

diff --git a/src/Makefile_Elementary.am b/src/Makefile_Elementary.am
index da52460707..f634210e73 100644
--- a/src/Makefile_Elementary.am
+++ b/src/Makefile_Elementary.am
@@ -1609,8 +1609,9 @@ 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_test_image.c \
+       tests/elementary/efl_ui_test_image_zoomable.c \
        tests/elementary/efl_ui_test_layout.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 b98df8a03a..ba7d7ce131 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", efl_ui_test_image},
   { "efl_ui_image_zoomable", efl_ui_test_image_zoomable},
   { "efl_ui_layout", efl_ui_test_layout},
   { NULL, NULL }
diff --git a/src/tests/elementary/efl_ui_suite.h 
b/src/tests/elementary/efl_ui_suite.h
index 35cd13f845..f44d35cb54 100644
--- a/src/tests/elementary/efl_ui_suite.h
+++ b/src/tests/elementary/efl_ui_suite.h
@@ -20,6 +20,7 @@ void efl_ui_test_grid(TCase *tc);
 void efl_ui_test_atspi(TCase *tc);
 void efl_ui_test_image_zoomable(TCase *tc);
 void efl_ui_test_layout(TCase *tc);
+void efl_ui_test_image(TCase *tc);
 
 Eo *win_add();
 Eo *win_add_focused();
diff --git a/src/tests/elementary/efl_ui_test_image.c 
b/src/tests/elementary/efl_ui_test_image.c
new file mode 100644
index 0000000000..6c5e9f8bb5
--- /dev/null
+++ b/src/tests/elementary/efl_ui_test_image.c
@@ -0,0 +1,36 @@
+#define EFL_NOLEGACY_API_SUPPORT
+#ifdef HAVE_CONFIG_H
+# include "elementary_config.h"
+#endif
+
+#include <Efl_Ui.h>
+#include "efl_ui_suite.h"
+
+
+EFL_START_TEST(efl_ui_image_test_icon)
+{
+   Eo *win, *image;
+   Eina_Bool ok;
+   const char *icon_name;
+
+   win = win_add(NULL, "image", EFL_UI_WIN_BASIC);
+
+   image = efl_add(EFL_UI_IMAGE_CLASS, win);
+   efl_gfx_entity_visible_set(image, EINA_TRUE);
+
+   ok = efl_ui_image_icon_set(image, "folder");
+   ck_assert(ok);
+   icon_name = efl_ui_image_icon_get(image);
+   ck_assert_str_eq(icon_name, "folder");
+
+   ok = efl_ui_image_icon_set(image, "None");
+   ck_assert(ok == 0);
+   icon_name = efl_ui_image_icon_get(image);
+   ck_assert(icon_name == NULL);
+}
+EFL_END_TEST
+
+void efl_ui_test_image(TCase *tc)
+{
+   tcase_add_test(tc, efl_ui_image_test_icon);
+}
diff --git a/src/tests/elementary/meson.build b/src/tests/elementary/meson.build
index 097590ef05..fda9355d35 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.c',
   'efl_ui_test_image_zoomable.c',
   'efl_ui_test_layout.c',
 ]

-- 


Reply via email to