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)
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)
66 Eina_Iterator *iter = eo_objects_iterator_new(); 66 Eina_Iterator *iter = eo_objects_iterator_new();
67 Eo *obj; 67 Eo *obj;
68 68
69 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.
70
69 EINA_ITERATOR_FOREACH(iter, obj) 71 EINA_ITERATOR_FOREACH(iter, obj)
70 { 72 {
71 if (!efl_alive_get(obj)) continue; 73 if (!efl_alive_get(obj)) continue;
@@ -75,6 +77,12 @@ EFL_START_TEST(no_leaking_canvas_object)
75 } 77 }
76 eina_iterator_free(iter); 78 eina_iterator_free(iter);
77 79
80 //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
81 EXPECT_ERROR_START;
82 widget = efl_add(widget_klass, win);
83 expect_error_start = EINA_TRUE;
84 EXPECT_ERROR_END;
85
78 //now try to will those widgets 86 //now try to will those widgets
79 if (efl_isa(widget, EFL_PACK_LINEAR_INTERFACE)) 87 if (efl_isa(widget, EFL_PACK_LINEAR_INTERFACE))
80 { 88 {
@@ -105,7 +113,10 @@ EFL_START_TEST(no_leaking_canvas_object)
105 if (!efl_alive_get(obj)) continue; 113 if (!efl_alive_get(obj)) continue;
106 if (!efl_isa(obj, EFL_CANVAS_OBJECT_CLASS)) continue; 114 if (!efl_isa(obj, EFL_CANVAS_OBJECT_CLASS)) continue;
107 115
108 ck_assert_ptr_ne(eina_list_data_find(not_invalidate, obj), NULL); 116 if (eina_list_data_find(not_invalidate, obj) == NULL)
117 {
118 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)));
119 }
109 } 120 }
110 eina_iterator_free(iter); 121 eina_iterator_free(iter);
111 122