From 46885653bc0467f88042bb110fdc973b2258f69c Mon Sep 17 00:00:00 2001 From: Marcel Hollerbach Date: Sun, 10 Feb 2019 16:57:00 +0100 Subject: [PATCH] eo: remove class functions from eo As in the previous commit explained, we want to get rid of class functions in eo, and make them just c functions right away. This commit removes the class parameter from the eo_class_function_set call, and adjusts the tests to not depend on class functions anymore. Class functions are now not tested anymore, tests that used them as a way to test *things* are adjusted to test them now with object functions, tests that just tested the working of class functions are dropped. This fixes T7675. Reviewed-by: Cedric BAIL Differential Revision: https://phab.enlightenment.org/D7902 --- src/benchmarks/eo/class_simple.c | 2 +- src/benchmarks/eo/eo_bench_eo_do.c | 2 +- src/bin/eolian/sources.c | 2 +- src/lib/elementary/efl_ui_table.c | 4 +-- src/lib/elementary/elc_combobox.c | 2 +- src/lib/eo/Eo.h | 2 +- src/lib/eo/eo.c | 11 +++---- src/tests/eo/access/access_inherit.c | 2 +- src/tests/eo/access/access_simple.c | 2 +- .../composite_objects_comp.c | 2 +- .../composite_objects_simple.c | 2 +- .../eo/constructors/constructors_mixin.c | 2 +- .../eo/constructors/constructors_simple.c | 2 +- .../eo/constructors/constructors_simple2.c | 2 +- .../eo/constructors/constructors_simple3.c | 2 +- .../eo/constructors/constructors_simple5.c | 2 +- .../eo/constructors/constructors_simple6.c | 2 +- .../eo/constructors/constructors_simple7.c | 2 +- .../function_overrides_inherit2.c | 19 +----------- .../function_overrides_inherit3.c | 2 +- .../function_overrides_simple.c | 2 +- src/tests/eo/interface/interface_interface.c | 2 +- src/tests/eo/interface/interface_interface2.c | 2 +- src/tests/eo/interface/interface_simple.c | 2 +- src/tests/eo/mixin/mixin_inherit.c | 2 +- src/tests/eo/mixin/mixin_mixin.c | 2 +- src/tests/eo/mixin/mixin_mixin2.c | 2 +- src/tests/eo/mixin/mixin_mixin3.c | 2 +- src/tests/eo/mixin/mixin_simple.c | 2 +- src/tests/eo/signals/signals_simple.c | 2 +- src/tests/eo/suite/eo_test_call_errors.c | 2 +- .../eo/suite/eo_test_class_behaviour_errors.c | 2 +- src/tests/eo/suite/eo_test_class_errors.c | 6 ++-- src/tests/eo/suite/eo_test_class_simple.c | 31 +++---------------- src/tests/eo/suite/eo_test_class_simple.h | 2 -- src/tests/eo/suite/eo_test_class_singleton.c | 2 +- src/tests/eo/suite/eo_test_domain.c | 2 +- src/tests/eo/suite/eo_test_general.c | 24 ++++++++++---- src/tests/eo/suite/eo_test_init.c | 7 +++-- src/tests/eo/suite/eo_test_threaded_calls.c | 2 +- src/tests/eolian/data/class_simple_ref.c | 2 +- .../eolian/data/function_as_argument_ref.c | 2 +- src/tests/eolian/data/override_ref.c | 2 +- src/tests/eolian/data/owning.eo.c | 2 +- 44 files changed, 72 insertions(+), 104 deletions(-) diff --git a/src/benchmarks/eo/class_simple.c b/src/benchmarks/eo/class_simple.c index 3d153cea32..63378d6033 100644 --- a/src/benchmarks/eo/class_simple.c +++ b/src/benchmarks/eo/class_simple.c @@ -38,7 +38,7 @@ _class_initializer(Efl_Class *klass) EFL_OBJECT_OP_FUNC(simple_other_call, _other_call), ); - return efl_class_functions_set(klass, &ops, NULL, NULL); + return efl_class_functions_set(klass, &ops, NULL); } static const Efl_Class_Description class_desc = { diff --git a/src/benchmarks/eo/eo_bench_eo_do.c b/src/benchmarks/eo/eo_bench_eo_do.c index cb95185fb8..2783b91b3c 100644 --- a/src/benchmarks/eo/eo_bench_eo_do.c +++ b/src/benchmarks/eo/eo_bench_eo_do.c @@ -65,7 +65,7 @@ _class_initializer(Efl_Class *klass) EFL_OBJECT_OP_FUNC(simple_a_set, _a_set), ); - return efl_class_functions_set(klass, &ops, NULL, NULL); + return efl_class_functions_set(klass, &ops, NULL); } static void diff --git a/src/bin/eolian/sources.c b/src/bin/eolian/sources.c index 493ec1ad40..76f8c64725 100644 --- a/src/bin/eolian/sources.c +++ b/src/bin/eolian/sources.c @@ -907,7 +907,7 @@ _gen_initializer(const Eolian_Class *cl, Eina_Strbuf *buf) eina_strbuf_append(buf, "#endif\n\n"); } - eina_strbuf_append(buf, " return efl_class_functions_set(klass, opsp, NULL, NULL);\n"); + eina_strbuf_append(buf, " return efl_class_functions_set(klass, opsp, NULL);\n"); eina_strbuf_free(ops); diff --git a/src/lib/elementary/efl_ui_table.c b/src/lib/elementary/efl_ui_table.c index 78b17a7f81..3a90eb0655 100644 --- a/src/lib/elementary/efl_ui_table.c +++ b/src/lib/elementary/efl_ui_table.c @@ -83,11 +83,11 @@ static void _custom_table_calc(Eo *obj, Custom_Table_Data *pd); static Eina_Bool _custom_table_initializer(Efl_Class *klass) { - EFL_OPS_DEFINE(class_ops, + EFL_OPS_DEFINE(ops, EFL_OBJECT_OP_FUNC(efl_canvas_group_calculate, _custom_table_calc) ); - return efl_class_functions_set(klass, NULL, &class_ops, NULL); + return efl_class_functions_set(klass, &ops, NULL); }; static const Efl_Class_Description custom_table_class_desc = { diff --git a/src/lib/elementary/elc_combobox.c b/src/lib/elementary/elc_combobox.c index 6ca7675a16..2b231aa0c4 100644 --- a/src/lib/elementary/elc_combobox.c +++ b/src/lib/elementary/elc_combobox.c @@ -616,7 +616,7 @@ _elm_combobox_class_initializer(Efl_Class *klass) EFL_CANVAS_GROUP_ADD_DEL_OPS(elm_combobox) ); - return efl_class_functions_set(klass, &ops, NULL, NULL); + return efl_class_functions_set(klass, &ops, NULL); } static const Efl_Class_Description _elm_combobox_class_desc = { diff --git a/src/lib/eo/Eo.h b/src/lib/eo/Eo.h index 2fd2c1b7e8..df5dc338e0 100644 --- a/src/lib/eo/Eo.h +++ b/src/lib/eo/Eo.h @@ -897,7 +897,7 @@ EAPI const Efl_Class *efl_class_new(const Efl_Class_Description *desc, const Efl * efl_property_reflection_set() or efl_property_reflection_get() is called. * @see #EFL_DEFINE_CLASS */ -EAPI Eina_Bool efl_class_functions_set(const Efl_Class *klass_id, const Efl_Object_Ops *object_ops, const Efl_Object_Ops *class_ops, const Efl_Object_Property_Reflection_Ops *reflection_table); +EAPI Eina_Bool efl_class_functions_set(const Efl_Class *klass_id, const Efl_Object_Ops *object_ops, const Efl_Object_Property_Reflection_Ops *reflection_table); /** * @brief Override Eo functions of this object. diff --git a/src/lib/eo/eo.c b/src/lib/eo/eo.c index 95823f7a08..0611643546 100644 --- a/src/lib/eo/eo.c +++ b/src/lib/eo/eo.c @@ -819,7 +819,7 @@ _eo_class_funcs_set(Eo_Vtable *vtable, const Efl_Object_Ops *ops, const _Efl_Cla } EAPI Eina_Bool -efl_class_functions_set(const Efl_Class *klass_id, const Efl_Object_Ops *object_ops, const Efl_Object_Ops *class_ops, const Efl_Object_Property_Reflection_Ops *reflection_table) +efl_class_functions_set(const Efl_Class *klass_id, const Efl_Object_Ops *object_ops, const Efl_Object_Property_Reflection_Ops *reflection_table) { EO_CLASS_POINTER_GOTO(klass_id, klass, err_klass); Efl_Object_Ops empty_ops = { 0 }; @@ -830,11 +830,9 @@ efl_class_functions_set(const Efl_Class *klass_id, const Efl_Object_Ops *object_ if (!object_ops) object_ops = &empty_ops; - if (!class_ops) class_ops = &empty_ops; - klass->reflection = reflection_table; - klass->ops_count = object_ops->count + class_ops->count; + klass->ops_count = object_ops->count; klass->base_id = _eo_ops_last_id; _eo_ops_last_id += klass->ops_count + 1; @@ -851,8 +849,7 @@ efl_class_functions_set(const Efl_Class *klass_id, const Efl_Object_Ops *object_ _vtable_copy_all(&klass->vtable, &(*mro_itr)->vtable); } - return _eo_class_funcs_set(&klass->vtable, object_ops, klass, klass, 0, EINA_FALSE) && - _eo_class_funcs_set(&klass->vtable, class_ops, klass, klass, object_ops->count, EINA_FALSE); + return _eo_class_funcs_set(&klass->vtable, object_ops, klass, klass, 0, EINA_FALSE); err_funcs: ERR("Class %s already had its functions set..", klass->desc->name); @@ -1693,7 +1690,7 @@ efl_class_new(const Efl_Class_Description *desc, const Efl_Class *parent_id, ... /* If functions haven't been set, invoke it with an empty ops structure. */ if (!klass->functions_set) { - efl_class_functions_set(_eo_class_id_get(klass), NULL, NULL, NULL); + efl_class_functions_set(_eo_class_id_get(klass), NULL, NULL); } /* Mark which classes we implement */ diff --git a/src/tests/eo/access/access_inherit.c b/src/tests/eo/access/access_inherit.c index a77e3b4b8c..2f830bde8a 100644 --- a/src/tests/eo/access/access_inherit.c +++ b/src/tests/eo/access/access_inherit.c @@ -25,7 +25,7 @@ _class_initializer(Efl_Class *klass) EFL_OBJECT_OP_FUNC(inherit_prot_print, _prot_print), ); - return efl_class_functions_set(klass, &ops, NULL, NULL); + return efl_class_functions_set(klass, &ops, NULL); } static const Efl_Class_Description class_desc = { diff --git a/src/tests/eo/access/access_simple.c b/src/tests/eo/access/access_simple.c index 0ea01dbc97..5b75d0c52b 100644 --- a/src/tests/eo/access/access_simple.c +++ b/src/tests/eo/access/access_simple.c @@ -39,7 +39,7 @@ _class_initializer(Efl_Class *klass) EFL_OBJECT_OP_FUNC(simple_a_set, _a_set), ); - return efl_class_functions_set(klass, &ops, NULL, NULL); + return efl_class_functions_set(klass, &ops, NULL); } static const Efl_Class_Description class_desc = { diff --git a/src/tests/eo/composite_objects/composite_objects_comp.c b/src/tests/eo/composite_objects/composite_objects_comp.c index 7d6fbe4c1a..b0b271ded1 100644 --- a/src/tests/eo/composite_objects/composite_objects_comp.c +++ b/src/tests/eo/composite_objects/composite_objects_comp.c @@ -44,7 +44,7 @@ _class_initializer(Efl_Class *klass) EFL_OBJECT_OP_FUNC(simple_a_get, _a_get), ); - return efl_class_functions_set(klass, &ops, NULL, NULL); + return efl_class_functions_set(klass, &ops, NULL); } static const Efl_Class_Description class_desc = { diff --git a/src/tests/eo/composite_objects/composite_objects_simple.c b/src/tests/eo/composite_objects/composite_objects_simple.c index c2626ec530..b9bc70fb78 100644 --- a/src/tests/eo/composite_objects/composite_objects_simple.c +++ b/src/tests/eo/composite_objects/composite_objects_simple.c @@ -172,7 +172,7 @@ _class_initializer(Efl_Class *klass) EFL_OBJECT_OP_FUNC(simple_a_get, _a_get), ); - return efl_class_functions_set(klass, &ops, NULL, NULL); + return efl_class_functions_set(klass, &ops, NULL); } static const Efl_Class_Description class_desc = { diff --git a/src/tests/eo/constructors/constructors_mixin.c b/src/tests/eo/constructors/constructors_mixin.c index 6257d9a609..c3cbdc50b1 100644 --- a/src/tests/eo/constructors/constructors_mixin.c +++ b/src/tests/eo/constructors/constructors_mixin.c @@ -46,7 +46,7 @@ _class_initializer(Efl_Class *klass) EFL_OBJECT_OP_FUNC(efl_destructor, _destructor), ); - return efl_class_functions_set(klass, &ops, NULL, NULL); + return efl_class_functions_set(klass, &ops, NULL); } static const Efl_Class_Description class_desc = { diff --git a/src/tests/eo/constructors/constructors_simple.c b/src/tests/eo/constructors/constructors_simple.c index 69ecb0d1d7..cdce5d1e33 100644 --- a/src/tests/eo/constructors/constructors_simple.c +++ b/src/tests/eo/constructors/constructors_simple.c @@ -98,7 +98,7 @@ _class_initializer(Efl_Class *klass) EFL_OBJECT_OP_FUNC(simple_b_get, _b_get), ); - return efl_class_functions_set(klass, &ops, NULL, NULL); + return efl_class_functions_set(klass, &ops, NULL); } static const Efl_Class_Description class_desc = { diff --git a/src/tests/eo/constructors/constructors_simple2.c b/src/tests/eo/constructors/constructors_simple2.c index 477de99e3c..71f8ae1335 100644 --- a/src/tests/eo/constructors/constructors_simple2.c +++ b/src/tests/eo/constructors/constructors_simple2.c @@ -23,7 +23,7 @@ _class_initializer(Efl_Class *klass) EFL_OBJECT_OP_FUNC(efl_constructor, _constructor), ); - return efl_class_functions_set(klass, &ops, NULL, NULL); + return efl_class_functions_set(klass, &ops, NULL); } static const Efl_Class_Description class_desc = { diff --git a/src/tests/eo/constructors/constructors_simple3.c b/src/tests/eo/constructors/constructors_simple3.c index 80cc34f36b..7bab6dafc4 100644 --- a/src/tests/eo/constructors/constructors_simple3.c +++ b/src/tests/eo/constructors/constructors_simple3.c @@ -21,7 +21,7 @@ _class_initializer(Efl_Class *klass) EFL_OBJECT_OP_FUNC(efl_constructor, _constructor), ); - return efl_class_functions_set(klass, &ops, NULL, NULL); + return efl_class_functions_set(klass, &ops, NULL); } static const Efl_Class_Description class_desc = { diff --git a/src/tests/eo/constructors/constructors_simple5.c b/src/tests/eo/constructors/constructors_simple5.c index abcb49261e..73bc8fe89c 100644 --- a/src/tests/eo/constructors/constructors_simple5.c +++ b/src/tests/eo/constructors/constructors_simple5.c @@ -21,7 +21,7 @@ _class_initializer(Efl_Class *klass) EFL_OBJECT_OP_FUNC(efl_destructor, _destructor), ); - return efl_class_functions_set(klass, &ops, NULL, NULL); + return efl_class_functions_set(klass, &ops, NULL); } static const Efl_Class_Description class_desc = { diff --git a/src/tests/eo/constructors/constructors_simple6.c b/src/tests/eo/constructors/constructors_simple6.c index 671679e341..021f1f988c 100644 --- a/src/tests/eo/constructors/constructors_simple6.c +++ b/src/tests/eo/constructors/constructors_simple6.c @@ -21,7 +21,7 @@ _class_initializer(Efl_Class *klass) EFL_OBJECT_OP_FUNC(efl_destructor, _destructor), ); - return efl_class_functions_set(klass, &ops, NULL, NULL); + return efl_class_functions_set(klass, &ops, NULL); } static const Efl_Class_Description class_desc = { diff --git a/src/tests/eo/constructors/constructors_simple7.c b/src/tests/eo/constructors/constructors_simple7.c index c81d849cf2..22c653729c 100644 --- a/src/tests/eo/constructors/constructors_simple7.c +++ b/src/tests/eo/constructors/constructors_simple7.c @@ -25,7 +25,7 @@ _class_initializer(Efl_Class *klass) EFL_OBJECT_OP_FUNC(efl_constructor, _constructor), ); - return efl_class_functions_set(klass, &ops, NULL, NULL); + return efl_class_functions_set(klass, &ops, NULL); } static const Efl_Class_Description class_desc = { diff --git a/src/tests/eo/function_overrides/function_overrides_inherit2.c b/src/tests/eo/function_overrides/function_overrides_inherit2.c index 7f6b304281..e4aa147b67 100644 --- a/src/tests/eo/function_overrides/function_overrides_inherit2.c +++ b/src/tests/eo/function_overrides/function_overrides_inherit2.c @@ -42,20 +42,6 @@ _print2(Eo *obj EINA_UNUSED, void *class_data EINA_UNUSED) return EINA_TRUE; } -static Eina_Bool -_class_print(Efl_Class *klass, void *data EINA_UNUSED) -{ - Eina_Bool called = EINA_FALSE; - printf("Print %s-%s\n", efl_class_name_get(klass), efl_class_name_get(MY_CLASS)); - called = simple_class_print(efl_super(klass, MY_CLASS)); - fail_if(!called); - - called = simple_class_print2(efl_super(klass, MY_CLASS)); - fail_if(!called); - - return EINA_TRUE; -} - EAPI EFL_FUNC_BODY(inherit2_print, Eina_Bool, EINA_FALSE); EAPI EFL_FUNC_BODY(inherit2_print2, Eina_Bool, EINA_FALSE); @@ -67,11 +53,8 @@ _class_initializer(Efl_Class *klass) EFL_OBJECT_OP_FUNC(inherit2_print2, _print2), EFL_OBJECT_OP_FUNC(simple_a_set, _a_set), ); - EFL_OPS_DEFINE(cops, - EFL_OBJECT_OP_FUNC(simple_class_print, _class_print), - ); - return efl_class_functions_set(klass, &ops, &cops, NULL); + return efl_class_functions_set(klass, &ops, NULL); } static const Efl_Class_Description class_desc = { diff --git a/src/tests/eo/function_overrides/function_overrides_inherit3.c b/src/tests/eo/function_overrides/function_overrides_inherit3.c index 54485e24ed..e3f34076d2 100644 --- a/src/tests/eo/function_overrides/function_overrides_inherit3.c +++ b/src/tests/eo/function_overrides/function_overrides_inherit3.c @@ -23,7 +23,7 @@ _class_initializer(Efl_Class *klass) EFL_OBJECT_OP_FUNC(simple_a_set, _a_set), ); - return efl_class_functions_set(klass, &ops, NULL, NULL); + return efl_class_functions_set(klass, &ops, NULL); } static const Efl_Class_Description class_desc = { diff --git a/src/tests/eo/function_overrides/function_overrides_simple.c b/src/tests/eo/function_overrides/function_overrides_simple.c index fd65f66f20..fbd5681367 100644 --- a/src/tests/eo/function_overrides/function_overrides_simple.c +++ b/src/tests/eo/function_overrides/function_overrides_simple.c @@ -66,7 +66,7 @@ _class_initializer(Efl_Class *klass) EFL_OBJECT_OP_FUNC(simple_class_print2, _class_print2), ); - return efl_class_functions_set(klass, &ops, NULL, NULL); + return efl_class_functions_set(klass, &ops, NULL); } static const Efl_Class_Description class_desc = { diff --git a/src/tests/eo/interface/interface_interface.c b/src/tests/eo/interface/interface_interface.c index 3fd8802ac4..dd5b293906 100644 --- a/src/tests/eo/interface/interface_interface.c +++ b/src/tests/eo/interface/interface_interface.c @@ -17,7 +17,7 @@ _class_initializer(Efl_Class *klass) EFL_OBJECT_OP_FUNC(interface_ab_sum_get, NULL), ); - return efl_class_functions_set(klass, &ops, NULL, NULL); + return efl_class_functions_set(klass, &ops, NULL); } static const Efl_Class_Description class_desc = { diff --git a/src/tests/eo/interface/interface_interface2.c b/src/tests/eo/interface/interface_interface2.c index c6e3d1b022..4b18105bba 100644 --- a/src/tests/eo/interface/interface_interface2.c +++ b/src/tests/eo/interface/interface_interface2.c @@ -18,7 +18,7 @@ _class_initializer(Efl_Class *klass) EFL_OBJECT_OP_FUNC(interface2_ab_sum_get2, NULL), ); - return efl_class_functions_set(klass, &ops, NULL, NULL); + return efl_class_functions_set(klass, &ops, NULL); } static const Efl_Class_Description class_desc = { diff --git a/src/tests/eo/interface/interface_simple.c b/src/tests/eo/interface/interface_simple.c index d960f835ba..0d20eea5fc 100644 --- a/src/tests/eo/interface/interface_simple.c +++ b/src/tests/eo/interface/interface_simple.c @@ -68,7 +68,7 @@ _class_initializer(Efl_Class *klass) EFL_OBJECT_OP_FUNC(interface2_ab_sum_get2, _ab_sum_get2), ); - return efl_class_functions_set(klass, &ops, NULL, NULL); + return efl_class_functions_set(klass, &ops, NULL); } static const Efl_Class_Description class_desc = { diff --git a/src/tests/eo/mixin/mixin_inherit.c b/src/tests/eo/mixin/mixin_inherit.c index 6d58143890..964fbe2527 100644 --- a/src/tests/eo/mixin/mixin_inherit.c +++ b/src/tests/eo/mixin/mixin_inherit.c @@ -26,7 +26,7 @@ _class_initializer(Efl_Class *klass) EFL_OBJECT_OP_FUNC(simple_a_get, _a_get), ); - return efl_class_functions_set(klass, &ops, NULL, NULL); + return efl_class_functions_set(klass, &ops, NULL); } static const Efl_Class_Description class_desc = { diff --git a/src/tests/eo/mixin/mixin_mixin.c b/src/tests/eo/mixin/mixin_mixin.c index 4e61c216bd..06bff56d2b 100644 --- a/src/tests/eo/mixin/mixin_mixin.c +++ b/src/tests/eo/mixin/mixin_mixin.c @@ -41,7 +41,7 @@ _class_initializer(Efl_Class *klass) EFL_OBJECT_OP_FUNC(mixin_ab_sum_get, _ab_sum_get), ); - return efl_class_functions_set(klass, &ops, NULL, NULL); + return efl_class_functions_set(klass, &ops, NULL); } static const Efl_Class_Description class_desc = { diff --git a/src/tests/eo/mixin/mixin_mixin2.c b/src/tests/eo/mixin/mixin_mixin2.c index 6b378c23c4..48ea26a1d6 100644 --- a/src/tests/eo/mixin/mixin_mixin2.c +++ b/src/tests/eo/mixin/mixin_mixin2.c @@ -55,7 +55,7 @@ _class_initializer(Efl_Class *klass) EFL_OBJECT_OP_FUNC(mixin_ab_sum_get, _ab_sum_get), ); - return efl_class_functions_set(klass, &ops, NULL, NULL); + return efl_class_functions_set(klass, &ops, NULL); } static const Efl_Class_Description class_desc = { diff --git a/src/tests/eo/mixin/mixin_mixin3.c b/src/tests/eo/mixin/mixin_mixin3.c index 9f4cedc28c..8036249b89 100644 --- a/src/tests/eo/mixin/mixin_mixin3.c +++ b/src/tests/eo/mixin/mixin_mixin3.c @@ -54,7 +54,7 @@ _class_initializer(Efl_Class *klass) EFL_OBJECT_OP_FUNC(mixin_ab_sum_get, _ab_sum_get), ); - return efl_class_functions_set(klass, &ops, NULL, NULL); + return efl_class_functions_set(klass, &ops, NULL); } static const Efl_Class_Description class_desc = { diff --git a/src/tests/eo/mixin/mixin_simple.c b/src/tests/eo/mixin/mixin_simple.c index 21060b2357..9bc843514c 100644 --- a/src/tests/eo/mixin/mixin_simple.c +++ b/src/tests/eo/mixin/mixin_simple.c @@ -47,7 +47,7 @@ _class_initializer(Efl_Class *klass) EFL_OBJECT_OP_FUNC(simple_b_get, _b_get), ); - return efl_class_functions_set(klass, &ops, NULL, NULL); + return efl_class_functions_set(klass, &ops, NULL); } static const Efl_Class_Description class_desc = { diff --git a/src/tests/eo/signals/signals_simple.c b/src/tests/eo/signals/signals_simple.c index ae158e3d8f..0e016dc550 100644 --- a/src/tests/eo/signals/signals_simple.c +++ b/src/tests/eo/signals/signals_simple.c @@ -79,7 +79,7 @@ _class_initializer(Efl_Class *klass) EFL_OBJECT_OP_FUNC(simple_a_set, _a_set), ); - return efl_class_functions_set(klass, &ops, NULL, NULL); + return efl_class_functions_set(klass, &ops, NULL); } static const Efl_Class_Description class_desc = { diff --git a/src/tests/eo/suite/eo_test_call_errors.c b/src/tests/eo/suite/eo_test_call_errors.c index 97a8e76ec3..5a737a415d 100644 --- a/src/tests/eo/suite/eo_test_call_errors.c +++ b/src/tests/eo/suite/eo_test_call_errors.c @@ -89,7 +89,7 @@ _errorcase_class_initializer(Efl_Class *klass) EFL_OBJECT_OP_FUNC(simple_error_test, _test), ); - return efl_class_functions_set(klass, &ops, NULL, NULL); + return efl_class_functions_set(klass, &ops, NULL); } static const Efl_Class_Description errorcase_class_desc = { diff --git a/src/tests/eo/suite/eo_test_class_behaviour_errors.c b/src/tests/eo/suite/eo_test_class_behaviour_errors.c index 0f670be592..02362257a5 100644 --- a/src/tests/eo/suite/eo_test_class_behaviour_errors.c +++ b/src/tests/eo/suite/eo_test_class_behaviour_errors.c @@ -29,7 +29,7 @@ _destructor_unref_class_initializer(Efl_Class *klass2) EFL_OBJECT_OP_FUNC(efl_destructor, _destructor_unref), ); - return efl_class_functions_set(klass2, &ops, NULL, NULL); + return efl_class_functions_set(klass2, &ops, NULL); } EFL_START_TEST(efl_destructor_unref) diff --git a/src/tests/eo/suite/eo_test_class_errors.c b/src/tests/eo/suite/eo_test_class_errors.c index d2dca6167e..a5052196c7 100644 --- a/src/tests/eo/suite/eo_test_class_errors.c +++ b/src/tests/eo/suite/eo_test_class_errors.c @@ -203,7 +203,7 @@ _null_class_initializer(Efl_Class *klass) EFL_OBJECT_OP_FUNC(NULL, _null_fct), ); - return efl_class_functions_set(klass, &ops, NULL, NULL); + return efl_class_functions_set(klass, &ops, NULL); } EFL_START_TEST(eo_null_api) @@ -240,7 +240,7 @@ _redefined_class_initializer(Efl_Class *klass) EFL_OBJECT_OP_FUNC(null_fct, NULL), ); - return efl_class_functions_set(klass, &ops, NULL, NULL); + return efl_class_functions_set(klass, &ops, NULL); } EFL_START_TEST(eo_api_redefined) @@ -277,7 +277,7 @@ _dich_func_class_initializer(Efl_Class *klass) EFL_OBJECT_OP_FUNC(simple_a_set, NULL), ); - return efl_class_functions_set(klass, &ops, NULL, NULL); + return efl_class_functions_set(klass, &ops, NULL); } EFL_START_TEST(eo_dich_func_override) diff --git a/src/tests/eo/suite/eo_test_class_simple.c b/src/tests/eo/suite/eo_test_class_simple.c index 8d82b1eb11..fef3dd3ae5 100644 --- a/src/tests/eo/suite/eo_test_class_simple.c +++ b/src/tests/eo/suite/eo_test_class_simple.c @@ -58,14 +58,6 @@ _a_print(Eo *obj EINA_UNUSED, void *class_data) return EINA_TRUE; } -static Eina_Bool -_class_hi_print(Efl_Class *klass, void *data EINA_UNUSED) -{ - printf("Hi Print %s\n", efl_class_name_get(klass)); - - return EINA_TRUE; -} - EFL_FUNC_BODYV(simple_part_get, Eo *, NULL, EFL_FUNC_CALL(name), const char *name); static Eo * @@ -102,7 +94,6 @@ _dbg_info_get(Eo *eo_obj, void *_pd EINA_UNUSED, Efl_Dbg_Info *root) EFL_VOID_FUNC_BODYV(simple_a_set, EFL_FUNC_CALL(a), int a); EFL_FUNC_BODY(simple_a_get, int, 0); EFL_FUNC_BODY(simple_a_print, Eina_Bool, EINA_FALSE); -EFL_FUNC_BODY_CONST(simple_class_hi_print, Eina_Bool, EINA_FALSE); EFL_VOID_FUNC_BODY(simple_pure_virtual); EFL_VOID_FUNC_BODY(simple_no_implementation); @@ -118,9 +109,6 @@ _class_initializer(Efl_Class *klass) EFL_OBJECT_OP_FUNC(simple_pure_virtual, NULL), EFL_OBJECT_OP_FUNC(efl_dbg_info_get, _dbg_info_get), ); - EFL_OPS_DEFINE(cops, - EFL_OBJECT_OP_FUNC(simple_class_hi_print, _class_hi_print), - ); static const Efl_Object_Property_Reflection reflection_table[] = { {"simple_a", _a_set_reflect, _a_get_reflect}, }; @@ -128,7 +116,7 @@ _class_initializer(Efl_Class *klass) reflection_table, EINA_C_ARRAY_LENGTH(reflection_table) }; - return efl_class_functions_set(klass, &ops, &cops, &ref_ops); + return efl_class_functions_set(klass, &ops, &ref_ops); } static const Efl_Class_Description class_desc = { @@ -142,24 +130,13 @@ static const Efl_Class_Description class_desc = { }; EFL_DEFINE_CLASS(simple_class_get, &class_desc, EO_CLASS, NULL) - - -static int -_beef_get(Eo *obj EINA_UNUSED, void *class_data EINA_UNUSED) -{ - return 0xBEEF; -} - EFL_FUNC_BODY_CONST(simple2_class_beef_get, int, 0); static Eina_Bool _class_initializer2(Efl_Class *klass) { - EFL_OPS_DEFINE(cops, - EFL_OBJECT_OP_FUNC(simple2_class_beef_get, _beef_get), - ); - return efl_class_functions_set(klass, NULL, &cops, NULL); + return efl_class_functions_set(klass, NULL, NULL); } static const Efl_Class_Description class_desc2 = { @@ -178,7 +155,7 @@ EFL_DEFINE_CLASS(simple2_class_get, &class_desc2, EO_CLASS, NULL) static Eina_Bool _class_initializer3(Efl_Class *klass) { - return efl_class_functions_set(klass, NULL, NULL, NULL); + return efl_class_functions_set(klass, NULL, NULL); } static const Efl_Class_Description class_desc3 = { @@ -209,7 +186,7 @@ _searchable_class_initializer(Efl_Class *klass) EFL_OBJECT_OP_FUNC(efl_provider_find, _interface_get) ); - return efl_class_functions_set(klass, &ops, NULL, NULL); + return efl_class_functions_set(klass, &ops, NULL); } static const Efl_Class_Description class_desc_searchable = { diff --git a/src/tests/eo/suite/eo_test_class_simple.h b/src/tests/eo/suite/eo_test_class_simple.h index 9023119577..57e6c8fe12 100644 --- a/src/tests/eo/suite/eo_test_class_simple.h +++ b/src/tests/eo/suite/eo_test_class_simple.h @@ -24,8 +24,6 @@ extern const Efl_Event_Description _EV_A_CHANGED2; #define SIMPLE_CLASS simple_class_get() const Efl_Class *simple_class_get(void); -EAPI int simple2_class_beef_get(const Efl_Class *obj); - #define SIMPLE2_CLASS simple2_class_get() const Efl_Class *simple2_class_get(void); diff --git a/src/tests/eo/suite/eo_test_class_singleton.c b/src/tests/eo/suite/eo_test_class_singleton.c index d8f325a1fd..a38a52b915 100644 --- a/src/tests/eo/suite/eo_test_class_singleton.c +++ b/src/tests/eo/suite/eo_test_class_singleton.c @@ -32,7 +32,7 @@ _class_initializer(Efl_Class *klass) EFL_OBJECT_OP_FUNC(efl_constructor, _singleton_efl_constructor), ); - return efl_class_functions_set(klass, &ops, NULL, NULL); + return efl_class_functions_set(klass, &ops, NULL); } static const Efl_Class_Description class_desc = { diff --git a/src/tests/eo/suite/eo_test_domain.c b/src/tests/eo/suite/eo_test_domain.c index 23af2202bd..114f57060d 100644 --- a/src/tests/eo/suite/eo_test_domain.c +++ b/src/tests/eo/suite/eo_test_domain.c @@ -64,7 +64,7 @@ _class_initializer(Efl_Class *klass) EFL_OBJECT_OP_FUNC(domain_a_get, _a_get), EFL_OBJECT_OP_FUNC(domain_recursive, _recursive) ); - return efl_class_functions_set(klass, &ops, NULL, NULL); + return efl_class_functions_set(klass, &ops, NULL); } static const Efl_Class_Description class_desc = { diff --git a/src/tests/eo/suite/eo_test_general.c b/src/tests/eo/suite/eo_test_general.c index b19bbc80bb..c483fc45be 100644 --- a/src/tests/eo/suite/eo_test_general.c +++ b/src/tests/eo/suite/eo_test_general.c @@ -66,6 +66,18 @@ _simple_obj_override_a_double_set(Eo *obj, void *class_data EINA_UNUSED, int a) simple_a_set(efl_super(obj, EFL_OBJECT_OVERRIDE_CLASS), 2 * a); } +EAPI int test_class_beef_get(const Efl_Object *obj); + +EFL_FUNC_BODY_CONST(test_class_beef_get, int, 0) + +static int +_simple_obj_override_beef_get(Eo *obj, void *class_data EINA_UNUSED) +{ + test_class_beef_get(efl_super(obj, EFL_OBJECT_OVERRIDE_CLASS)); + + return 1337; +} + EFL_START_TEST(efl_object_override_tests) { @@ -105,7 +117,7 @@ EFL_START_TEST(efl_object_override_tests) /* Try introducing a new function */ EFL_OPS_DEFINE( overrides3, - EFL_OBJECT_OP_FUNC(simple2_class_beef_get, _simple_obj_override_a_double_set)); + EFL_OBJECT_OP_FUNC(test_class_beef_get, _simple_obj_override_beef_get)); fail_if(efl_object_override(obj, &overrides3)); fail_if(!efl_object_override(obj, NULL)); fail_if(efl_object_override(obj, &overrides3)); @@ -472,7 +484,7 @@ _class_initializer(Efl_Class *klass) EFL_OBJECT_OP_FUNC(efl_destructor, _man_des), ); - return efl_class_functions_set(klass, &ops, NULL, NULL); + return efl_class_functions_set(klass, &ops, NULL); } EFL_START_TEST(eo_man_free) @@ -1049,7 +1061,7 @@ _multi_class_initializer(Efl_Class *klass) EFL_OBJECT_OP_FUNC(resolve_a_print, _a_print), ); - return efl_class_functions_set(klass, &ops, NULL, NULL); + return efl_class_functions_set(klass, &ops, NULL); } EFL_START_TEST(efl_func_resolve) @@ -1215,7 +1227,7 @@ _add_failures_class_initializer(Efl_Class *klass) EFL_OBJECT_OP_FUNC(efl_finalize, _efl_add_failures_finalize), ); - return efl_class_functions_set(klass, &ops, NULL, NULL); + return efl_class_functions_set(klass, &ops, NULL); } EFL_START_TEST(efl_add_failures) @@ -1628,14 +1640,14 @@ static Eina_Bool _cast_inherit_class_initializer_1(Efl_Class *klass) { EFL_OPS_DEFINE(ops, EFL_OBJECT_OP_FUNC(inherit_value, _inherit_value_1), ); - return efl_class_functions_set(klass, &ops, NULL, NULL); + return efl_class_functions_set(klass, &ops, NULL); } static Eina_Bool _cast_inherit_class_initializer_2(Efl_Class *klass) { EFL_OPS_DEFINE(ops, EFL_OBJECT_OP_FUNC(inherit_value, _inherit_value_2), ); - return efl_class_functions_set(klass, &ops, NULL, NULL); + return efl_class_functions_set(klass, &ops, NULL); } EFL_START_TEST(efl_cast_test) diff --git a/src/tests/eo/suite/eo_test_init.c b/src/tests/eo/suite/eo_test_init.c index cee49211e1..4cd2bf26c4 100644 --- a/src/tests/eo/suite/eo_test_init.c +++ b/src/tests/eo/suite/eo_test_init.c @@ -23,10 +23,9 @@ EFL_START_TEST(eo_test_init_shutdown) /* XXX-1: Essential for the next test to assign the wrong op. */ obj = efl_add_ref(SIMPLE_CLASS, NULL); simple_a_set(obj, 1); + /* XXX-1: Essential for the next test to cache the op. */ ck_assert_int_eq(1, simple_a_get(obj)); - /* XXX-1: Essential for the next test to cache the op. */ - ck_assert_int_eq(0xBEEF, simple2_class_beef_get(SIMPLE2_CLASS)); efl_unref(obj); fail_if(efl_object_shutdown()); @@ -34,7 +33,9 @@ EFL_START_TEST(eo_test_init_shutdown) ck_assert_str_eq("Efl.Object", efl_class_name_get(EFL_OBJECT_CLASS)); /* XXX-1: Verify that the op was not cached. */ - ck_assert_int_eq(0xBEEF, simple2_class_beef_get(SIMPLE2_CLASS)); + obj = efl_add_ref(SIMPLE_CLASS, NULL); + simple_a_set(obj, 1); + ck_assert_int_eq(1, simple_a_get(obj)); } EFL_END_TEST diff --git a/src/tests/eo/suite/eo_test_threaded_calls.c b/src/tests/eo/suite/eo_test_threaded_calls.c index df55e44150..411eb4536f 100644 --- a/src/tests/eo/suite/eo_test_threaded_calls.c +++ b/src/tests/eo/suite/eo_test_threaded_calls.c @@ -69,7 +69,7 @@ _class_initializer(Efl_Class *klass) EFL_OBJECT_OP_FUNC(thread_test_try_swap_stack, _try_swap_stack), ); - return efl_class_functions_set(klass, &ops, NULL, NULL); + return efl_class_functions_set(klass, &ops, NULL); } static const Efl_Class_Description class_desc = { diff --git a/src/tests/eolian/data/class_simple_ref.c b/src/tests/eolian/data/class_simple_ref.c index ba1e647ee9..431f083952 100644 --- a/src/tests/eolian/data/class_simple_ref.c +++ b/src/tests/eolian/data/class_simple_ref.c @@ -45,7 +45,7 @@ _class_simple_class_initializer(Efl_Class *klass) ); opsp = &ops; - return efl_class_functions_set(klass, opsp, NULL, NULL); + return efl_class_functions_set(klass, opsp, NULL); } static const Efl_Class_Description _class_simple_class_desc = { diff --git a/src/tests/eolian/data/function_as_argument_ref.c b/src/tests/eolian/data/function_as_argument_ref.c index 0728dd4299..edb394ed67 100644 --- a/src/tests/eolian/data/function_as_argument_ref.c +++ b/src/tests/eolian/data/function_as_argument_ref.c @@ -28,7 +28,7 @@ _function_as_argument_class_initializer(Efl_Class *klass) ); opsp = &ops; - return efl_class_functions_set(klass, opsp, NULL, NULL); + return efl_class_functions_set(klass, opsp, NULL); } static const Efl_Class_Description _function_as_argument_class_desc = { diff --git a/src/tests/eolian/data/override_ref.c b/src/tests/eolian/data/override_ref.c index 2a6c28b813..729f37e6c4 100644 --- a/src/tests/eolian/data/override_ref.c +++ b/src/tests/eolian/data/override_ref.c @@ -81,7 +81,7 @@ _override_class_initializer(Efl_Class *klass) ); opsp = &ops; - return efl_class_functions_set(klass, opsp, NULL, NULL); + return efl_class_functions_set(klass, opsp, NULL); } static const Efl_Class_Description _override_class_desc = { diff --git a/src/tests/eolian/data/owning.eo.c b/src/tests/eolian/data/owning.eo.c index bf7e78bf9f..7e504833c9 100644 --- a/src/tests/eolian/data/owning.eo.c +++ b/src/tests/eolian/data/owning.eo.c @@ -56,7 +56,7 @@ _owning_class_initializer(Efl_Class *klass) ); opsp = &ops; - return efl_class_functions_set(klass, opsp, NULL, NULL); + return efl_class_functions_set(klass, opsp, NULL); } static const Efl_Class_Description _owning_class_desc = {