summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim-Philipp Müller <tim.muller@collabora.co.uk>2009-08-14 13:45:08 +0100
committerTim-Philipp Müller <tim.muller@collabora.co.uk>2009-08-14 13:47:18 +0100
commit80e43452a1e9ffd11d105d31d75aa72217352268 (patch)
treed4187a11e06902c7bf69d391fde25e8d17c3c0c4
parent7f569ca9c8c51ab4750c20771f37e0beeca3b050 (diff)
checks: add test for leak to rtpbin unit test
See #591476.
-rw-r--r--tests/check/elements/rtpbin.c40
1 files changed, 39 insertions, 1 deletions
diff --git a/tests/check/elements/rtpbin.c b/tests/check/elements/rtpbin.c
index 8764da54a..2666fe457 100644
--- a/tests/check/elements/rtpbin.c
+++ b/tests/check/elements/rtpbin.c
@@ -389,7 +389,44 @@ GST_START_TEST (test_cleanup_recv2)
GST_END_TEST;
-Suite *
+GST_START_TEST (test_request_pad_by_template_name)
+{
+ GstElement *rtpbin;
+ GstPad *rtp_sink1, *rtp_sink2, *rtp_sink3;
+
+ rtpbin = gst_element_factory_make ("gstrtpbin", "rtpbin");
+ rtp_sink1 = gst_element_get_request_pad (rtpbin, "recv_rtp_sink_%d");
+ fail_unless (rtp_sink1 != NULL);
+ fail_unless_equals_string (GST_PAD_NAME (rtp_sink1), "recv_rtp_sink_0");
+ ASSERT_OBJECT_REFCOUNT (rtp_sink1, "rtp_sink1", 2);
+
+ rtp_sink2 = gst_element_get_request_pad (rtpbin, "recv_rtp_sink_%d");
+ fail_unless (rtp_sink2 != NULL);
+ fail_unless_equals_string (GST_PAD_NAME (rtp_sink2), "recv_rtp_sink_1");
+ ASSERT_OBJECT_REFCOUNT (rtp_sink2, "rtp_sink2", 2);
+
+ rtp_sink3 = gst_element_get_request_pad (rtpbin, "recv_rtp_sink_%d");
+ fail_unless (rtp_sink3 != NULL);
+ fail_unless_equals_string (GST_PAD_NAME (rtp_sink3), "recv_rtp_sink_2");
+ ASSERT_OBJECT_REFCOUNT (rtp_sink3, "rtp_sink3", 2);
+
+
+ gst_element_release_request_pad (rtpbin, rtp_sink2);
+ gst_element_release_request_pad (rtpbin, rtp_sink1);
+ gst_element_release_request_pad (rtpbin, rtp_sink3);
+ ASSERT_OBJECT_REFCOUNT (rtp_sink3, "rtp_sink3", 1);
+ ASSERT_OBJECT_REFCOUNT (rtp_sink2, "rtp_sink2", 1);
+ ASSERT_OBJECT_REFCOUNT (rtp_sink1, "rtp_sink", 1);
+ gst_object_unref (rtp_sink1);
+ gst_object_unref (rtp_sink2);
+ gst_object_unref (rtp_sink3);
+
+ gst_object_unref (rtpbin);
+}
+
+GST_END_TEST;
+
+static Suite *
gstrtpbin_suite (void)
{
Suite *s = suite_create ("gstrtpbin");
@@ -399,6 +436,7 @@ gstrtpbin_suite (void)
tcase_add_test (tc_chain, test_cleanup_send);
tcase_add_test (tc_chain, test_cleanup_recv);
tcase_add_test (tc_chain, test_cleanup_recv2);
+ tcase_add_test (tc_chain, test_request_pad_by_template_name);
return s;
}