tests/check/gst/gstpad.c: Fix leak in test.

Original commit message from CVS:
* tests/check/gst/gstpad.c: (GST_START_TEST):
Fix leak in test.
This commit is contained in:
Wim Taymans 2006-07-21 10:38:53 +00:00
parent 04ed9e8f34
commit 626d7a1fb2
2 changed files with 13 additions and 1 deletions

View file

@ -1,3 +1,8 @@
2006-07-21 Wim Taymans <wim@fluendo.com>
* tests/check/gst/gstpad.c: (GST_START_TEST):
Fix leak in test.
2006-07-20 Stefan Kost <ensonic@users.sf.net> 2006-07-20 Stefan Kost <ensonic@users.sf.net>
* gst/gstparse.c: (gst_parse_launch): * gst/gstparse.c: (gst_parse_launch):

View file

@ -90,6 +90,7 @@ GST_START_TEST (test_link_unlink_threaded)
caps = gst_caps_from_string ("foo/bar"); caps = gst_caps_from_string ("foo/bar");
gst_pad_set_caps (src, caps); gst_pad_set_caps (src, caps);
gst_pad_set_caps (sink, caps); gst_pad_set_caps (sink, caps);
ASSERT_CAPS_REFCOUNT (caps, "caps", 3);
MAIN_START_THREADS (5, thread_link_unlink, NULL); MAIN_START_THREADS (5, thread_link_unlink, NULL);
for (i = 0; i < 1000; ++i) { for (i = 0; i < 1000; ++i) {
@ -98,6 +99,13 @@ GST_START_TEST (test_link_unlink_threaded)
THREAD_SWITCH (); THREAD_SWITCH ();
} }
MAIN_STOP_THREADS (); MAIN_STOP_THREADS ();
ASSERT_CAPS_REFCOUNT (caps, "caps", 3);
gst_caps_unref (caps);
ASSERT_CAPS_REFCOUNT (caps, "caps", 2);
gst_object_unref (src);
gst_object_unref (sink);
} }
GST_END_TEST; GST_END_TEST;
@ -437,7 +445,6 @@ GST_START_TEST (test_flowreturn)
fail_if (strcmp (gst_flow_get_name (ret), "unknown")); fail_if (strcmp (gst_flow_get_name (ret), "unknown"));
quark = gst_flow_to_quark (ret); quark = gst_flow_to_quark (ret);
fail_unless (quark == 0); fail_unless (quark == 0);
} }
GST_END_TEST; GST_END_TEST;