mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
check/gst/gstpad.c (test_get_allowed_caps, test_refcount): Fix borken refcounting.
Original commit message from CVS: 2005-06-23 Andy Wingo <wingo@pobox.com> * check/gst/gstpad.c (test_get_allowed_caps, test_refcount): Fix borken refcounting.
This commit is contained in:
parent
678bb923f1
commit
b8d13efa9d
3 changed files with 7 additions and 14 deletions
|
@ -1,5 +1,8 @@
|
||||||
2005-06-23 Andy Wingo <wingo@pobox.com>
|
2005-06-23 Andy Wingo <wingo@pobox.com>
|
||||||
|
|
||||||
|
* check/gst/gstpad.c (test_get_allowed_caps, test_refcount): Fix
|
||||||
|
borken refcounting.
|
||||||
|
|
||||||
* gst/gstpad.c (gst_pad_set_caps): Remove needless refs,
|
* gst/gstpad.c (gst_pad_set_caps): Remove needless refs,
|
||||||
gst_caps_replace takes care of this for us.
|
gst_caps_replace takes care of this for us.
|
||||||
|
|
||||||
|
|
|
@ -106,9 +106,7 @@ START_TEST (test_refcount)
|
||||||
ASSERT_CAPS_REFCOUNT (caps, "caps", 1);
|
ASSERT_CAPS_REFCOUNT (caps, "caps", 1);
|
||||||
|
|
||||||
gst_pad_set_caps (src, caps);
|
gst_pad_set_caps (src, caps);
|
||||||
gst_caps_unref (caps);
|
|
||||||
gst_pad_set_caps (sink, caps);
|
gst_pad_set_caps (sink, caps);
|
||||||
gst_caps_unref (caps);
|
|
||||||
/* one for me and one for each set_caps */
|
/* one for me and one for each set_caps */
|
||||||
ASSERT_CAPS_REFCOUNT (caps, "caps", 3);
|
ASSERT_CAPS_REFCOUNT (caps, "caps", 3);
|
||||||
|
|
||||||
|
@ -134,7 +132,6 @@ START_TEST (test_get_allowed_caps)
|
||||||
GstCaps *caps, *gotcaps;
|
GstCaps *caps, *gotcaps;
|
||||||
GstBuffer *buffer;
|
GstBuffer *buffer;
|
||||||
GstPadLinkReturn plr;
|
GstPadLinkReturn plr;
|
||||||
int rc;
|
|
||||||
|
|
||||||
ASSERT_CRITICAL (gst_pad_get_allowed_caps (NULL));
|
ASSERT_CRITICAL (gst_pad_get_allowed_caps (NULL));
|
||||||
|
|
||||||
|
@ -151,12 +148,9 @@ START_TEST (test_get_allowed_caps)
|
||||||
fail_unless (caps == NULL);
|
fail_unless (caps == NULL);
|
||||||
|
|
||||||
caps = gst_caps_new_any ();
|
caps = gst_caps_new_any ();
|
||||||
rc = GST_MINI_OBJECT_REFCOUNT_VALUE (caps);
|
|
||||||
|
|
||||||
gst_pad_set_caps (src, caps);
|
gst_pad_set_caps (src, caps);
|
||||||
gst_caps_unref (caps);
|
|
||||||
gst_pad_set_caps (sink, caps);
|
gst_pad_set_caps (sink, caps);
|
||||||
gst_caps_unref (caps);
|
|
||||||
ASSERT_CAPS_REFCOUNT (caps, "caps", 3);
|
ASSERT_CAPS_REFCOUNT (caps, "caps", 3);
|
||||||
|
|
||||||
plr = gst_pad_link (src, sink);
|
plr = gst_pad_link (src, sink);
|
||||||
|
@ -183,7 +177,8 @@ START_TEST (test_get_allowed_caps)
|
||||||
gst_caps_unref (caps);
|
gst_caps_unref (caps);
|
||||||
}
|
}
|
||||||
|
|
||||||
END_TEST Suite * gst_pad_suite (void)
|
END_TEST Suite *
|
||||||
|
gst_pad_suite (void)
|
||||||
{
|
{
|
||||||
Suite *s = suite_create ("GstPad");
|
Suite *s = suite_create ("GstPad");
|
||||||
TCase *tc_chain = tcase_create ("general");
|
TCase *tc_chain = tcase_create ("general");
|
||||||
|
|
|
@ -106,9 +106,7 @@ START_TEST (test_refcount)
|
||||||
ASSERT_CAPS_REFCOUNT (caps, "caps", 1);
|
ASSERT_CAPS_REFCOUNT (caps, "caps", 1);
|
||||||
|
|
||||||
gst_pad_set_caps (src, caps);
|
gst_pad_set_caps (src, caps);
|
||||||
gst_caps_unref (caps);
|
|
||||||
gst_pad_set_caps (sink, caps);
|
gst_pad_set_caps (sink, caps);
|
||||||
gst_caps_unref (caps);
|
|
||||||
/* one for me and one for each set_caps */
|
/* one for me and one for each set_caps */
|
||||||
ASSERT_CAPS_REFCOUNT (caps, "caps", 3);
|
ASSERT_CAPS_REFCOUNT (caps, "caps", 3);
|
||||||
|
|
||||||
|
@ -134,7 +132,6 @@ START_TEST (test_get_allowed_caps)
|
||||||
GstCaps *caps, *gotcaps;
|
GstCaps *caps, *gotcaps;
|
||||||
GstBuffer *buffer;
|
GstBuffer *buffer;
|
||||||
GstPadLinkReturn plr;
|
GstPadLinkReturn plr;
|
||||||
int rc;
|
|
||||||
|
|
||||||
ASSERT_CRITICAL (gst_pad_get_allowed_caps (NULL));
|
ASSERT_CRITICAL (gst_pad_get_allowed_caps (NULL));
|
||||||
|
|
||||||
|
@ -151,12 +148,9 @@ START_TEST (test_get_allowed_caps)
|
||||||
fail_unless (caps == NULL);
|
fail_unless (caps == NULL);
|
||||||
|
|
||||||
caps = gst_caps_new_any ();
|
caps = gst_caps_new_any ();
|
||||||
rc = GST_MINI_OBJECT_REFCOUNT_VALUE (caps);
|
|
||||||
|
|
||||||
gst_pad_set_caps (src, caps);
|
gst_pad_set_caps (src, caps);
|
||||||
gst_caps_unref (caps);
|
|
||||||
gst_pad_set_caps (sink, caps);
|
gst_pad_set_caps (sink, caps);
|
||||||
gst_caps_unref (caps);
|
|
||||||
ASSERT_CAPS_REFCOUNT (caps, "caps", 3);
|
ASSERT_CAPS_REFCOUNT (caps, "caps", 3);
|
||||||
|
|
||||||
plr = gst_pad_link (src, sink);
|
plr = gst_pad_link (src, sink);
|
||||||
|
@ -183,7 +177,8 @@ START_TEST (test_get_allowed_caps)
|
||||||
gst_caps_unref (caps);
|
gst_caps_unref (caps);
|
||||||
}
|
}
|
||||||
|
|
||||||
END_TEST Suite * gst_pad_suite (void)
|
END_TEST Suite *
|
||||||
|
gst_pad_suite (void)
|
||||||
{
|
{
|
||||||
Suite *s = suite_create ("GstPad");
|
Suite *s = suite_create ("GstPad");
|
||||||
TCase *tc_chain = tcase_create ("general");
|
TCase *tc_chain = tcase_create ("general");
|
||||||
|
|
Loading…
Reference in a new issue