mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 20:21:24 +00:00
a21c60b089
Original commit message from CVS: add Element () constructor add testsuite
31 lines
648 B
Python
31 lines
648 B
Python
#!/usr/bin/python
|
|
#
|
|
# testsuite for gstreamer.Element
|
|
|
|
import sys
|
|
from gstreamer import *
|
|
|
|
def fail (message):
|
|
'print reason for failing and leave'
|
|
print "FAILED: %s" % message
|
|
sys.exit (-1)
|
|
|
|
# create an element we know exists
|
|
src = Element ("fakesrc", "source")
|
|
if not src: fail ("Can't create fakesrc Element")
|
|
|
|
# create an element we know doesn't exist
|
|
nope = None
|
|
result = 0
|
|
try:
|
|
nope = Element ("idontexist", "none")
|
|
except RuntimeError: result = 1
|
|
if result == 0: fail ("creating an unexistant element didn't generate a RuntimeError")
|
|
|
|
# create a sink
|
|
sink = Element ("fakesink", "sink")
|
|
|
|
# link
|
|
src.link (sink)
|
|
|
|
sys.exit (0)
|