cedric pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=08212c3c4b254ba8744591299237d530254bebee

commit 08212c3c4b254ba8744591299237d530254bebee
Author: Cedric BAIL <ced...@osg.samsung.com>
Date:   Tue Feb 2 10:39:41 2016 -0800

    eo: fix tests to actually account for callback,add and del signal to be 
@hot.
    
    This example of code is a perfect demonstration of why we should have make
    this events @hot from the beginning. As you can see, we ended up being 
unable
    to detect reliably callback being registered and unregistered. Leading to an
    negative accounting of callback being unregistered, making this signal 
unusable
    in any scenario.
---
 src/tests/eo/signals/signals_main.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/src/tests/eo/signals/signals_main.c 
b/src/tests/eo/signals/signals_main.c
index 39d8e98..aadc34f 100644
--- a/src/tests/eo/signals/signals_main.c
+++ b/src/tests/eo/signals/signals_main.c
@@ -91,7 +91,7 @@ main(int argc, char *argv[])
    fail_if(fcount != 2);
 
    eo_do(obj, eo_event_callback_priority_add(EV_A_CHANGED, 
EO_CALLBACK_PRIORITY_BEFORE, _a_changed_cb, (void *) 2));
-   fail_if(pd->cb_count != 1);
+   fail_if(pd->cb_count != 2);
 
    eo_do(obj, simple_a_set(2));
    fail_if(cb_count != 0);
@@ -122,9 +122,9 @@ main(int argc, char *argv[])
    fail_if(fcount != 0);
 
    eo_do(obj, eo_event_callback_del(EV_A_CHANGED, _a_changed_cb, (void *) 1));
-   fail_if(pd->cb_count != 0);
+   fail_if(pd->cb_count != 1);
    eo_do(obj, eo_event_callback_del(EV_A_CHANGED, _a_changed_cb, (void *) 2));
-   fail_if(pd->cb_count != -1);
+   fail_if(pd->cb_count != 0);
 
    /* Global Freeze/thaw. */
    fcount = 0;
@@ -145,7 +145,7 @@ main(int argc, char *argv[])
    fail_if(fcount != 2);
 
    eo_do(obj, eo_event_callback_priority_add(EV_A_CHANGED, 
EO_CALLBACK_PRIORITY_BEFORE, _a_changed_cb, (void *) 2));
-   fail_if(pd->cb_count != 1);
+   fail_if(pd->cb_count != 2);
 
    eo_do(obj, simple_a_set(2));
    fail_if(cb_count != 0);
@@ -180,4 +180,3 @@ main(int argc, char *argv[])
    eo_shutdown();
    return 0;
 }
-

-- 


Reply via email to