From 9cc395a589f5ede9d68eaf89def96e58b989d76e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Sat, 26 Aug 2017 10:10:19 +0100 Subject: [PATCH] tests: add basic unit test for twolame as well --- tests/check/Makefile.am | 7 +++++++ tests/check/gst-plugins-good.supp | 8 ++++++++ tests/check/pipelines/.gitignore | 2 ++ tests/check/pipelines/lame.c | 10 +++++++--- tests/check/pipelines/twolame.c | 22 ++++++++++++++++++++++ 5 files changed, 46 insertions(+), 3 deletions(-) create mode 100644 tests/check/pipelines/twolame.c diff --git a/tests/check/Makefile.am b/tests/check/Makefile.am index 6dd397947f..5085eea5f5 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 33737bf5a1..a95988ea9b 100644 --- a/tests/check/gst-plugins-good.supp +++ b/tests/check/gst-plugins-good.supp @@ -155,3 +155,11 @@ fun:gst_lamemp3enc_sink_event } +{ + + Memcheck:Cond + ... + fun:psycho_3 + fun:encode_frame +} + diff --git a/tests/check/pipelines/.gitignore b/tests/check/pipelines/.gitignore index 4396b2fa18..2770edaf5c 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 f60d3070bb..8bba66a67f 100644 --- a/tests/check/pipelines/lame.c +++ b/tests/check/pipelines/lame.c @@ -23,6 +23,10 @@ #include #include +#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 0000000000..752dcfc85c --- /dev/null +++ b/tests/check/pipelines/twolame.c @@ -0,0 +1,22 @@ +/* GStreamer unit test for twolame + * Copyright (C) 2007 Thomas Vander Stichele + * + * 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"