summaryrefslogtreecommitdiff
path: root/src/tests/eo
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2018-08-01 16:41:14 +0200
committerStefan Schmidt <s.schmidt@samsung.com>2018-09-14 11:18:56 +0200
commit068e09cf2e23a4e80c28b8c1db4c23b3fdabaa14 (patch)
tree068af3ffef4a57675ae94e6fe0f82bdb9c92d0f1 /src/tests/eo
parent84973cbbba86b27513a8511bdc55642b445c33d7 (diff)
eo: add funktion for alive checks
The function simply checks if the object is finalized and not started to be invalidated or invalidated. Differential Revision: https://phab.enlightenment.org/D6723
Diffstat (limited to 'src/tests/eo')
-rw-r--r--src/tests/eo/suite/eo_test_lifecycle.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/tests/eo/suite/eo_test_lifecycle.c b/src/tests/eo/suite/eo_test_lifecycle.c
index 190a7366ca..224c9c738c 100644
--- a/src/tests/eo/suite/eo_test_lifecycle.c
+++ b/src/tests/eo/suite/eo_test_lifecycle.c
@@ -162,7 +162,6 @@ EFL_START_TEST(eo_test_unref_noref)
162} 162}
163EFL_END_TEST 163EFL_END_TEST
164 164
165
166typedef struct { 165typedef struct {
167 Eo *par; 166 Eo *par;
168 Eina_Bool called; 167 Eina_Bool called;
@@ -191,6 +190,25 @@ EFL_START_TEST(eo_test_invalidating_get)
191} 190}
192EFL_END_TEST 191EFL_END_TEST
193 192
193EFL_START_TEST(eo_test_alive_get)
194{
195 Eina_Bool res;
196 Eo *par = efl_add_ref(SIMPLE_CLASS, NULL);
197 Eo *obj = efl_add(SIMPLE_CLASS, par,
198 res = efl_alive_get(efl_added)
199 );
200 ck_assert_int_eq(res, 0);
201 ck_assert_int_eq(efl_alive_get(obj), 1);
202 efl_ref(obj);
203 ck_assert_int_eq(efl_alive_get(obj), 1);
204 efl_del(obj);
205 ck_assert_int_eq(efl_alive_get(obj), 0);
206 efl_unref(obj);
207 ck_assert_ptr_eq(efl_class_name_get(obj), NULL);
208
209}
210EFL_END_TEST
211
194void eo_test_lifecycle(TCase *tc) 212void eo_test_lifecycle(TCase *tc)
195{ 213{
196 tcase_add_test(tc, eo_test_base_del); 214 tcase_add_test(tc, eo_test_base_del);
@@ -199,4 +217,5 @@ void eo_test_lifecycle(TCase *tc)
199 tcase_add_test(tc, eo_test_del_in_noref); 217 tcase_add_test(tc, eo_test_del_in_noref);
200 tcase_add_test(tc, eo_test_unref_noref); 218 tcase_add_test(tc, eo_test_unref_noref);
201 tcase_add_test(tc, eo_test_invalidating_get); 219 tcase_add_test(tc, eo_test_invalidating_get);
220 tcase_add_test(tc, eo_test_alive_get);
202} 221}