From 0bb82809d89cd4fcf664ff5f0477657c9db75ae4 Mon Sep 17 00:00:00 2001 From: Alice Frosi Date: Wed, 15 Feb 2023 15:24:50 +0100 Subject: Unmap at struct on teardown if set Signed-off-by: Alice Frosi --- tests/unit/test_actions.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/unit/test_actions.c b/tests/unit/test_actions.c index 5020358..08799ef 100644 --- a/tests/unit/test_actions.c +++ b/tests/unit/test_actions.c @@ -145,6 +145,12 @@ void setup() (req.data).nr); } +void teardown() +{ + if (at != NULL) + munmap(at, sizeof(struct args_target)); +} + START_TEST(test_act_continue) { struct action actions[] = { @@ -195,7 +201,7 @@ Suite *action_call_suite(void) s = suite_create("Perform actions"); tactions = tcase_create("actions"); - tcase_add_checked_fixture(tactions, setup, NULL); + tcase_add_checked_fixture(tactions, setup, teardown); tcase_set_timeout(tactions, 30); tcase_add_test(tactions, test_act_return); tcase_add_test(tactions, test_act_block); -- cgit v1.2.3