From: Cedric BAIL Date: Thu, 20 Dec 2018 19:30:58 +0000 (-0800) Subject: eo: test that event cancel before emitting does propagate event. X-Git-Tag: accepted/tizen/unified/20190107.065404~13 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=685f126b20d53406b4a3b5ea4ae764d14e9968f7;p=platform%2Fupstream%2Fefl.git eo: test that event cancel before emitting does propagate event. Reviewed-by: Marcel Hollerbach Differential Revision: https://phab.enlightenment.org/D7496 --- diff --git a/src/tests/eo/signals/signals_main.c b/src/tests/eo/signals/signals_main.c index 3639ff1..58b9eda 100644 --- a/src/tests/eo/signals/signals_main.c +++ b/src/tests/eo/signals/signals_main.c @@ -58,6 +58,22 @@ _restart_2_cb(void *data, const Efl_Event *event) efl_event_callback_stop(event->object); } +static void +_restart_3_cb(void *data, const Efl_Event *event) +{ + fprintf(stderr, "restart 3 inside: %i\n", inside); + fail_if(!inside); + + fprintf(stderr, "restart 3 exit inside: %i (%i)\n", inside, called); + efl_event_callback_stop(event->object); + + inside = EINA_TRUE; + efl_event_callback_call(event->object, event->desc, data); + inside = EINA_FALSE; + + called++; +} + int main(int argc, char *argv[]) { @@ -198,10 +214,11 @@ main(int argc, char *argv[]) fail_if(fcount != 0); efl_event_callback_priority_add(obj, EV_RESTART, EFL_CALLBACK_PRIORITY_DEFAULT, _restart_1_cb, NULL); + efl_event_callback_priority_add(obj, EV_RESTART, EFL_CALLBACK_PRIORITY_BEFORE, _restart_3_cb, NULL); efl_event_callback_priority_add(obj, EV_RESTART, EFL_CALLBACK_PRIORITY_BEFORE, _restart_2_cb, NULL); efl_event_callback_legacy_call(obj, EV_RESTART, NULL); fail_if(inside); - fail_if(called != 2); + fail_if(called != 3); efl_unref(obj); efl_object_shutdown();