From: Tim-Philipp Müller Date: Thu, 24 Aug 2006 12:30:04 +0000 (+0000) Subject: tests/check/gst/gstcaps.c: Don't leak caps in unit test; add a few more simple checks. X-Git-Tag: RELEASE-0_10_10~33 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e8578fd5cf6f77b4f256453471715dc9bb4ec12b;p=platform%2Fupstream%2Fgstreamer.git tests/check/gst/gstcaps.c: Don't leak caps in unit test; add a few more simple checks. Original commit message from CVS: * tests/check/gst/gstcaps.c: (GST_START_TEST): Don't leak caps in unit test; add a few more simple checks. --- diff --git a/ChangeLog b/ChangeLog index 0139ede..e3731bd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2006-08-24 Tim-Philipp Müller + + * tests/check/gst/gstcaps.c: (GST_START_TEST): + Don't leak caps in unit test; add a few more simple + checks. + 2006-08-24 Stefan Kost * docs/gst/gstreamer-sections.txt: diff --git a/tests/check/gst/gstcaps.c b/tests/check/gst/gstcaps.c index fc0d7d4..1d56d00 100644 --- a/tests/check/gst/gstcaps.c +++ b/tests/check/gst/gstcaps.c @@ -401,6 +401,7 @@ GST_START_TEST (test_merge_same) gst_caps_merge (c2, c1); GST_DEBUG ("merged: (%d) %" GST_PTR_FORMAT, gst_caps_get_size (c2), c2); fail_unless (gst_caps_get_size (c2) == 1, NULL); + gst_caps_unref (c2); /* and so is this */ c1 = gst_caps_from_string ("audio/x-raw-int,rate=44100,channels=1"); @@ -408,7 +409,34 @@ GST_START_TEST (test_merge_same) gst_caps_merge (c2, c1); GST_DEBUG ("merged: (%d) %" GST_PTR_FORMAT, gst_caps_get_size (c2), c2); fail_unless (gst_caps_get_size (c2) == 1, NULL); + gst_caps_unref (c2); + c1 = gst_caps_from_string ("video/x-foo, data=(buffer)AA"); + c2 = gst_caps_from_string ("video/x-foo, data=(buffer)AABB"); + gst_caps_merge (c2, c1); + GST_DEBUG ("merged: (%d) %" GST_PTR_FORMAT, gst_caps_get_size (c2), c2); + fail_unless (gst_caps_get_size (c2) == 2, NULL); + gst_caps_unref (c2); + + c1 = gst_caps_from_string ("video/x-foo, data=(buffer)AABB"); + c2 = gst_caps_from_string ("video/x-foo, data=(buffer)AA"); + gst_caps_merge (c2, c1); + GST_DEBUG ("merged: (%d) %" GST_PTR_FORMAT, gst_caps_get_size (c2), c2); + fail_unless (gst_caps_get_size (c2) == 2, NULL); + gst_caps_unref (c2); + + c1 = gst_caps_from_string ("video/x-foo, data=(buffer)AA"); + c2 = gst_caps_from_string ("video/x-foo, data=(buffer)AA"); + gst_caps_merge (c2, c1); + GST_DEBUG ("merged: (%d) %" GST_PTR_FORMAT, gst_caps_get_size (c2), c2); + fail_unless (gst_caps_get_size (c2) == 1, NULL); + gst_caps_unref (c2); + + c1 = gst_caps_from_string ("video/x-foo, data=(buffer)AA"); + c2 = gst_caps_from_string ("video/x-bar, data=(buffer)AA"); + gst_caps_merge (c2, c1); + GST_DEBUG ("merged: (%d) %" GST_PTR_FORMAT, gst_caps_get_size (c2), c2); + fail_unless (gst_caps_get_size (c2) == 2, NULL); gst_caps_unref (c2); } @@ -424,6 +452,7 @@ GST_START_TEST (test_merge_subset) gst_caps_merge (c2, c1); GST_DEBUG ("merged: (%d) %" GST_PTR_FORMAT, gst_caps_get_size (c2), c2); fail_unless (gst_caps_get_size (c2) == 1, NULL); + gst_caps_unref (c2); /* here it is not */ c2 = gst_caps_from_string ("audio/x-raw-int,channels=1,rate=44100");