hermet pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=882e4cd50f6c0c9d4b7c2825ba66cff42d1d476d

commit 882e4cd50f6c0c9d4b7c2825ba66cff42d1d476d
Author: Mike Blumenkrantz <zm...@samsung.com>
Date:   Fri May 8 10:45:27 2020 +0900

    tests/elm: add callback testing to image memfile test
    
    Summary:
    verify that ready is called (preload done) and error is not called
    
    ref D11758
    
    Reviewers: Hermet, jsuya, kimcinoo
    
    Reviewed By: Hermet
    
    Subscribers: stefan_schmidt, cedric, #reviewers, #committers
    
    Tags: #efl
    
    Differential Revision: https://phab.enlightenment.org/D11760
---
 src/tests/elementary/elm_test_image.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/src/tests/elementary/elm_test_image.c 
b/src/tests/elementary/elm_test_image.c
index 888069f2b7..25aac89a42 100644
--- a/src/tests/elementary/elm_test_image.c
+++ b/src/tests/elementary/elm_test_image.c
@@ -257,10 +257,11 @@ EFL_END_TEST
 
 EFL_START_TEST(elm_image_test_memfile_set)
 {
-   Evas_Object *win, *image;
+   Evas_Object *win, *image, *image2;
    char *mem;
    int size;
    const char *file = NULL;
+   int error_called = 0;
 
    win = win_add(NULL, "image", ELM_WIN_BASIC);
 
@@ -274,6 +275,15 @@ EFL_START_TEST(elm_image_test_memfile_set)
    ck_assert(elm_image_file_set(image, 
ELM_IMAGE_DATA_DIR"/images/icon_01.png", NULL));
    elm_image_file_get(image, &file, NULL);
    ck_assert_str_eq(file, ELM_IMAGE_DATA_DIR"/images/icon_01.png");
+
+   image2 = elm_image_add(win);
+   evas_object_smart_callback_add(image2, "load,ready", 
event_callback_that_quits_the_main_loop_when_called, NULL);
+   evas_object_smart_callback_add(image2, "load,error", 
event_callback_single_call_int_data, &error_called);
+   ck_assert(elm_image_memfile_set(image2, mem, size, "png", NULL));
+   ck_assert_int_eq(error_called, 0);
+   ecore_main_loop_begin();
+
+   ck_assert_int_eq(error_called, 0);
 }
 EFL_END_TEST
 

-- 


Reply via email to