testsuite/event.py (EventFileSrcTest.setUp): Start the pipeline, so we don't get warnings when sending events
Original commit message from CVS: * testsuite/event.py (EventFileSrcTest.setUp): Start the pipeline, so we don't get warnings when sending events (EventTest.setUp): Ditto. * testsuite/pad.py: New test, only testing simple pad queries so far. * testsuite/Makefile.am (tests): Add missing tests * gst/gst.override (_wrap_gst_pad_query): Raise RuntimeError if the return value is False and only return the queried value.
This commit is contained in:
parent
39381dbd87
commit
0a37fd1928
13
ChangeLog
13
ChangeLog
@ -1,3 +1,16 @@
|
|||||||
|
2004-07-13 Johan Dahlin <johan@gnome.org>
|
||||||
|
|
||||||
|
* testsuite/event.py (EventFileSrcTest.setUp): Start the pipeline,
|
||||||
|
so we don't get warnings when sending events
|
||||||
|
(EventTest.setUp): Ditto.
|
||||||
|
|
||||||
|
* testsuite/pad.py: New test, only testing simple pad queries so far.
|
||||||
|
|
||||||
|
* testsuite/Makefile.am (tests): Add missing tests
|
||||||
|
|
||||||
|
* gst/gst.override (_wrap_gst_pad_query): Raise RuntimeError if
|
||||||
|
the return value is False and only return the queried value.
|
||||||
|
|
||||||
2004-07-02 David Schleef <ds@schleef.org>
|
2004-07-02 David Schleef <ds@schleef.org>
|
||||||
|
|
||||||
* configure.ac: Correctly check for XML tools. Correctly set
|
* configure.ac: Correctly check for XML tools. Correctly set
|
||||||
|
2
common
2
common
@ -1 +1 @@
|
|||||||
Subproject commit 1af22afdec71295108f882c828e08f10d8a3e94b
|
Subproject commit 8f16cd236828a8bb7be51696029e0e24b7a6c517
|
@ -179,9 +179,15 @@ _wrap_gst_pad_query(PyGObject *self, PyObject *args, PyObject *kwargs)
|
|||||||
|
|
||||||
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "ii:GstPad.query", kwlist, &type, &format))
|
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "ii:GstPad.query", kwlist, &type, &format))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
value = 0;
|
value = 0;
|
||||||
ret = gst_pad_query(GST_PAD(self->obj), type, &format, &value);
|
ret = gst_pad_query(GST_PAD(self->obj), type, &format, &value);
|
||||||
return Py_BuildValue("(bL)", ret, value);
|
if (!ret) {
|
||||||
|
PyErr_SetString(PyExc_RuntimeError, "query could not be performed");
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
return PyInt_FromLong(value);
|
||||||
}
|
}
|
||||||
%%
|
%%
|
||||||
override gst_element_query kwargs
|
override gst_element_query kwargs
|
||||||
|
@ -1,9 +1,12 @@
|
|||||||
tests = \
|
tests = \
|
||||||
caps.py \
|
buffer.py \
|
||||||
|
caps.py \
|
||||||
common.py \
|
common.py \
|
||||||
element.py \
|
element.py \
|
||||||
interface.py \
|
event.py \
|
||||||
pipeline.py
|
interface.py \
|
||||||
|
pad.py \
|
||||||
|
pipeline.py
|
||||||
|
|
||||||
check-local:
|
check-local:
|
||||||
@PYTHONPATH=$(top_builddir):$(top_builddir)/gst/.libs $(PYTHON) $(srcdir)/runtests.py
|
@PYTHONPATH=$(top_builddir):$(top_builddir)/gst/.libs $(PYTHON) $(srcdir)/runtests.py
|
||||||
|
@ -6,6 +6,7 @@ class EventTest(unittest.TestCase):
|
|||||||
def setUp(self):
|
def setUp(self):
|
||||||
pipeline = gst.parse_launch('fakesrc ! fakesink name=sink')
|
pipeline = gst.parse_launch('fakesrc ! fakesink name=sink')
|
||||||
self.sink = pipeline.get_by_name('sink')
|
self.sink = pipeline.get_by_name('sink')
|
||||||
|
pipeline.set_state(gst.STATE_PLAYING)
|
||||||
|
|
||||||
def testEventEmpty(self):
|
def testEventEmpty(self):
|
||||||
event = gst.Event(gst.EVENT_EMPTY)
|
event = gst.Event(gst.EVENT_EMPTY)
|
||||||
@ -26,6 +27,7 @@ class EventFileSrcTest(unittest.TestCase):
|
|||||||
self.source = self.pipeline.get_by_name('source')
|
self.source = self.pipeline.get_by_name('source')
|
||||||
self.sink = self.pipeline.get_by_name('sink')
|
self.sink = self.pipeline.get_by_name('sink')
|
||||||
self.sink.connect('handoff', self.handoff_cb)
|
self.sink.connect('handoff', self.handoff_cb)
|
||||||
|
self.pipeline.set_state(gst.STATE_PLAYING)
|
||||||
|
|
||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
assert self.pipeline.set_state(gst.STATE_PLAYING)
|
assert self.pipeline.set_state(gst.STATE_PLAYING)
|
||||||
|
16
testsuite/pad.py
Normal file
16
testsuite/pad.py
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
from common import gst, unittest
|
||||||
|
|
||||||
|
class PadTest(unittest.TestCase):
|
||||||
|
def setUp(self):
|
||||||
|
self.pipeline = gst.parse_launch('fakesrc name=source ! fakesink')
|
||||||
|
src = self.pipeline.get_by_name('source')
|
||||||
|
self.sink = src.get_pad('src')
|
||||||
|
|
||||||
|
def testQuery(self):
|
||||||
|
assert self.sink.query(gst.QUERY_TOTAL, gst.FORMAT_BYTES) == -1
|
||||||
|
assert self.sink.query(gst.QUERY_POSITION, gst.FORMAT_BYTES) == 0
|
||||||
|
assert self.sink.query(gst.QUERY_POSITION, gst.FORMAT_TIME) == 0
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
unittest.main()
|
||||||
|
|
16
testsuite/test_pad.py
Normal file
16
testsuite/test_pad.py
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
from common import gst, unittest
|
||||||
|
|
||||||
|
class PadTest(unittest.TestCase):
|
||||||
|
def setUp(self):
|
||||||
|
self.pipeline = gst.parse_launch('fakesrc name=source ! fakesink')
|
||||||
|
src = self.pipeline.get_by_name('source')
|
||||||
|
self.sink = src.get_pad('src')
|
||||||
|
|
||||||
|
def testQuery(self):
|
||||||
|
assert self.sink.query(gst.QUERY_TOTAL, gst.FORMAT_BYTES) == -1
|
||||||
|
assert self.sink.query(gst.QUERY_POSITION, gst.FORMAT_BYTES) == 0
|
||||||
|
assert self.sink.query(gst.QUERY_POSITION, gst.FORMAT_TIME) == 0
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
unittest.main()
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user