summaryrefslogtreecommitdiff
path: root/src/tests/eo
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2018-08-20 13:15:56 -0400
committerMike Blumenkrantz <zmike@samsung.com>2018-08-20 13:15:57 -0400
commit365c0334ff66af2592c8f86f542024d0b506ca3e (patch)
treec337d6cb92c7f71cbb47363cbc263fae4725bf95 /src/tests/eo
parent87332f2e3ab2694f27913222ddadbadbca5c4d54 (diff)
efl_object: add call for getting invalidating
Summary: there is now invalidated & invalidating. invalidated returns true when all children are invalidated, and the object is / was requested to be invalidated. invalidating return true when the object is called to be invalidated but not all children are invalidated yet. However, the object is garanteed to be invalidated in near future. Reviewers: zmike Reviewed By: zmike Subscribers: cedric Tags: #efl, #do_not_merge Differential Revision: https://phab.enlightenment.org/D6722
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}