summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2019-10-31 09:02:52 -0400
committerMike Blumenkrantz <zmike@samsung.com>2019-10-31 09:59:41 -0400
commit2c9cace0265608e670dfa9a06b0d92ef6628a8bc (patch)
tree76a0e3c8c718e55664e384f7bfe066bf8821c337
parent95d5820b05b5b1dfbb39be69f0bfeadfa91231dc (diff)
tests/spec: use wrefs to automatically unset global pointers
Summary: these may end up being reused in the future, so unset them only on object destruction Depends on D10571 Reviewers: cedric Reviewed By: cedric Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D10572
-rw-r--r--src/tests/elementary/spec/efl_ui_spec_suite.c10
-rwxr-xr-xsrc/tests/elementary/spec/generator.py2
2 files changed, 3 insertions, 9 deletions
diff --git a/src/tests/elementary/spec/efl_ui_spec_suite.c b/src/tests/elementary/spec/efl_ui_spec_suite.c
index 2952e23585..92858cb69b 100644
--- a/src/tests/elementary/spec/efl_ui_spec_suite.c
+++ b/src/tests/elementary/spec/efl_ui_spec_suite.c
@@ -30,14 +30,8 @@ _setup_window_and_widget(const Efl_Class *klass, const Efl_Class *content_klass)
30 30
31 ck_assert(win); 31 ck_assert(win);
32 ck_assert(widget); 32 ck_assert(widget);
33} 33 efl_wref_add(widget, &widget);
34 34 efl_wref_add(win, &win);
35static void
36_shutdown_fixture(void)
37{
38 //We just NULL them out, shutdown will delete them
39 win = NULL;
40 widget = NULL;
41} 35}
42 36
43Eo* 37Eo*
diff --git a/src/tests/elementary/spec/generator.py b/src/tests/elementary/spec/generator.py
index daf2e61cfc..f831654885 100755
--- a/src/tests/elementary/spec/generator.py
+++ b/src/tests/elementary/spec/generator.py
@@ -12,7 +12,7 @@ tcase_gen_template = """
12static void 12static void
13{}(TCase *tc) 13{}(TCase *tc)
14{{ 14{{
15 tcase_add_checked_fixture(tc, _{}_fixture, _shutdown_fixture); 15 tcase_add_checked_fixture(tc, _{}_fixture, NULL);
16 tcase_add_checked_fixture(tc, fail_on_errors_setup, fail_on_errors_teardown); 16 tcase_add_checked_fixture(tc, fail_on_errors_setup, fail_on_errors_teardown);
17 {}(tc); 17 {}(tc);
18}} 18}}