testsuite/test_caps.py: Add test for gst.Buffer in caps.
authorMichael Smith <msmith@xiph.org>
Sat, 24 Feb 2007 14:14:14 +0000 (14:14 +0000)
committerMichael Smith <msmith@xiph.org>
Sat, 24 Feb 2007 14:14:14 +0000 (14:14 +0000)
Original commit message from CVS:
* testsuite/test_caps.py:
Add test for gst.Buffer in caps.

ChangeLog
testsuite/test_caps.py

index 81176d4..6b2a651 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2007-02-24  Michael Smith  <msmith@fluendo.com>
+
+       * testsuite/test_caps.py:
+         Add test for gst.Buffer in caps.
+
 2007-02-22  Michael Smith  <msmith@fluendo.com>
 
        * gst/pygstvalue.c: (pygst_value_as_pyobject),
index 016d61d..2eb33d0 100644 (file)
@@ -47,6 +47,17 @@ class CapsTest(TestCase):
         mime = structure.get_name()
         assert mime == 'video/x-raw-rgb'
 
+    def testCapsContainingMiniObjects(self):
+        # buffer contains hex encoding of ascii 'abcd'
+        caps = gst.Caps("video/x-raw-yuv, buf=(buffer)61626364")
+        assert isinstance(caps[0]['buf'], gst.Buffer)
+
+        buf = gst.Buffer("1234")
+        caps[0]['buf2'] = buf
+        buf2 = caps[0]['buf2']
+        assert buf2 == buf
+
+
     def testCapsConstructEmpty(self):
         caps = gst.Caps()
         assert isinstance(caps, gst.Caps)
@@ -90,7 +101,7 @@ class CapsTest(TestCase):
         assert isinstance(struct['height'], float)
         assert struct['height'] == 20.0
 
-    def testCapsRefernceStructs(self):
+    def testCapsReferenceStructs(self):
         'test that shows why it\'s not a good idea to use structures by reference'
         caps = gst.Caps('hi/mom,width=0')
         structure = caps[0]