tests: add basic unit test for twolame as well
authorTim-Philipp Müller <tim@centricular.com>
Sat, 26 Aug 2017 09:10:19 +0000 (10:10 +0100)
committerTim-Philipp Müller <tim@centricular.com>
Sat, 26 Aug 2017 09:10:19 +0000 (10:10 +0100)
tests/check/Makefile.am
tests/check/gst-plugins-good.supp
tests/check/pipelines/.gitignore
tests/check/pipelines/lame.c
tests/check/pipelines/twolame.c [new file with mode: 0644]

index 6dd3979..5085eea 100644 (file)
@@ -281,6 +281,12 @@ else
 check_taglib =
 endif
 
+if USE_TWOLAME
+check_twolame = pipelines/twolame
+else
+check_twolame =
+endif
+
 if USE_PLUGIN_UDP
 check_udp = \
         elements/udpsink \
@@ -391,6 +397,7 @@ check_PROGRAMS = \
        $(check_soup) \
        $(check_spectrum) \
        $(check_taglib) \
+       $(check_twolame) \
        $(check_udp) \
        $(check_videobox) \
        $(check_videocrop) \
index 33737bf..a95988e 100644 (file)
    fun:gst_lamemp3enc_sink_event
 }
 
+{
+   <twolame Conditional jump or move depends on uninitialised values>
+   Memcheck:Cond
+   ...
+   fun:psycho_3
+   fun:encode_frame
+}
+
index 4396b2f..2770eda 100644 (file)
@@ -1,6 +1,8 @@
 .dirstamp
 effectv
 flacdec
+lame
+twolame
 simple-launch-lines
 tagschecking
 wavenc
index f60d307..8bba66a 100644 (file)
 #include <gst/check/gstcheck.h>
 #include <gst/check/gstbufferstraw.h>
 
+#ifndef ENCODER
+#define ENCODER "lamemp3enc"
+#endif
+
 #ifndef GST_DISABLE_PARSE
 
 GST_START_TEST (test_format)
@@ -35,7 +39,7 @@ GST_START_TEST (test_format)
 
   pipe_str = g_strdup_printf ("audiotestsrc num-buffers=1 "
       "! audio/x-raw, rate=22050, channels=1 "
-      "! lamemp3enc bitrate=24 ! audio/mpeg,rate=22050 ! fakesink");
+      "! " ENCODER " bitrate=24 ! audio/mpeg,rate=22050 ! fakesink");
 
   bin = gst_parse_launch (pipe_str, &error);
   fail_unless (bin != NULL, "Error parsing pipeline: %s",
@@ -76,7 +80,7 @@ GST_START_TEST (test_caps_proxy)
   pipe_str = g_strdup_printf ("audiotestsrc num-buffers=1 "
       "! audio/x-raw,rate=48000,channels=1 "
       "! audioresample "
-      "! lamemp3enc ! audio/mpeg,rate=(int){22050,44100} ! fakesink");
+      "! " ENCODER " ! audio/mpeg,rate=(int){22050,44100} ! fakesink");
 
   bin = gst_parse_launch (pipe_str, &error);
   fail_unless (bin != NULL, "Error parsing pipeline: %s",
@@ -111,7 +115,7 @@ GST_END_TEST;
 static Suite *
 lame_suite (void)
 {
-  Suite *s = suite_create ("lame");
+  Suite *s = suite_create (ENCODER);
   TCase *tc_chain = tcase_create ("general");
 
   suite_add_tcase (s, tc_chain);
diff --git a/tests/check/pipelines/twolame.c b/tests/check/pipelines/twolame.c
new file mode 100644 (file)
index 0000000..752dcfc
--- /dev/null
@@ -0,0 +1,22 @@
+/* GStreamer unit test for twolame
+ * Copyright (C) 2007 Thomas Vander Stichele <thomas at apestaart dot org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/* pretty lame, I know */
+#define ENCODER "twolamemp2enc"
+#include "lame.c"