Eobj: Improved tests.
authortasn <tasn>
Thu, 19 Apr 2012 08:52:18 +0000 (08:52 +0000)
committertasn <tasn@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Thu, 19 Apr 2012 08:52:18 +0000 (08:52 +0000)
And one cosmetic change.

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/PROTO/eobj@70322 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

lib/eobj.c
tests/eobj_test_general.c

index 032ed39..aeae1bf 100644 (file)
@@ -1321,7 +1321,7 @@ eobj_event_callback_call(Eobj *obj, const Eobj_Event_Description *desc,
 
    EINA_INLIST_FOREACH(obj->callbacks, cb)
      {
-        if (!cb->delete_me  && (cb->event == desc))
+        if (!cb->delete_me && (cb->event == desc))
           {
              /* Abort callback calling if the func says so. */
              if (!cb->func((void *) cb->func_data, obj, desc,
index 6809f7d..03c3090 100644 (file)
@@ -19,7 +19,7 @@ START_TEST(eobj_simple)
 }
 END_TEST
 
-START_TEST(eobj_xrefs)
+START_TEST(eobj_refs)
 {
    eobj_init();
    Eobj *obj = eobj_add(SIMPLE_CLASS, NULL);
@@ -54,6 +54,12 @@ START_TEST(eobj_xrefs)
    eobj_unref(obj2);
    eobj_unref(obj3);
 
+   /* Just check it doesn't seg atm. */
+   obj = eobj_add(SIMPLE_CLASS, NULL);
+   eobj_ref(obj);
+   eobj_del(obj);
+   eobj_del(obj);
+
    eobj_shutdown();
 }
 END_TEST
@@ -85,6 +91,13 @@ START_TEST(eobj_weak_reference)
 
    eobj_weak_ref_free(wref);
 
+   obj = eobj_add(SIMPLE_CLASS, NULL);
+
+   wref = eobj_weak_ref_new(obj);
+   eobj_weak_ref_free(wref);
+
+   eobj_unref(obj);
+
 
    eobj_shutdown();
 }
@@ -200,5 +213,5 @@ void eobj_test_general(TCase *tc)
    tcase_add_test(tc, eobj_op_errors);
    tcase_add_test(tc, eobj_simple);
    tcase_add_test(tc, eobj_weak_reference);
-   tcase_add_test(tc, eobj_xrefs);
+   tcase_add_test(tc, eobj_refs);
 }