From 82da93b31068c7dd1e160978274e45201aabb29c Mon Sep 17 00:00:00 2001 From: Thomas Vander Stichele Date: Mon, 19 Sep 2005 16:12:09 +0000 Subject: [PATCH] check/Makefile.am: have some tests be disabled for valgrinding Original commit message from CVS: * check/Makefile.am: have some tests be disabled for valgrinding * check/elements/vorbisdec.c: (cleanup_vorbisdec), (GST_START_TEST): * ext/vorbis/vorbisdec.c: (vorbisdec_finalize): Fix A Leak. Chain To Parent Finalize. --- ChangeLog | 9 +++++++++ check/Makefile.am | 7 ++++++- check/elements/vorbisdec.c | 3 +++ ext/vorbis/vorbisdec.c | 4 +++- tests/check/Makefile.am | 7 ++++++- tests/check/elements/vorbisdec.c | 3 +++ 6 files changed, 30 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index cf369802ff..53c0057c2b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2005-09-19 Thomas Vander Stichele + + * check/Makefile.am: + have some tests be disabled for valgrinding + * check/elements/vorbisdec.c: (cleanup_vorbisdec), + (GST_START_TEST): + * ext/vorbis/vorbisdec.c: (vorbisdec_finalize): + Fix A Leak. Chain To Parent Finalize. + 2005-09-19 Wim Taymans * examples/seeking/seek.c: (make_wav_pipeline), (main): diff --git a/check/Makefile.am b/check/Makefile.am index 16dd1f9bce..9b5c44f2b8 100644 --- a/check/Makefile.am +++ b/check/Makefile.am @@ -34,6 +34,11 @@ check_PROGRAMS = \ pipelines/simple_launch_lines \ $(check_vorbis) +# tests to fix leaks in +VALGRIND_TO_FIX = \ + elements/audioresample \ + pipelines/simple_launch_lines + # these tests don't even pass # generic/states: elements need state fixin' before this can be added noinst_PROGRAMS = \ @@ -43,6 +48,6 @@ AM_CFLAGS = $(GST_OBJ_CFLAGS) $(GST_CHECK_CFLAGS) $(CHECK_CFLAGS) LDADD = $(GST_OBJ_LIBS) $(GST_CHECK_LIBS) $(CHECK_LIBS) # valgrind testing -VALGRIND_TESTS_DISABLE = +VALGRIND_TESTS_DISABLE = $(VALGRIND_TO_FIX) SUPPRESSIONS = $(top_srcdir)/common/gst.supp diff --git a/check/elements/vorbisdec.c b/check/elements/vorbisdec.c index ea8e403e6f..d704d79e88 100644 --- a/check/elements/vorbisdec.c +++ b/check/elements/vorbisdec.c @@ -82,6 +82,7 @@ void cleanup_vorbisdec (GstElement * vorbisdec) { GST_DEBUG ("cleanup_vorbisdec"); + gst_element_set_state (vorbisdec, GST_STATE_NULL); gst_check_teardown_src_pad (vorbisdec); gst_check_teardown_sink_pad (vorbisdec); @@ -213,11 +214,13 @@ GST_START_TEST (test_identification_header) 1); fail_unless (gst_tag_list_get_string (tag_list, GST_TAG_ARTIST, &artist)); fail_unless_equals_string (artist, "me"); + g_free (artist); fail_unless_equals_int (gst_tag_list_get_tag_size (tag_list, "album"), 0); gst_tag_list_free (tag_list); gst_message_unref (message); /* cleanup */ + gst_bus_set_flushing (bus, TRUE); gst_element_set_bus (vorbisdec, NULL); gst_object_unref (GST_OBJECT (bus)); cleanup_vorbisdec (vorbisdec); diff --git a/ext/vorbis/vorbisdec.c b/ext/vorbis/vorbisdec.c index 52e14a45d3..747ae4cb7e 100644 --- a/ext/vorbis/vorbisdec.c +++ b/ext/vorbis/vorbisdec.c @@ -183,7 +183,7 @@ gst_vorbis_dec_init (GstVorbisDec * dec, GstVorbisDecClass * g_class) static void vorbisdec_finalize (GObject * object) { - /* Release any possibly allocated libvorbis data. + /* Release any possibly allocated libvorbis data. * _clear functions can safely be called multiple times */ GstVorbisDec *vd = GST_VORBIS_DEC (object); @@ -192,6 +192,8 @@ vorbisdec_finalize (GObject * object) vorbis_dsp_clear (&vd->vd); vorbis_comment_clear (&vd->vc); vorbis_info_clear (&vd->vi); + + G_OBJECT_CLASS (parent_class)->finalize (object); } static gboolean diff --git a/tests/check/Makefile.am b/tests/check/Makefile.am index 16dd1f9bce..9b5c44f2b8 100644 --- a/tests/check/Makefile.am +++ b/tests/check/Makefile.am @@ -34,6 +34,11 @@ check_PROGRAMS = \ pipelines/simple_launch_lines \ $(check_vorbis) +# tests to fix leaks in +VALGRIND_TO_FIX = \ + elements/audioresample \ + pipelines/simple_launch_lines + # these tests don't even pass # generic/states: elements need state fixin' before this can be added noinst_PROGRAMS = \ @@ -43,6 +48,6 @@ AM_CFLAGS = $(GST_OBJ_CFLAGS) $(GST_CHECK_CFLAGS) $(CHECK_CFLAGS) LDADD = $(GST_OBJ_LIBS) $(GST_CHECK_LIBS) $(CHECK_LIBS) # valgrind testing -VALGRIND_TESTS_DISABLE = +VALGRIND_TESTS_DISABLE = $(VALGRIND_TO_FIX) SUPPRESSIONS = $(top_srcdir)/common/gst.supp diff --git a/tests/check/elements/vorbisdec.c b/tests/check/elements/vorbisdec.c index ea8e403e6f..d704d79e88 100644 --- a/tests/check/elements/vorbisdec.c +++ b/tests/check/elements/vorbisdec.c @@ -82,6 +82,7 @@ void cleanup_vorbisdec (GstElement * vorbisdec) { GST_DEBUG ("cleanup_vorbisdec"); + gst_element_set_state (vorbisdec, GST_STATE_NULL); gst_check_teardown_src_pad (vorbisdec); gst_check_teardown_sink_pad (vorbisdec); @@ -213,11 +214,13 @@ GST_START_TEST (test_identification_header) 1); fail_unless (gst_tag_list_get_string (tag_list, GST_TAG_ARTIST, &artist)); fail_unless_equals_string (artist, "me"); + g_free (artist); fail_unless_equals_int (gst_tag_list_get_tag_size (tag_list, "album"), 0); gst_tag_list_free (tag_list); gst_message_unref (message); /* cleanup */ + gst_bus_set_flushing (bus, TRUE); gst_element_set_bus (vorbisdec, NULL); gst_object_unref (GST_OBJECT (bus)); cleanup_vorbisdec (vorbisdec);