2012-09-07 14:56:44 -07:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include <config.h>
|
|
|
|
#endif
|
|
|
|
|
2012-05-01 00:40:14 -07:00
|
|
|
#include "Eo.h"
|
2012-09-25 23:56:52 -07:00
|
|
|
#include "function_overrides_simple.h"
|
|
|
|
#include "function_overrides_inherit.h"
|
|
|
|
#include "function_overrides_inherit2.h"
|
2012-04-12 01:27:38 -07:00
|
|
|
|
2012-04-12 08:27:22 -07:00
|
|
|
#include "../eunit_tests.h"
|
|
|
|
|
2012-04-23 01:09:54 -07:00
|
|
|
#define MY_CLASS INHERIT2_CLASS
|
2012-04-12 01:27:38 -07:00
|
|
|
|
|
|
|
static void
|
2013-11-07 09:00:09 -08:00
|
|
|
_a_set(Eo *obj, void *class_data EINA_UNUSED, int a)
|
2012-04-12 01:27:38 -07:00
|
|
|
{
|
2012-05-01 00:40:14 -07:00
|
|
|
printf("%s %d\n", eo_class_name_get(MY_CLASS), a);
|
2014-04-02 01:46:34 -07:00
|
|
|
eo_do(obj, simple_a_print());
|
|
|
|
eo_do_super(obj, MY_CLASS, simple_a_set(a + 1));
|
2012-04-18 00:58:34 -07:00
|
|
|
|
2013-12-30 13:16:55 -08:00
|
|
|
Eina_Bool called = EINA_FALSE;
|
2014-04-02 01:46:34 -07:00
|
|
|
eo_do_super(obj, MY_CLASS, called = simple_a_print());
|
2013-11-08 02:25:38 -08:00
|
|
|
fail_if(!called);
|
2012-04-12 01:27:38 -07:00
|
|
|
}
|
|
|
|
|
2013-11-08 02:25:38 -08:00
|
|
|
static Eina_Bool
|
2013-11-07 09:00:09 -08:00
|
|
|
_print(Eo *obj, void *class_data EINA_UNUSED)
|
2012-04-12 08:27:22 -07:00
|
|
|
{
|
2013-12-30 13:16:55 -08:00
|
|
|
Eina_Bool called = EINA_FALSE;
|
2012-04-12 08:27:22 -07:00
|
|
|
printf("Hey\n");
|
2014-04-02 01:46:34 -07:00
|
|
|
eo_do_super(obj, MY_CLASS, called = inherit2_print());
|
2013-11-08 02:25:38 -08:00
|
|
|
fail_if(called);
|
|
|
|
|
|
|
|
return EINA_TRUE;
|
2012-04-12 08:27:22 -07:00
|
|
|
}
|
|
|
|
|
2013-11-08 02:25:38 -08:00
|
|
|
static Eina_Bool
|
2013-11-07 09:00:09 -08:00
|
|
|
_print2(Eo *obj EINA_UNUSED, void *class_data EINA_UNUSED)
|
2012-04-12 08:27:22 -07:00
|
|
|
{
|
|
|
|
printf("Hey2\n");
|
2013-11-08 02:25:38 -08:00
|
|
|
|
|
|
|
return EINA_TRUE;
|
2012-04-12 08:27:22 -07:00
|
|
|
}
|
|
|
|
|
2013-11-08 02:25:38 -08:00
|
|
|
static Eina_Bool
|
2013-11-07 09:00:09 -08:00
|
|
|
_class_print(Eo_Class *klass, void *data EINA_UNUSED)
|
2012-05-15 07:16:58 -07:00
|
|
|
{
|
2013-12-30 13:16:55 -08:00
|
|
|
Eina_Bool called = EINA_FALSE;
|
2012-05-15 07:16:58 -07:00
|
|
|
printf("Print %s-%s\n", eo_class_name_get(klass), eo_class_name_get(MY_CLASS));
|
2014-04-02 01:46:34 -07:00
|
|
|
eo_do_super(klass, MY_CLASS, called = simple_class_print());
|
2013-11-08 02:25:38 -08:00
|
|
|
fail_if(!called);
|
|
|
|
|
2014-04-02 01:46:34 -07:00
|
|
|
eo_do_super(klass, MY_CLASS, called = simple_class_print2());
|
2013-11-08 02:25:38 -08:00
|
|
|
fail_if(!called);
|
2012-04-12 01:27:38 -07:00
|
|
|
|
2013-11-08 02:25:38 -08:00
|
|
|
return EINA_TRUE;
|
2012-04-12 01:27:38 -07:00
|
|
|
}
|
|
|
|
|
2014-04-02 01:46:34 -07:00
|
|
|
EAPI EO_FUNC_BODY(inherit2_print, Eina_Bool, EINA_FALSE);
|
|
|
|
EAPI EO_FUNC_BODY(inherit2_print2, Eina_Bool, EINA_FALSE);
|
2013-11-07 09:00:09 -08:00
|
|
|
|
2014-04-02 01:46:34 -07:00
|
|
|
static Eo_Op_Description op_descs[] = {
|
2015-09-28 06:15:15 -07:00
|
|
|
EO_OP_FUNC(inherit2_print, _print),
|
|
|
|
EO_OP_FUNC(inherit2_print2, _print2),
|
2014-04-02 01:46:34 -07:00
|
|
|
EO_OP_CLASS_FUNC_OVERRIDE(simple_class_print, _class_print),
|
|
|
|
EO_OP_FUNC_OVERRIDE(simple_a_set, _a_set),
|
2012-04-23 01:09:54 -07:00
|
|
|
};
|
2012-04-12 01:27:38 -07:00
|
|
|
|
2012-05-01 00:40:14 -07:00
|
|
|
static const Eo_Class_Description class_desc = {
|
2014-04-02 01:46:34 -07:00
|
|
|
EO_VERSION,
|
2012-04-23 01:09:54 -07:00
|
|
|
"Inherit2",
|
2012-05-01 00:40:14 -07:00
|
|
|
EO_CLASS_TYPE_REGULAR,
|
2014-04-02 01:46:34 -07:00
|
|
|
EO_CLASS_DESCRIPTION_OPS(op_descs),
|
2012-04-23 01:09:54 -07:00
|
|
|
NULL,
|
|
|
|
0,
|
2013-11-07 09:00:09 -08:00
|
|
|
NULL,
|
2012-04-23 01:09:54 -07:00
|
|
|
NULL
|
|
|
|
};
|
2012-04-12 08:27:22 -07:00
|
|
|
|
2012-05-01 00:40:14 -07:00
|
|
|
EO_DEFINE_CLASS(inherit2_class_get, &class_desc, INHERIT_CLASS, NULL);
|
2012-04-12 01:27:38 -07:00
|
|
|
|