eo: improve error reporting, update tests
authorJérémy Zurcher <jeremy@asynk.ch>
Thu, 8 May 2014 11:44:47 +0000 (13:44 +0200)
committerJérémy Zurcher <jeremy@asynk.ch>
Thu, 8 May 2014 11:44:47 +0000 (13:44 +0200)
src/lib/eo/eo.c
src/tests/eo/suite/eo_test_call_errors.c

index b52a47a..59865e6 100644 (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;
      }
 
index 08e1635..7e00fc1 100644 (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);