diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2012-12-18 16:59:35 -0500 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2012-12-18 17:03:01 -0500 |
commit | d728d3c924e6fefb02d0e2a21a6242e1e13b091a (patch) | |
tree | c42d600a8cd6e0b76293df8cebaf8039f7818af2 /libdimension | |
parent | 7da79cf1e24fbc58e0ff2e498a7f3d189a51cbd6 (diff) | |
download | dimension-d728d3c924e6fefb02d0e2a21a6242e1e13b091a.tar.xz |
Don't print a memory leak message on failed tests.
Diffstat (limited to 'libdimension')
-rw-r--r-- | libdimension/tests/unit-test.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/libdimension/tests/unit-test.c b/libdimension/tests/unit-test.c index d6d256e..56908aa 100644 --- a/libdimension/tests/unit-test.c +++ b/libdimension/tests/unit-test.c @@ -54,6 +54,14 @@ dmnsn_test_setup(void) void dmnsn_test_teardown(void) { +} + +__attribute__((destructor)) +static void +dmnsn_test_cleanup(void) +{ + /* Can't go in dmnsn_test_teardown(), because it should run even if the test + fails. */ dmnsn_delete_dictionary(dmnsn_test_cases); } @@ -94,7 +102,6 @@ main() /* Clean up */ srunner_free(sr); - dmnsn_delete_dictionary(dmnsn_test_cases); /* Return the right result code */ if (nfailed == 0) { |