summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorTim-Philipp Müller <tim@centricular.com>2017-08-26 10:10:19 +0100
committerTim-Philipp Müller <tim@centricular.com>2017-08-26 10:10:19 +0100
commit9cc395a589f5ede9d68eaf89def96e58b989d76e (patch)
treec55873cc5e7f7334460bf7624b442f9d6a76c614 /tests
parent60b6128d0cbe850f44a9e0619fcc5df6b12a8bdd (diff)
tests: add basic unit test for twolame as well
Diffstat (limited to 'tests')
-rw-r--r--tests/check/Makefile.am7
-rw-r--r--tests/check/gst-plugins-good.supp8
-rw-r--r--tests/check/pipelines/.gitignore2
-rw-r--r--tests/check/pipelines/lame.c10
-rw-r--r--tests/check/pipelines/twolame.c22
5 files changed, 46 insertions, 3 deletions
diff --git a/tests/check/Makefile.am b/tests/check/Makefile.am
index 6dd397947..5085eea5f 100644
--- a/tests/check/Makefile.am
+++ b/tests/check/Makefile.am
@@ -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) \
diff --git a/tests/check/gst-plugins-good.supp b/tests/check/gst-plugins-good.supp
index 33737bf5a..a95988ea9 100644
--- a/tests/check/gst-plugins-good.supp
+++ b/tests/check/gst-plugins-good.supp
@@ -155,3 +155,11 @@
fun:gst_lamemp3enc_sink_event
}
+{
+ <twolame Conditional jump or move depends on uninitialised values>
+ Memcheck:Cond
+ ...
+ fun:psycho_3
+ fun:encode_frame
+}
+
diff --git a/tests/check/pipelines/.gitignore b/tests/check/pipelines/.gitignore
index 4396b2fa1..2770edaf5 100644
--- a/tests/check/pipelines/.gitignore
+++ b/tests/check/pipelines/.gitignore
@@ -1,6 +1,8 @@
.dirstamp
effectv
flacdec
+lame
+twolame
simple-launch-lines
tagschecking
wavenc
diff --git a/tests/check/pipelines/lame.c b/tests/check/pipelines/lame.c
index f60d3070b..8bba66a67 100644
--- a/tests/check/pipelines/lame.c
+++ b/tests/check/pipelines/lame.c
@@ -23,6 +23,10 @@
#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
index 000000000..752dcfc85
--- /dev/null
+++ b/tests/check/pipelines/twolame.c
@@ -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"