From f9eb3b98f1858e2273696895827af2b9d86bfde1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Sun, 10 Apr 2016 20:45:24 +0100 Subject: [PATCH] tests: collectpads: fix for CK_FORK=no Reset global state when done, and unref sink pads too in teardown function to make it valgrind clean. https://bugzilla.gnome.org/show_bug.cgi?id=623469 --- tests/check/libs/collectpads.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/check/libs/collectpads.c b/tests/check/libs/collectpads.c index 494b3161f1..53a9d4cd7a 100644 --- a/tests/check/libs/collectpads.c +++ b/tests/check/libs/collectpads.c @@ -423,9 +423,14 @@ setup_buffer_cb (void) static void teardown (void) { + gst_object_unref (srcpad1); + gst_object_unref (srcpad2); gst_object_unref (sinkpad1); gst_object_unref (sinkpad2); gst_object_unref (collect); + srcpad1 = srcpad2 = NULL; + sinkpad1 = sinkpad2 = NULL; + collect = NULL; } GST_START_TEST (test_pad_add_remove) @@ -857,6 +862,9 @@ flush_setup (void) g_atomic_int_set (&flush_start_events, 0); g_atomic_int_set (&flush_stop_events, 0); gst_element_set_state (agg, GST_STATE_PLAYING); + outbuf1 = NULL; + outbuf2 = NULL; + collected = FALSE; } static void @@ -869,6 +877,10 @@ flush_teardown (void) gst_object_unref (srcpad2); g_free (data1); g_free (data2); + agg = NULL; + agg_srcpad = NULL; + srcpad1 = srcpad2 = NULL; + data1 = data2 = NULL; } GST_START_TEST (test_flushing_seek_failure) @@ -1071,6 +1083,7 @@ gst_collect_pads_suite (void) suite_add_tcase (suite, general); tcase_add_checked_fixture (general, setup, teardown); tcase_add_test (general, test_pad_add_remove); + tcase_add_test (general, test_collect); tcase_add_test (general, test_collect_eos); tcase_add_test (general, test_collect_twice);