Eobj: Improved tests.

And one cosmetic change.

SVN revision: 70322
This commit is contained in:
Tom Hacohen 2012-04-19 08:52:18 +00:00
parent 5bfbd5f9d1
commit 965952c3a5
2 changed files with 16 additions and 3 deletions

View 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,

View 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);
}