8 #include "../eunit_tests.h"
10 static const Eobj_Class *_my_class = NULL;
13 _ab_sum_get(Eobj *obj, void *class_data, va_list *list)
15 Mixin2_Public_Data *pd = class_data;
16 int *sum = va_arg(*list, int *);
17 printf("%s %s\n", eobj_class_name_get(_my_class), __func__);
18 eobj_do_super(obj, MIXIN_AB_SUM_GET(sum));
25 eobj_do(obj, SIMPLE_A_GET(&_a), SIMPLE_B_GET(&_b));
26 fail_if(*sum != _a + _b + 1);
31 _constructor(Eobj *obj, void *class_data __UNUSED__)
33 eobj_constructor_super(obj);
37 _destructor(Eobj *obj, void *class_data __UNUSED__)
39 eobj_destructor_super(obj);
43 _class_constructor(Eobj_Class *klass)
45 const Eobj_Op_Func_Description func_desc[] = {
46 EOBJ_OP_FUNC(MIXIN_ID(MIXIN_SUB_ID_AB_SUM_GET), _ab_sum_get),
50 eobj_class_funcs_set(klass, func_desc);
54 mixin2_class_get(void)
56 if (_my_class) return _my_class;
58 static const Eobj_Class_Description class_desc = {
60 EOBJ_CLASS_TYPE_MIXIN,
61 EOBJ_CLASS_DESCRIPTION_OPS(NULL, NULL, 0),
63 sizeof(Mixin2_Public_Data),
70 _my_class = eobj_class_new(&class_desc, MIXIN_CLASS, NULL);