summaryrefslogtreecommitdiff
path: root/tests/check/gst/gstghostpad.c
diff options
context:
space:
mode:
authorSebastian Dröge <slomo@circular-chaos.org>2008-06-24 07:49:36 +0000
committerSebastian Dröge <slomo@circular-chaos.org>2008-06-24 07:49:36 +0000
commit7c0bd009ce429ac1eadc69128ab8a9337e4585b9 (patch)
treebf78d664eb1232a89e32ba45182687ac543b70ed /tests/check/gst/gstghostpad.c
parent15b694fc7a029ee18354af9458b4c43a52bd8fc8 (diff)
downloadgstreamer-7c0bd009ce429ac1eadc69128ab8a9337e4585b9.tar.gz
tests/check/gst/gstghostpad.c: Fix some memory leaks and uses of object instances that we don't actually own.
Original commit message from CVS: * tests/check/gst/gstghostpad.c: (GST_START_TEST): Fix some memory leaks and uses of object instances that we don't actually own.
Diffstat (limited to 'tests/check/gst/gstghostpad.c')
-rw-r--r--tests/check/gst/gstghostpad.c54
1 files changed, 51 insertions, 3 deletions
diff --git a/tests/check/gst/gstghostpad.c b/tests/check/gst/gstghostpad.c
index aaf34cba4c..b5a28c9c08 100644
--- a/tests/check/gst/gstghostpad.c
+++ b/tests/check/gst/gstghostpad.c
@@ -26,7 +26,9 @@
GST_START_TEST (test_remove1)
{
GstElement *b1, *b2, *src, *sink;
+
GstPad *srcpad, *sinkpad;
+
GstPadLinkReturn ret;
b1 = gst_element_factory_make ("pipeline", NULL);
@@ -78,7 +80,9 @@ GST_END_TEST;
GST_START_TEST (test_remove2)
{
GstElement *b1, *b2, *src, *sink;
+
GstPad *srcpad, *sinkpad;
+
GstPadLinkReturn ret;
b1 = gst_element_factory_make ("pipeline", NULL);
@@ -151,10 +155,15 @@ GST_END_TEST;
GST_START_TEST (test_ghost_pads_notarget)
{
GstElement *b1, *b2, *sink;
+
GstPad *srcpad, *sinkpad, *peer;
+
GstPadLinkReturn ret;
+
gboolean bret;
+
GstBus *bus;
+
GstCaps *caps;
b1 = gst_element_factory_make ("pipeline", NULL);
@@ -214,7 +223,9 @@ GST_END_TEST;
GST_START_TEST (test_link)
{
GstElement *b1, *b2, *src, *sink;
+
GstPad *srcpad, *sinkpad, *gpad;
+
GstPadLinkReturn ret;
b1 = gst_element_factory_make ("pipeline", NULL);
@@ -269,7 +280,9 @@ GST_END_TEST;
GST_START_TEST (test_ghost_pads)
{
GstElement *b1, *b2, *src, *i1, *sink;
+
GstPad *gsink, *gsrc, *gisrc, *gisink, *isink, *isrc, *fsrc, *fsink;
+
GstStateChangeReturn ret;
b1 = gst_element_factory_make ("pipeline", NULL);
@@ -373,11 +386,17 @@ GST_END_TEST;
GST_START_TEST (test_ghost_pads_bin)
{
GstBin *pipeline;
+
GstBin *srcbin;
+
GstBin *sinkbin;
+
GstElement *src;
+
GstElement *sink;
+
GstPad *srcpad, *srcghost, *target;
+
GstPad *sinkpad, *sinkghost;
pipeline = GST_BIN (gst_pipeline_new ("pipe"));
@@ -443,10 +462,15 @@ block_callback (GstPad * pad, gboolean blocked, gpointer user_data)
GST_START_TEST (test_ghost_pads_block)
{
GstBin *pipeline;
+
GstBin *srcbin;
+
GstElement *src;
+
GstPad *srcpad;
+
GstPad *srcghost;
+
BlockData block_data;
pipeline = GST_BIN (gst_pipeline_new ("pipeline"));
@@ -484,10 +508,15 @@ GST_END_TEST;
GST_START_TEST (test_ghost_pads_probes)
{
GstBin *pipeline;
+
GstBin *srcbin;
+
GstElement *src;
+
GstPad *srcpad;
+
GstPad *srcghost;
+
BlockData block_data;
pipeline = GST_BIN (gst_pipeline_new ("pipeline"));
@@ -525,7 +554,9 @@ GST_END_TEST;
GST_START_TEST (test_ghost_pads_new_from_template)
{
GstPad *sinkpad, *ghostpad;
+
GstPadTemplate *padtempl, *ghosttempl;
+
GstCaps *padcaps, *ghostcaps, *newcaps;
padcaps = gst_caps_from_string ("some/caps");
@@ -534,7 +565,7 @@ GST_START_TEST (test_ghost_pads_new_from_template)
fail_unless (ghostcaps != NULL);
padtempl = gst_pad_template_new ("padtempl", GST_PAD_SINK,
- GST_PAD_ALWAYS, padcaps);
+ GST_PAD_ALWAYS, gst_caps_copy (padcaps));
fail_unless (padtempl != NULL);
ghosttempl = gst_pad_template_new ("ghosttempl", GST_PAD_SINK,
GST_PAD_ALWAYS, ghostcaps);
@@ -554,6 +585,12 @@ GST_START_TEST (test_ghost_pads_new_from_template)
fail_unless (gst_caps_is_equal (newcaps, padcaps));
gst_caps_unref (newcaps);
gst_caps_unref (padcaps);
+
+ gst_object_unref (sinkpad);
+ gst_object_unref (ghostpad);
+
+ gst_object_unref (padtempl);
+ gst_object_unref (ghosttempl);
}
GST_END_TEST;
@@ -561,7 +598,9 @@ GST_END_TEST;
GST_START_TEST (test_ghost_pads_new_no_target_from_template)
{
GstPad *sinkpad, *ghostpad;
+
GstPadTemplate *padtempl, *ghosttempl;
+
GstCaps *padcaps, *ghostcaps, *newcaps;
padcaps = gst_caps_from_string ("some/caps");
@@ -570,10 +609,10 @@ GST_START_TEST (test_ghost_pads_new_no_target_from_template)
fail_unless (ghostcaps != NULL);
padtempl = gst_pad_template_new ("padtempl", GST_PAD_SINK,
- GST_PAD_ALWAYS, padcaps);
+ GST_PAD_ALWAYS, gst_caps_copy (padcaps));
fail_unless (padtempl != NULL);
ghosttempl = gst_pad_template_new ("ghosttempl", GST_PAD_SINK,
- GST_PAD_ALWAYS, ghostcaps);
+ GST_PAD_ALWAYS, gst_caps_copy (ghostcaps));
sinkpad = gst_pad_new_from_template (padtempl, "sinkpad");
fail_unless (sinkpad != NULL);
@@ -598,6 +637,14 @@ GST_START_TEST (test_ghost_pads_new_no_target_from_template)
fail_unless (gst_caps_is_equal (newcaps, padcaps));
gst_caps_unref (newcaps);
+ gst_object_unref (sinkpad);
+ gst_object_unref (ghostpad);
+
+ gst_object_unref (padtempl);
+ gst_object_unref (ghosttempl);
+
+ gst_caps_unref (padcaps);
+ gst_caps_unref (ghostcaps);
}
GST_END_TEST;
@@ -606,6 +653,7 @@ static Suite *
gst_ghost_pad_suite (void)
{
Suite *s = suite_create ("GstGhostPad");
+
TCase *tc_chain = tcase_create ("ghost pad tests");
suite_add_tcase (s, tc_chain);