check/Makefile.am: have some tests be disabled for valgrinding
authorThomas Vander Stichele <thomas@apestaart.org>
Mon, 19 Sep 2005 16:12:09 +0000 (16:12 +0000)
committerThomas Vander Stichele <thomas@apestaart.org>
Mon, 19 Sep 2005 16:12:09 +0000 (16:12 +0000)
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
check/Makefile.am
check/elements/vorbisdec.c
ext/vorbis/vorbisdec.c
tests/check/Makefile.am
tests/check/elements/vorbisdec.c

index cf36980..53c0057 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2005-09-19  Thomas Vander Stichele  <thomas at apestaart dot org>
+
+       * 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  <wim@fluendo.com>
 
        * examples/seeking/seek.c: (make_wav_pipeline), (main):
index 16dd1f9..9b5c44f 100644 (file)
@@ -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
index ea8e403..d704d79 100644 (file)
@@ -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);
index 52e14a4..747ae4c 100644 (file)
@@ -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
index 16dd1f9..9b5c44f 100644 (file)
@@ -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
index ea8e403..d704d79 100644 (file)
@@ -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);