2012-04-19 01:52:11 -07:00
|
|
|
#include "Eobj.h"
|
|
|
|
#include "mixin.h"
|
|
|
|
#include "mixin3.h"
|
|
|
|
#include "simple.h"
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
#include "../eunit_tests.h"
|
|
|
|
|
2012-04-23 01:09:54 -07:00
|
|
|
#define MY_CLASS MIXIN3_CLASS
|
2012-04-19 01:52:11 -07:00
|
|
|
|
|
|
|
static void
|
2012-04-19 04:30:17 -07:00
|
|
|
_ab_sum_get(Eobj *obj, void *class_data EINA_UNUSED, va_list *list)
|
2012-04-19 01:52:11 -07:00
|
|
|
{
|
2012-04-19 01:52:25 -07:00
|
|
|
Mixin3_Public_Data *pd = class_data;
|
2012-04-19 01:52:11 -07:00
|
|
|
int *sum = va_arg(*list, int *);
|
2012-04-23 01:09:54 -07:00
|
|
|
printf("%s %s\n", eobj_class_name_get(MY_CLASS), __func__);
|
2012-04-19 01:52:11 -07:00
|
|
|
eobj_do_super(obj, MIXIN_AB_SUM_GET(sum));
|
|
|
|
|
|
|
|
++*sum;
|
2012-04-19 01:52:25 -07:00
|
|
|
pd->count += 3;
|
2012-04-19 01:52:11 -07:00
|
|
|
|
|
|
|
{
|
|
|
|
int _a, _b;
|
|
|
|
eobj_do(obj, SIMPLE_A_GET(&_a), SIMPLE_B_GET(&_b));
|
|
|
|
fail_if(*sum != _a + _b + 2);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-04-19 04:30:17 -07:00
|
|
|
_constructor(Eobj *obj, void *class_data EINA_UNUSED)
|
2012-04-19 01:52:11 -07:00
|
|
|
{
|
|
|
|
eobj_constructor_super(obj);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-04-19 04:30:17 -07:00
|
|
|
_destructor(Eobj *obj, void *class_data EINA_UNUSED)
|
2012-04-19 01:52:11 -07:00
|
|
|
{
|
|
|
|
eobj_destructor_super(obj);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_class_constructor(Eobj_Class *klass)
|
|
|
|
{
|
|
|
|
const Eobj_Op_Func_Description func_desc[] = {
|
|
|
|
EOBJ_OP_FUNC(MIXIN_ID(MIXIN_SUB_ID_AB_SUM_GET), _ab_sum_get),
|
|
|
|
EOBJ_OP_FUNC_SENTINEL
|
|
|
|
};
|
|
|
|
|
|
|
|
eobj_class_funcs_set(klass, func_desc);
|
|
|
|
}
|
|
|
|
|
2012-04-23 01:09:54 -07:00
|
|
|
static const Eobj_Class_Description class_desc = {
|
|
|
|
"Mixin3",
|
|
|
|
EOBJ_CLASS_TYPE_MIXIN,
|
|
|
|
EOBJ_CLASS_DESCRIPTION_OPS(NULL, NULL, 0),
|
|
|
|
NULL,
|
|
|
|
sizeof(Mixin3_Public_Data),
|
|
|
|
_constructor,
|
|
|
|
_destructor,
|
|
|
|
_class_constructor,
|
|
|
|
NULL
|
|
|
|
};
|
2012-04-19 01:52:11 -07:00
|
|
|
|
2012-04-23 01:09:54 -07:00
|
|
|
EOBJ_DEFINE_CLASS(mixin3_class_get, &class_desc, MIXIN_CLASS, NULL);
|
2012-04-19 01:52:11 -07:00
|
|
|
|