summaryrefslogtreecommitdiff
path: root/src/tests/eo
diff options
context:
space:
mode:
Diffstat (limited to 'src/tests/eo')
-rw-r--r--src/tests/eo/suite/eo_test_lifecycle.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/tests/eo/suite/eo_test_lifecycle.c b/src/tests/eo/suite/eo_test_lifecycle.c
index b0c67bca45..190a7366ca 100644
--- a/src/tests/eo/suite/eo_test_lifecycle.c
+++ b/src/tests/eo/suite/eo_test_lifecycle.c
@@ -162,6 +162,35 @@ EFL_START_TEST(eo_test_unref_noref)
162} 162}
163EFL_END_TEST 163EFL_END_TEST
164 164
165
166typedef struct {
167 Eo *par;
168 Eina_Bool called;
169} Invalidating_Test_Helper;
170
171static void
172_invalidate2(void *data, const Efl_Event *ev EINA_UNUSED)
173{
174 Invalidating_Test_Helper *iev = data;
175
176 iev->called = EINA_TRUE;
177 ck_assert_int_eq(efl_invalidating_get(iev->par), EINA_TRUE);
178 ck_assert_int_eq(efl_invalidated_get(iev->par), EINA_FALSE);
179}
180
181EFL_START_TEST(eo_test_invalidating_get)
182{
183 Eo *par = efl_add_ref(SIMPLE_CLASS, NULL);
184 Eo *obj = efl_add(SIMPLE_CLASS, par);
185 Invalidating_Test_Helper data = {par, EINA_FALSE};
186
187 efl_event_callback_add(obj, EFL_EVENT_INVALIDATE, _invalidate2, &data);
188
189 efl_unref(par);
190 ck_assert_int_eq(data.called, EINA_TRUE);
191}
192EFL_END_TEST
193
165void eo_test_lifecycle(TCase *tc) 194void eo_test_lifecycle(TCase *tc)
166{ 195{
167 tcase_add_test(tc, eo_test_base_del); 196 tcase_add_test(tc, eo_test_base_del);
@@ -169,4 +198,5 @@ void eo_test_lifecycle(TCase *tc)
169 tcase_add_test(tc, eo_test_shutdown_eventting); 198 tcase_add_test(tc, eo_test_shutdown_eventting);
170 tcase_add_test(tc, eo_test_del_in_noref); 199 tcase_add_test(tc, eo_test_del_in_noref);
171 tcase_add_test(tc, eo_test_unref_noref); 200 tcase_add_test(tc, eo_test_unref_noref);
201 tcase_add_test(tc, eo_test_invalidating_get);
172} 202}