9 #include "../eunit_tests.h"
11 EAPI Eo_Op INHERIT2_BASE_ID = 0;
13 #define MY_CLASS INHERIT2_CLASS
16 _a_set(Eo *obj, void *class_data EINA_UNUSED, va_list *list)
19 a = va_arg(*list, int);
20 printf("%s %d\n", eo_class_name_get(MY_CLASS), a);
21 eo_do(obj, simple_a_print());
22 eo_do_super(obj, simple_a_set(a + 1));
24 fail_if(eo_do_super(obj, simple_a_print()));
28 _print(Eo *obj, void *class_data EINA_UNUSED, va_list *list EINA_UNUSED)
31 fail_if(eo_do_super(obj, inherit2_print()));
35 _print2(Eo *obj EINA_UNUSED, void *class_data EINA_UNUSED, va_list *list EINA_UNUSED)
41 _class_print(const Eo_Class *klass, va_list *list)
44 printf("Print %s-%s\n", eo_class_name_get(klass), eo_class_name_get(MY_CLASS));
45 fail_if(!eo_class_do_super(klass, simple_class_print()));
46 fail_if(eo_class_do_super(klass, simple_class_print2()));
50 _class_constructor(Eo_Class *klass)
52 const Eo_Op_Func_Description func_desc[] = {
53 EO_OP_FUNC(SIMPLE_ID(SIMPLE_SUB_ID_A_SET), _a_set),
54 EO_OP_FUNC(INHERIT2_ID(INHERIT2_SUB_ID_PRINT), _print),
55 EO_OP_FUNC(INHERIT2_ID(INHERIT2_SUB_ID_PRINT2), _print2),
56 EO_OP_FUNC_CLASS(SIMPLE_ID(SIMPLE_SUB_ID_CLASS_PRINT), _class_print),
60 eo_class_funcs_set(klass, func_desc);
63 static const Eo_Op_Description op_desc[] = {
64 EO_OP_DESCRIPTION(INHERIT2_SUB_ID_PRINT, "", "Print hey"),
65 EO_OP_DESCRIPTION(INHERIT2_SUB_ID_PRINT2, "", "Print hey2"),
66 EO_OP_DESCRIPTION_SENTINEL
69 static const Eo_Class_Description class_desc = {
71 EO_CLASS_TYPE_REGULAR,
72 EO_CLASS_DESCRIPTION_OPS(&INHERIT2_BASE_ID, op_desc, INHERIT2_SUB_ID_LAST),
81 EO_DEFINE_CLASS(inherit2_class_get, &class_desc, INHERIT_CLASS, NULL);