checks: speed up videoscale unit test a little

Use new gst_element_link_pads_full() function to link elements,
and disable all checks when linking (don't try this at home).

Down to 18s from 3m20s. Scary.
This commit is contained in:
Tim-Philipp Müller 2010-06-26 11:38:56 +01:00
parent 2ced0a3d5d
commit 3563c7c7a5

View file

@ -23,6 +23,9 @@
#include <gst/check/gstcheck.h>
#include <string.h>
/* kids, don't do this at home, skipping checks is *BAD* */
#define LINK_CHECK_FLAGS GST_PAD_LINK_CHECK_NOTHING
static GstCaps **
videoscale_get_allowed_caps (void)
{
@ -151,8 +154,19 @@ run_test (const GstCaps * caps, gint src_width, gint src_height,
gst_bin_add_many (GST_BIN (pipeline), src, ffmpegcolorspace, capsfilter1,
identity, scale, capsfilter2, sink, NULL);
fail_unless (gst_element_link_many (src, ffmpegcolorspace, capsfilter1,
identity, scale, capsfilter2, sink, NULL));
fail_unless (gst_element_link_pads_full (src, "src", ffmpegcolorspace, "sink",
LINK_CHECK_FLAGS));
fail_unless (gst_element_link_pads_full (ffmpegcolorspace, "src", capsfilter1,
"sink", LINK_CHECK_FLAGS));
fail_unless (gst_element_link_pads_full (capsfilter1, "src", identity, "sink",
LINK_CHECK_FLAGS));
fail_unless (gst_element_link_pads_full (identity, "src", scale, "sink",
LINK_CHECK_FLAGS));
fail_unless (gst_element_link_pads_full (scale, "src", capsfilter2, "sink",
LINK_CHECK_FLAGS));
fail_unless (gst_element_link_pads_full (capsfilter2, "src", sink, "sink",
LINK_CHECK_FLAGS));
loop = g_main_loop_new (NULL, FALSE);
@ -434,8 +448,15 @@ _test_negotiation (const gchar * src_templ, const gchar * sink_templ,
gst_bin_add_many (GST_BIN (pipeline), src, capsfilter1, scale, capsfilter2,
sink, NULL);
fail_unless (gst_element_link_many (src, capsfilter1, scale, capsfilter2,
sink, NULL));
fail_unless (gst_element_link_pads_full (src, "src", capsfilter1, "sink",
LINK_CHECK_FLAGS));
fail_unless (gst_element_link_pads_full (capsfilter1, "src", scale, "sink",
LINK_CHECK_FLAGS));
fail_unless (gst_element_link_pads_full (scale, "src", capsfilter2, "sink",
LINK_CHECK_FLAGS));
fail_unless (gst_element_link_pads_full (capsfilter2, "src", sink, "sink",
LINK_CHECK_FLAGS));
loop = g_main_loop_new (NULL, FALSE);