summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2018-04-20 12:59:30 +0200
committerStefan Schmidt <stefan@osg.samsung.com>2018-04-20 14:31:11 +0200
commitea3803e6fbc1c7fd9876d1447435cb439e87ed7b (patch)
tree7c106799b33b95f54ac97113e2454662e0ca570d
parentf176aece655ed7ed7508766b28a3c244e13a4b41 (diff)
tests: add test to verify genlist item deletion
Reviewers: stefan_schmidt Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D5963
-rw-r--r--src/tests/elementary/elm_test_genlist.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/tests/elementary/elm_test_genlist.c b/src/tests/elementary/elm_test_genlist.c
index 689916c8ab..fd346364e8 100644
--- a/src/tests/elementary/elm_test_genlist.c
+++ b/src/tests/elementary/elm_test_genlist.c
@@ -246,9 +246,46 @@ EFL_START_TEST(elm_atspi_children_events_del2)
246} 246}
247EFL_END_TEST 247EFL_END_TEST
248 248
249static int it_del = 0;
250
251static void
252_gl_destroy()
253{
254 ck_assert_int_eq(it_del, 2);
255}
256
257static void
258_it_destroy()
259{
260 it_del++;
261}
262
263static void
264_it_del()
265{
266 it_del = 1;
267}
268
269EFL_START_TEST(elm_genlist_item_destroy)
270{
271 Elm_Object_Item *git;
272
273 win = elm_win_add(NULL, "genlist", ELM_WIN_BASIC);
274
275 genlist = elm_genlist_add(win);
276 efl_event_callback_add(genlist, EFL_EVENT_DESTRUCT, _gl_destroy, NULL);
277
278 git = elm_genlist_item_append(genlist, &itc, NULL, NULL, 0, NULL, NULL);
279 efl_event_callback_add(git, EFL_EVENT_DEL, _it_del, NULL);
280 efl_event_callback_add(git, EFL_EVENT_DESTRUCT, _it_destroy, NULL);
281
282}
283EFL_END_TEST
284
249void elm_test_genlist(TCase *tc) 285void elm_test_genlist(TCase *tc)
250{ 286{
251 tcase_add_test(tc, elm_genlist_legacy_type_check); 287 tcase_add_test(tc, elm_genlist_legacy_type_check);
288 tcase_add_test(tc, elm_genlist_item_destroy);
252 tcase_add_test(tc, elm_genlist_group); 289 tcase_add_test(tc, elm_genlist_group);
253 tcase_add_test(tc, elm_atspi_role_get); 290 tcase_add_test(tc, elm_atspi_role_get);
254 tcase_add_test(tc, elm_atspi_children_get1); 291 tcase_add_test(tc, elm_atspi_children_get1);