tests/check/gst/gstcaps.c: Don't leak caps in unit test; add a few more simple checks.
authorTim-Philipp Müller <tim@centricular.net>
Thu, 24 Aug 2006 12:30:04 +0000 (12:30 +0000)
committerTim-Philipp Müller <tim@centricular.net>
Thu, 24 Aug 2006 12:30:04 +0000 (12:30 +0000)
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.

ChangeLog
tests/check/gst/gstcaps.c

index 0139ede..e3731bd 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2006-08-24  Tim-Philipp Müller  <tim at centricular dot net>
+
+       * 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  <ensonic@users.sf.net>
 
        * docs/gst/gstreamer-sections.txt:
index fc0d7d4..1d56d00 100644 (file)
@@ -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");