eo: improve error reporting, update tests

This commit is contained in:
Jérémy Zurcher 2014-05-08 13:44:47 +02:00
parent 0ce3154656
commit 0b97c11ea2
2 changed files with 7 additions and 6 deletions

View File

@ -627,8 +627,8 @@ _eo_call_resolve(const char *func_name, const Eo_Op op, Eo_Op_Call_Data *call, c
if (func->src != NULL)
{
ERR("in %s:%d: you called a pure virtual func '%s' (%d).",
file, line, func_name, op);
ERR("in %s:%d: you called a pure virtual func '%s' (%d) of class '%s'.",
file, line, func_name, op, klass->desc->name);
return EINA_FALSE;
}
@ -758,8 +758,9 @@ _eo_api_op_id_get(const void *api_func, const char *file, int line)
if (dladdr(api_func, &info) != 0)
fct_name = info.dli_sname;
#endif
ERR("in %s:%d: unable to resolve %s api func '%s' %p.",
file, line, (class_ref ? "class" : "regular"), fct_name, api_func);
ERR("in %s:%d: unable to resolve %s api func '%s' %p in class '%s'.",
file, line, (class_ref ? "class" : "regular"),
fct_name, api_func, klass->desc->name);
return EO_NOOP;
}

View File

@ -19,7 +19,7 @@ START_TEST(eo_pure_virtual_fct_call)
Eo *obj = eo_add(SIMPLE_CLASS, NULL);
fail_if(!obj);
TEST_EO_ERROR("_eo_call_resolve", "in %s:%d: you called a pure virtual func '%s' (%d).");
TEST_EO_ERROR("_eo_call_resolve", "in %s:%d: you called a pure virtual func '%s' (%d) of class '%s'.");
eo_do(obj, simple_pure_virtual());
fail_unless(ctx.did);
@ -37,7 +37,7 @@ START_TEST(eo_api_not_implemented_call)
Eo *obj = eo_add(SIMPLE_CLASS, NULL);
fail_if(!obj);
TEST_EO_ERROR("_eo_api_op_id_get", "in %s:%d: unable to resolve %s api func %p.");
TEST_EO_ERROR("_eo_api_op_id_get", "in %s:%d: unable to resolve %s api func '%s' %p in class '%s'.");
eo_do(obj, simple_no_implementation());
fail_unless(ctx.did);