summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2019-12-09 18:45:37 +0100
committerCedric BAIL <cedric.bail@free.fr>2019-12-13 09:32:59 -0800
commite0ab85cff942f2ca8b2c2882661439641d02e032 (patch)
tree873f6f3c9e73361813da8992052877519b9c1543
parenteaf2a8d7ecd3a8ae29e48abf0d6f81211041188e (diff)
downloadefl-e0ab85cff942f2ca8b2c2882661439641d02e032.tar.gz
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
-rw-r--r--src/tests/elementary/spec/efl_test_basics.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/tests/elementary/spec/efl_test_basics.c b/src/tests/elementary/spec/efl_test_basics.c
index 0985adb43c..99a441c059 100644
--- a/src/tests/elementary/spec/efl_test_basics.c
+++ b/src/tests/elementary/spec/efl_test_basics.c
@@ -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);