summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortasn <tasn>2012-06-20 15:56:17 +0000
committertasn <tasn@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>2012-06-20 15:56:17 +0000
commitb68f7e2b7a80a5da3c66bb33142561b7cd56a736 (patch)
tree69158941aa1c43bff6138b8bea1a9aef4e5239f2 /src
parentafbb6dfa2bc2d86f433659cb31a93af9c9e70b48 (diff)
downloadeobj-b68f7e2b7a80a5da3c66bb33142561b7cd56a736.tar.gz
eobj-b68f7e2b7a80a5da3c66bb33142561b7cd56a736.tar.bz2
eobj-b68f7e2b7a80a5da3c66bb33142561b7cd56a736.zip
Eo: Fix return value of eo_do_super to depend on error_set.
And added tests to check it. git-svn-id: http://svn.enlightenment.org/svn/e/trunk/PROTO/eobj@72550 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33
Diffstat (limited to 'src')
-rw-r--r--src/lib/eo.c3
-rw-r--r--src/tests/constructors/CMakeLists.txt1
-rw-r--r--src/tests/constructors/main.c6
-rw-r--r--src/tests/constructors/simple6.c2
-rw-r--r--src/tests/constructors/simple7.c39
-rw-r--r--src/tests/constructors/simple7.h9
6 files changed, 59 insertions, 1 deletions
diff --git a/src/lib/eo.c b/src/lib/eo.c
index c8f9d3b..b1f237c 100644
--- a/src/lib/eo.c
+++ b/src/lib/eo.c
@@ -474,6 +474,9 @@ eo_do_super_internal(Eo *obj, Eo_Op_Type op_type, Eo_Op op, ...)
}
va_end(p_list);
+ if (obj->do_error)
+ ret = EINA_FALSE;
+
return ret;
}
diff --git a/src/tests/constructors/CMakeLists.txt b/src/tests/constructors/CMakeLists.txt
index 731d93d..09dc10f 100644
--- a/src/tests/constructors/CMakeLists.txt
+++ b/src/tests/constructors/CMakeLists.txt
@@ -6,6 +6,7 @@ LIST(APPEND CONSTRUCTORS_CC_SOURCES
simple4.c
simple5.c
simple6.c
+ simple7.c
mixin.c
)
diff --git a/src/tests/constructors/main.c b/src/tests/constructors/main.c
index c2906d9..9bcf095 100644
--- a/src/tests/constructors/main.c
+++ b/src/tests/constructors/main.c
@@ -5,6 +5,7 @@
#include "simple4.h"
#include "simple5.h"
#include "simple6.h"
+#include "simple7.h"
#include "mixin.h"
#include "../eunit_tests.h"
@@ -48,11 +49,16 @@ main(int argc, char *argv[])
fail_if(my_init_count != 0);
obj = eo_add(SIMPLE5_CLASS, NULL);
+ fail_if(!obj);
eo_unref(obj);
obj = eo_add(SIMPLE6_CLASS, NULL);
+ fail_if(!obj);
eo_unref(obj);
+ obj = eo_add(SIMPLE7_CLASS, NULL);
+ fail_if(obj);
+
eo_shutdown();
return ret;
}
diff --git a/src/tests/constructors/simple6.c b/src/tests/constructors/simple6.c
index 743f3ef..f6e5cba 100644
--- a/src/tests/constructors/simple6.c
+++ b/src/tests/constructors/simple6.c
@@ -9,7 +9,7 @@
static void
_destructor(Eo *obj, void *class_data EINA_UNUSED, va_list *list EINA_UNUSED)
{
- eo_do_super(obj, eo_constructor());
+ eo_do_super(obj, eo_destructor());
eo_error_set(obj);
}
diff --git a/src/tests/constructors/simple7.c b/src/tests/constructors/simple7.c
new file mode 100644
index 0000000..a8f43d9
--- /dev/null
+++ b/src/tests/constructors/simple7.c
@@ -0,0 +1,39 @@
+#include "Eo.h"
+#include "mixin.h"
+#include "simple7.h"
+#include "simple2.h"
+
+#include "config.h"
+#include "../eunit_tests.h"
+
+#define MY_CLASS SIMPLE7_CLASS
+
+static void
+_constructor(Eo *obj, void *class_data EINA_UNUSED, va_list *list EINA_UNUSED)
+{
+ fail_if(eo_do_super(obj, eo_constructor()));
+}
+
+static void
+_class_constructor(Eo_Class *klass)
+{
+ const Eo_Op_Func_Description func_desc[] = {
+ EO_OP_FUNC(EO_BASE_ID(EO_BASE_SUB_ID_CONSTRUCTOR), _constructor),
+ EO_OP_FUNC_SENTINEL
+ };
+
+ eo_class_funcs_set(klass, func_desc);
+}
+
+static const Eo_Class_Description class_desc = {
+ "Simple7",
+ EO_CLASS_TYPE_REGULAR,
+ EO_CLASS_DESCRIPTION_OPS(NULL, NULL, 0),
+ NULL,
+ 0,
+ _class_constructor,
+ NULL
+};
+
+EO_DEFINE_CLASS(simple7_class_get, &class_desc, SIMPLE2_CLASS, NULL);
+
diff --git a/src/tests/constructors/simple7.h b/src/tests/constructors/simple7.h
new file mode 100644
index 0000000..3710b62
--- /dev/null
+++ b/src/tests/constructors/simple7.h
@@ -0,0 +1,9 @@
+#ifndef SIMPLE7_H
+#define SIMPLE7_H
+
+#include "Eo.h"
+
+#define SIMPLE7_CLASS simple7_class_get()
+const Eo_Class *simple7_class_get(void);
+
+#endif