summaryrefslogtreecommitdiff
path: root/src/tests/eo/composite_objects
diff options
context:
space:
mode:
Diffstat (limited to 'src/tests/eo/composite_objects')
-rw-r--r--src/tests/eo/composite_objects/composite_objects_comp.c14
-rw-r--r--src/tests/eo/composite_objects/composite_objects_main.c34
-rw-r--r--src/tests/eo/composite_objects/composite_objects_simple.c2
3 files changed, 25 insertions, 25 deletions
diff --git a/src/tests/eo/composite_objects/composite_objects_comp.c b/src/tests/eo/composite_objects/composite_objects_comp.c
index 32116c9..59ab956 100644
--- a/src/tests/eo/composite_objects/composite_objects_comp.c
+++ b/src/tests/eo/composite_objects/composite_objects_comp.c
@@ -16,7 +16,7 @@ static int
16_a_get(Eo *obj, void *class_data EINA_UNUSED) 16_a_get(Eo *obj, void *class_data EINA_UNUSED)
17{ 17{
18 int a = 0; 18 int a = 0;
19 eo_do_super(obj, MY_CLASS, a = simple_a_get()); 19 a = simple_a_get(eo_super(obj, MY_CLASS));
20 20
21 return a; 21 return a;
22} 22}
@@ -25,16 +25,16 @@ static Eo *
25_constructor(Eo *obj, void *class_data EINA_UNUSED) 25_constructor(Eo *obj, void *class_data EINA_UNUSED)
26{ 26{
27 Eina_Bool tmp; 27 Eina_Bool tmp;
28 obj = eo_do_super_ret(obj, MY_CLASS, obj, eo_constructor()); 28 obj = eo_constructor(eo_super(obj, MY_CLASS));
29 29
30 Eo *simple = eo_add(SIMPLE_CLASS, obj); 30 Eo *simple = eo_add(SIMPLE_CLASS, obj);
31 eo_do(obj, eo_composite_attach(simple)); 31 eo_composite_attach(obj, simple);
32 eo_do(simple, eo_event_callback_forwarder_add(EV_A_CHANGED, obj)); 32 eo_event_callback_forwarder_add(simple, EV_A_CHANGED, obj);
33 33
34 fail_if(eo_do_ret(obj, tmp, eo_composite_part_is())); 34 fail_if(eo_composite_part_is(obj));
35 fail_if(!eo_do_ret(simple, tmp, eo_composite_part_is())); 35 fail_if(!eo_composite_part_is(simple));
36 36
37 eo_do(obj, eo_key_data_set("simple-obj", simple)); 37 eo_key_data_set(obj, "simple-obj", simple);
38 38
39 return obj; 39 return obj;
40} 40}
diff --git a/src/tests/eo/composite_objects/composite_objects_main.c b/src/tests/eo/composite_objects/composite_objects_main.c
index 5ad11c6..9e90eb4 100644
--- a/src/tests/eo/composite_objects/composite_objects_main.c
+++ b/src/tests/eo/composite_objects/composite_objects_main.c
@@ -32,49 +32,49 @@ main(int argc, char *argv[])
32 eo_init(); 32 eo_init();
33 33
34 Eo *obj = eo_add(COMP_CLASS, NULL); 34 Eo *obj = eo_add(COMP_CLASS, NULL);
35 eo_do(obj, eo_event_callback_add(EV_A_CHANGED, _a_changed_cb, NULL)); 35 eo_event_callback_add(obj, EV_A_CHANGED, _a_changed_cb, NULL);
36 36
37 fail_if(!eo_isa(obj, COMP_CLASS)); 37 fail_if(!eo_isa(obj, COMP_CLASS));
38 fail_if(!eo_isa(obj, SIMPLE_CLASS)); 38 fail_if(!eo_isa(obj, SIMPLE_CLASS));
39 39
40 int a = 0; 40 int a = 0;
41 cb_called = EINA_FALSE; 41 cb_called = EINA_FALSE;
42 eo_do(obj, simple_a_set(1)); 42 simple_a_set(obj, 1);
43 fail_if(!cb_called); 43 fail_if(!cb_called);
44 44
45 /* Test functions from all across the chain. */ 45 /* Test functions from all across the chain. */
46 cb_called = EINA_FALSE; 46 cb_called = EINA_FALSE;
47 eo_do(obj, simple_a_set1(1)); 47 simple_a_set1(obj, 1);
48 fail_if(!cb_called); 48 fail_if(!cb_called);
49 cb_called = EINA_FALSE; 49 cb_called = EINA_FALSE;
50 eo_do(obj, simple_a_set15(1)); 50 simple_a_set15(obj, 1);
51 fail_if(!cb_called); 51 fail_if(!cb_called);
52 cb_called = EINA_FALSE; 52 cb_called = EINA_FALSE;
53 eo_do(obj, simple_a_set32(1)); 53 simple_a_set32(obj, 1);
54 fail_if(!cb_called); 54 fail_if(!cb_called);
55 55
56 eo_do(obj, a = simple_a_get()); 56 a = simple_a_get(obj);
57 fail_if(a != 1); 57 fail_if(a != 1);
58 58
59 /* disable the callback forwarder, and fail if it's still called. */ 59 /* disable the callback forwarder, and fail if it's still called. */
60 Eo *simple = NULL; 60 Eo *simple = NULL;
61 eo_do(obj, simple = eo_key_data_get("simple-obj")); 61 simple = eo_key_data_get(obj, "simple-obj");
62 eo_ref(simple); 62 eo_ref(simple);
63 eo_do(simple, eo_event_callback_forwarder_del(EV_A_CHANGED, obj)); 63 eo_event_callback_forwarder_del(simple, EV_A_CHANGED, obj);
64 64
65 cb_called = EINA_FALSE; 65 cb_called = EINA_FALSE;
66 eo_do(obj, simple_a_set(2)); 66 simple_a_set(obj, 2);
67 fail_if(cb_called); 67 fail_if(cb_called);
68 68
69 fail_if(!eo_do_ret(simple, tmp,eo_composite_part_is())); 69 fail_if(!eo_composite_part_is(simple));
70 fail_if(!eo_do_ret(obj, tmp,eo_composite_detach(simple))); 70 fail_if(!eo_composite_detach(obj, simple));
71 fail_if(eo_do_ret(obj, tmp,eo_composite_detach(simple))); 71 fail_if(eo_composite_detach(obj, simple));
72 fail_if(eo_do_ret(simple, tmp,eo_composite_part_is())); 72 fail_if(eo_composite_part_is(simple));
73 fail_if(!eo_do_ret(obj, tmp,eo_composite_attach(simple))); 73 fail_if(!eo_composite_attach(obj, simple));
74 fail_if(!eo_do_ret(simple, tmp,eo_composite_part_is())); 74 fail_if(!eo_composite_part_is(simple));
75 fail_if(eo_do_ret(obj, tmp,eo_composite_attach(simple))); 75 fail_if(eo_composite_attach(obj, simple));
76 76
77 fail_if(eo_do_ret(simple, tmp,eo_composite_attach(obj))); 77 fail_if(eo_composite_attach(simple, obj));
78 78
79 eo_unref(simple); 79 eo_unref(simple);
80 eo_unref(obj); 80 eo_unref(obj);
diff --git a/src/tests/eo/composite_objects/composite_objects_simple.c b/src/tests/eo/composite_objects/composite_objects_simple.c
index b9c906e..5c64cc0 100644
--- a/src/tests/eo/composite_objects/composite_objects_simple.c
+++ b/src/tests/eo/composite_objects/composite_objects_simple.c
@@ -17,7 +17,7 @@ _a_set(Eo *obj, void *class_data, int a)
17 printf("%s %d\n", eo_class_name_get(MY_CLASS), a); 17 printf("%s %d\n", eo_class_name_get(MY_CLASS), a);
18 pd->a = a; 18 pd->a = a;
19 19
20 eo_do(obj, eo_event_callback_call(EV_A_CHANGED, &pd->a)); 20 eo_event_callback_call(obj, EV_A_CHANGED, &pd->a);
21} 21}
22 22
23static int 23static int