forked from enlightenment/efl
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:
parent
c722b18d2a
commit
ec7562fddf
|
@ -30,14 +30,8 @@ _setup_window_and_widget(const Efl_Class *klass, const Efl_Class *content_klass)
|
||||||
|
|
||||||
ck_assert(win);
|
ck_assert(win);
|
||||||
ck_assert(widget);
|
ck_assert(widget);
|
||||||
}
|
efl_wref_add(widget, &widget);
|
||||||
|
efl_wref_add(win, &win);
|
||||||
static void
|
|
||||||
_shutdown_fixture(void)
|
|
||||||
{
|
|
||||||
//We just NULL them out, shutdown will delete them
|
|
||||||
win = NULL;
|
|
||||||
widget = NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Eo*
|
Eo*
|
||||||
|
|
|
@ -12,7 +12,7 @@ tcase_gen_template = """
|
||||||
static void
|
static void
|
||||||
{}(TCase *tc)
|
{}(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);
|
tcase_add_checked_fixture(tc, fail_on_errors_setup, fail_on_errors_teardown);
|
||||||
{}(tc);
|
{}(tc);
|
||||||
}}
|
}}
|
||||||
|
|
Loading…
Reference in New Issue