9 #include "../eunit_tests.h"
11 static int cb_called = EINA_FALSE;
14 _a_changed_cb(void *data, Eo *obj, const Eo_Event_Description *desc, void *event_info)
18 int new_a = *((int *) event_info);
19 printf("%s event_info:'%d' data:'%s'\n", __func__, new_a, (const char *) data);
21 cb_called = EINA_TRUE;
23 return EO_CALLBACK_CONTINUE;
27 main(int argc, char *argv[])
33 Eo *obj = eo_add(COMP_CLASS, NULL);
34 eo_do(obj, eo_event_callback_add(EV_A_CHANGED, _a_changed_cb, NULL));
37 eo_do(obj, simple_a_set(1));
40 eo_do(obj, simple_a_get(&a));
43 /* disable the callback forwarder, and fail if it's still called. */
45 eo_do(obj, eo_base_data_get("simple-obj", (void **) &simple));
47 eo_do(simple, eo_event_callback_forwarder_del(EV_A_CHANGED, obj));
49 cb_called = EINA_FALSE;
50 eo_do(obj, simple_a_set(2));
53 fail_if(!eo_composite_is(simple));
54 eo_composite_detach(simple, obj);
55 fail_if(eo_composite_is(simple));
56 eo_composite_attach(simple, obj);
57 fail_if(!eo_composite_is(simple));