From 4881013d6691266646b02d738a2174b97e02a343 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Tue, 31 Jan 2017 11:35:30 +0100 Subject: [PATCH] validate: tests: call gst_validate_deinit() gst_validate_deinit() needs to be called when the test is done to remove false positives when using the leaks tracer. https://bugzilla.gnome.org/show_bug.cgi?id=777977 Differential Revision: https://phabricator.freedesktop.org/D1630 --- validate/tests/check/validate/monitoring.c | 4 ++++ validate/tests/check/validate/overrides.c | 4 ++++ validate/tests/check/validate/padmonitor.c | 4 ++++ validate/tests/check/validate/reporting.c | 4 ++++ 4 files changed, 16 insertions(+) diff --git a/validate/tests/check/validate/monitoring.c b/validate/tests/check/validate/monitoring.c index 12cf8f4d13..dfb21476ea 100644 --- a/validate/tests/check/validate/monitoring.c +++ b/validate/tests/check/validate/monitoring.c @@ -99,6 +99,10 @@ gst_validate_suite (void) TCase *tc_chain = tcase_create ("monitoring"); suite_add_tcase (s, tc_chain); + if (atexit (gst_validate_deinit) != 0) { + GST_ERROR ("failed to set gst_validate_deinit as exit function"); + } + tcase_add_test (tc_chain, monitors_added); tcase_add_test (tc_chain, monitors_cleanup); diff --git a/validate/tests/check/validate/overrides.c b/validate/tests/check/validate/overrides.c index d4467d30df..d8d4d4133d 100644 --- a/validate/tests/check/validate/overrides.c +++ b/validate/tests/check/validate/overrides.c @@ -99,6 +99,10 @@ gst_validate_suite (void) TCase *tc_chain = tcase_create ("registry"); suite_add_tcase (s, tc_chain); + if (atexit (gst_validate_deinit) != 0) { + GST_ERROR ("failed to set gst_validate_deinit as exit function"); + } + g_setenv ("GST_VALIDATE_REPORTING_DETAILS", "all", TRUE); gst_validate_init (); tcase_add_test (tc_chain, check_text_overrides); diff --git a/validate/tests/check/validate/padmonitor.c b/validate/tests/check/validate/padmonitor.c index f983e72e53..86a58fed61 100644 --- a/validate/tests/check/validate/padmonitor.c +++ b/validate/tests/check/validate/padmonitor.c @@ -1037,6 +1037,10 @@ gst_validate_suite (void) TCase *tc_chain = tcase_create ("padmonitor"); suite_add_tcase (s, tc_chain); + if (atexit (gst_validate_deinit) != 0) { + GST_ERROR ("failed to set gst_validate_deinit as exit function"); + } + fake_elements_register (); tcase_add_test (tc_chain, buffer_before_segment); diff --git a/validate/tests/check/validate/reporting.c b/validate/tests/check/validate/reporting.c index 49c58536d9..b20d5d7399 100644 --- a/validate/tests/check/validate/reporting.c +++ b/validate/tests/check/validate/reporting.c @@ -257,6 +257,10 @@ gst_validate_suite (void) TCase *tc_chain = tcase_create ("reporting"); suite_add_tcase (s, tc_chain); + if (atexit (gst_validate_deinit) != 0) { + GST_ERROR ("failed to set gst_validate_deinit as exit function"); + } + fake_elements_register (); tcase_add_test (tc_chain, test_report_levels_all);