efl_ui_spec_test: make this test work

I do not know what i was thinking when i initially wrote that test.
It never worked, the test created a widget captured all elements, deleted
the widget, then checked if there are elements left that are not knon on
the canvas yet.
Not the test first captures all elements, then creates the widget, then
deletes the widget, and checks if there are more elements than expected.
This found all the fix leaks prior to this leak.

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D10842
This commit is contained in:
Marcel Hollerbach 2019-12-09 18:45:37 +01:00 committed by Cedric BAIL
parent eaf2a8d7ec
commit e0ab85cff9
1 changed files with 12 additions and 1 deletions

View File

@ -66,6 +66,8 @@ EFL_START_TEST(no_leaking_canvas_object)
Eina_Iterator *iter = eo_objects_iterator_new();
Eo *obj;
if (efl_isa(widget, EFL_UI_FLIP_CLASS)) return; //FIXME Flip needs more work for this. However, flip should be redone as a spotlight manager, When this is done, we can add these classes to the check here.
EINA_ITERATOR_FOREACH(iter, obj)
{
if (!efl_alive_get(obj)) continue;
@ -75,6 +77,12 @@ EFL_START_TEST(no_leaking_canvas_object)
}
eina_iterator_free(iter);
//Just overwrite the widget pointer, and expect errors, if any error is happening here, we are not interested in it, another testcase will take care of them
EXPECT_ERROR_START;
widget = efl_add(widget_klass, win);
expect_error_start = EINA_TRUE;
EXPECT_ERROR_END;
//now try to will those widgets
if (efl_isa(widget, EFL_PACK_LINEAR_INTERFACE))
{
@ -105,7 +113,10 @@ EFL_START_TEST(no_leaking_canvas_object)
if (!efl_alive_get(obj)) continue;
if (!efl_isa(obj, EFL_CANVAS_OBJECT_CLASS)) continue;
ck_assert_ptr_ne(eina_list_data_find(not_invalidate, obj), NULL);
if (eina_list_data_find(not_invalidate, obj) == NULL)
{
ck_abort_msg("Leak detected %s Evas-Parent: %s", efl_debug_name_get(obj), efl_class_name_get(efl_canvas_object_render_parent_get(obj)));
}
}
eina_iterator_free(iter);