bilboed gst-python: gst-python/ gst-python/gst/ gst-python/testsuite/

[email protected] Thu, 8 Jan 2009 04:25:40 -0800 (PST)
Newsgroups gmane.comp.video.gstreamer.cvs
Message-ID <[email protected]>
CVS Root:       /cvs/gstreamer
Module:         gst-python
Changes by:     bilboed
Date:           Thu Jan 08 2009  12:25:40 UTC

Log message:
* gst/pygstiterator.c: (pygst_iterator_new):
* testsuite/test_iterator.py:
Raise an Exception when wrapping a NULL GstIterator.
Fixes #566903

Modified files:
    .               : ChangeLog
    gst             : pygstiterator.c
    testsuite       : test_iterator.py

Links:
http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-python/ChangeLog.diff?r1=1.708&r2=1.709
http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-python/gst/pygstiterator.c.diff?r1=1.6&r2=1.7
http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-python/testsuite/test_iterator.py.diff?r1=1.3&r2=1.4

====Begin Diffs====
Index: ChangeLog
===================================================================
RCS file: /cvs/gstreamer/gst-python/ChangeLog,v
retrieving revision 1.708
retrieving revision 1.709
diff -u -d -r1.708 -r1.709
--- ChangeLog	5 Jan 2009 11:05:32 -0000	1.708
+++ ChangeLog	8 Jan 2009 12:25:25 -0000	1.709
@@ -1,3 +1,10 @@
+2009-01-08  Edward Hervey  <[email protected]>
+
+	* gst/pygstiterator.c: (pygst_iterator_new):
+	* testsuite/test_iterator.py:
+	Raise an Exception when wrapping a NULL GstIterator.
+	Fixes #566903
 2009-01-05  Alessandro Decina  <[email protected]>
 
 	patch by: Vincent GENIEUX <mutex at runbox dot com>
Index: pygstiterator.c
RCS file: /cvs/gstreamer/gst-python/gst/pygstiterator.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- pygstiterator.c	26 Jun 2008 14:57:28 -0000	1.6
+++ pygstiterator.c	8 Jan 2009 12:25:26 -0000	1.7
@@ -147,6 +147,11 @@
 {
   PyGstIterator *self;
+  if (iter == NULL) {
+      PyErr_SetString (PyExc_TypeError, "Invalid GstIterator (NULL)");
+      return NULL;
+  }
   self = PyObject_NEW (PyGstIterator, &PyGstIterator_Type);
   self->iter = iter;
   GST_DEBUG ("self:%p , iterator:%p, type:%lu",
Index: test_iterator.py
RCS file: /cvs/gstreamer/gst-python/testsuite/test_iterator.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- test_iterator.py	11 Oct 2005 12:42:53 -0000	1.3
+++ test_iterator.py	8 Jan 2009 12:25:26 -0000	1.4
@@ -107,4 +107,11 @@
             break
         else:
             raise AssertionError
-    
+    def testInvalidIterator(self):
+        p = gst.Pad("p", gst.PAD_SRC)
+        # The C function will return NULL, we should
+        # therefore have an exception raised
+        self.assertRaises(TypeError, p.iterate_internal_links)
+        del p

------------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB