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.
This commit is contained in:
parent
0ae951e544
commit
08212c3c4b
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue