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
This commit is contained in:
Mike Blumenkrantz 2019-10-31 09:02:52 -04:00
parent c722b18d2a
commit ec7562fddf
2 changed files with 3 additions and 9 deletions

View File

@ -30,14 +30,8 @@ _setup_window_and_widget(const Efl_Class *klass, const Efl_Class *content_klass)
ck_assert(win);
ck_assert(widget);
}
static void
_shutdown_fixture(void)
{
//We just NULL them out, shutdown will delete them
win = NULL;
widget = NULL;
efl_wref_add(widget, &widget);
efl_wref_add(win, &win);
}
Eo*

View File

@ -12,7 +12,7 @@ tcase_gen_template = """
static void
{}(TCase *tc)
{{
tcase_add_checked_fixture(tc, _{}_fixture, _shutdown_fixture);
tcase_add_checked_fixture(tc, _{}_fixture, NULL);
tcase_add_checked_fixture(tc, fail_on_errors_setup, fail_on_errors_teardown);
{}(tc);
}}