diff options
author | Alice Frosi <afrosi@redhat.com> | 2023-02-15 15:24:50 +0100 |
---|---|---|
committer | Alice Frosi <afrosi@redhat.com> | 2023-02-15 15:27:13 +0100 |
commit | 0bb82809d89cd4fcf664ff5f0477657c9db75ae4 (patch) | |
tree | 5778bacfb1ad081f6ff37f0de8ec4049c6ebdb06 | |
parent | 8fc77732cbae451ea7b7fde88bef5f322167cd43 (diff) | |
download | seitan-0bb82809d89cd4fcf664ff5f0477657c9db75ae4.tar seitan-0bb82809d89cd4fcf664ff5f0477657c9db75ae4.tar.gz seitan-0bb82809d89cd4fcf664ff5f0477657c9db75ae4.tar.bz2 seitan-0bb82809d89cd4fcf664ff5f0477657c9db75ae4.tar.lz seitan-0bb82809d89cd4fcf664ff5f0477657c9db75ae4.tar.xz seitan-0bb82809d89cd4fcf664ff5f0477657c9db75ae4.tar.zst seitan-0bb82809d89cd4fcf664ff5f0477657c9db75ae4.zip |
Unmap at struct on teardown if set
Signed-off-by: Alice Frosi <afrosi@redhat.com>
-rw-r--r-- | tests/unit/test_actions.c | 8 |
1 files changed, 7 insertions, 1 deletions
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); |