[gst-cvs] gst-python: make sure that we actually get the clock-provide message
Thomas Vander Stichele
thomasvs at kemper.freedesktop.org
Wed Apr 15 13:43:13 PDT 2009
Module: gst-python
Branch: master
Commit: f99e67aa24878d26dbd7f494f310bb466c5bd1cd
URL: http://cgit.freedesktop.org/gstreamer/gst-python/commit/?id=f99e67aa24878d26dbd7f494f310bb466c5bd1cd
Author: Thomas Vander Stichele <thomas (at) apestaart (dot) org>
Date: Thu Apr 2 18:06:12 2009 +0200
make sure that we actually get the clock-provide message
---
testsuite/test_pipeline.py | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/testsuite/test_pipeline.py b/testsuite/test_pipeline.py
index 77f84da..a84b988 100644
--- a/testsuite/test_pipeline.py
+++ b/testsuite/test_pipeline.py
@@ -168,17 +168,17 @@ class TestPipeSub(gst.Pipeline):
def do_handle_message(self, message):
self.debug('do_handle_message')
gst.Pipeline.do_handle_message(self, message)
- self.message = True
+ self.type = message.type
gobject.type_register(TestPipeSub)
class TestPipeSubSub(TestPipeSub):
def do_handle_message(self, message):
self.debug('do_handle_message')
TestPipeSub.do_handle_message(self, message)
- self.message = True
gobject.type_register(TestPipeSubSub)
+# see http://bugzilla.gnome.org/show_bug.cgi?id=577735
class TestSubClass(TestCase):
def setUp(self):
self.gctrack()
@@ -191,20 +191,25 @@ class TestSubClass(TestCase):
p = TestPipeSub()
u = gst.element_factory_make('uridecodebin')
self.assertEquals(u.__grefcount__, 1)
+ self.failIf(getattr(p, 'type', None))
# adding uridecodebin triggers a clock-provide message;
# this message should be dropped, and thus not affect
# the refcount of u beyond the parenting.
p.add(u)
- self.failUnless(getattr(p, 'message'))
+ self.assertEquals(getattr(p, 'type', None), gst.MESSAGE_CLOCK_PROVIDE)
self.assertEquals(u.__grefcount__, 2)
del p
self.assertEquals(u.__grefcount__, 1)
def testSubSubClass(self):
+ # Edward is worried that a subclass of a subclass will screw up
+ # the refcounting wrt. GST_BUS_DROP
p = TestPipeSubSub()
u = gst.element_factory_make('uridecodebin')
self.assertEquals(u.__grefcount__, 1)
+ self.failIf(getattr(p, 'type', None))
p.add(u)
+ self.assertEquals(getattr(p, 'type', None), gst.MESSAGE_CLOCK_PROVIDE)
self.assertEquals(u.__grefcount__, 2)
del p
self.assertEquals(u.__grefcount__, 1)
More information about the Gstreamer-commits
mailing list