2012-04-12 01:27:38 -07:00
|
|
|
#include "Eobj.h"
|
|
|
|
#include "simple.h"
|
|
|
|
|
|
|
|
#include "inherit.h"
|
|
|
|
#include "inherit2.h"
|
|
|
|
|
2012-04-12 06:52:13 -07:00
|
|
|
#include "config.h"
|
|
|
|
|
2012-04-12 08:27:22 -07:00
|
|
|
#include "../eunit_tests.h"
|
|
|
|
|
2012-04-12 01:27:38 -07:00
|
|
|
EAPI Eobj_Op INHERIT2_BASE_ID = 0;
|
|
|
|
|
2012-04-23 01:09:54 -07:00
|
|
|
#define MY_CLASS INHERIT2_CLASS
|
2012-04-12 01:27:38 -07:00
|
|
|
|
|
|
|
static void
|
2012-04-19 04:30:17 -07:00
|
|
|
_a_set(Eobj *obj, void *class_data EINA_UNUSED, va_list *list)
|
2012-04-12 01:27:38 -07:00
|
|
|
{
|
|
|
|
int a;
|
|
|
|
a = va_arg(*list, int);
|
2012-04-23 01:09:54 -07:00
|
|
|
printf("%s %d\n", eobj_class_name_get(MY_CLASS), a);
|
2012-04-24 01:56:49 -07:00
|
|
|
eobj_do(obj, simple_a_print());
|
|
|
|
eobj_do_super(obj, simple_a_set(a + 1));
|
2012-04-18 00:58:34 -07:00
|
|
|
|
2012-04-24 01:56:49 -07:00
|
|
|
fail_if(eobj_do_super(obj, simple_a_print()));
|
2012-04-12 01:27:38 -07:00
|
|
|
}
|
|
|
|
|
2012-04-12 08:27:22 -07:00
|
|
|
static void
|
2012-04-19 04:30:17 -07:00
|
|
|
_print(Eobj *obj, void *class_data EINA_UNUSED, va_list *list EINA_UNUSED)
|
2012-04-12 08:27:22 -07:00
|
|
|
{
|
|
|
|
printf("Hey\n");
|
2012-04-24 01:56:49 -07:00
|
|
|
fail_if(eobj_do_super(obj, inherit2_print()));
|
2012-04-12 08:27:22 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-04-19 04:30:17 -07:00
|
|
|
_print2(Eobj *obj EINA_UNUSED, void *class_data EINA_UNUSED, va_list *list EINA_UNUSED)
|
2012-04-12 08:27:22 -07:00
|
|
|
{
|
|
|
|
printf("Hey2\n");
|
|
|
|
}
|
|
|
|
|
2012-04-12 01:27:38 -07:00
|
|
|
static void
|
|
|
|
_class_constructor(Eobj_Class *klass)
|
|
|
|
{
|
|
|
|
const Eobj_Op_Func_Description func_desc[] = {
|
2012-04-16 05:36:34 -07:00
|
|
|
EOBJ_OP_FUNC(SIMPLE_ID(SIMPLE_SUB_ID_A_SET), _a_set),
|
|
|
|
EOBJ_OP_FUNC(INHERIT2_ID(INHERIT2_SUB_ID_PRINT), _print),
|
|
|
|
EOBJ_OP_FUNC(INHERIT2_ID(INHERIT2_SUB_ID_PRINT2), _print2),
|
|
|
|
EOBJ_OP_FUNC_SENTINEL
|
2012-04-12 01:27:38 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
eobj_class_funcs_set(klass, func_desc);
|
|
|
|
}
|
|
|
|
|
2012-04-23 01:09:54 -07:00
|
|
|
static const Eobj_Op_Description op_desc[] = {
|
|
|
|
EOBJ_OP_DESCRIPTION(INHERIT2_SUB_ID_PRINT, "", "Print hey"),
|
|
|
|
EOBJ_OP_DESCRIPTION(INHERIT2_SUB_ID_PRINT2, "", "Print hey2"),
|
|
|
|
EOBJ_OP_DESCRIPTION_SENTINEL
|
|
|
|
};
|
2012-04-12 01:27:38 -07:00
|
|
|
|
2012-04-23 01:09:54 -07:00
|
|
|
static const Eobj_Class_Description class_desc = {
|
|
|
|
"Inherit2",
|
|
|
|
EOBJ_CLASS_TYPE_REGULAR,
|
|
|
|
EOBJ_CLASS_DESCRIPTION_OPS(&INHERIT2_BASE_ID, op_desc, INHERIT2_SUB_ID_LAST),
|
|
|
|
NULL,
|
|
|
|
0,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
_class_constructor,
|
|
|
|
NULL
|
|
|
|
};
|
2012-04-12 08:27:22 -07:00
|
|
|
|
2012-04-23 01:09:54 -07:00
|
|
|
EOBJ_DEFINE_CLASS(inherit2_class_get, &class_desc, INHERIT_CLASS, NULL);
|
2012-04-12 01:27:38 -07:00
|
|
|
|