diff --git a/livesupport/modules/gstreamerElements/src/MinimalAudioSmilTest.cxx b/livesupport/modules/gstreamerElements/src/MinimalAudioSmilTest.cxx index ea0c1950e..d5933af1e 100644 --- a/livesupport/modules/gstreamerElements/src/MinimalAudioSmilTest.cxx +++ b/livesupport/modules/gstreamerElements/src/MinimalAudioSmilTest.cxx @@ -22,7 +22,7 @@ Author : $Author: maroy $ - Version : $Revision: 1.3 $ + Version : $Revision: 1.4 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/gstreamerElements/src/MinimalAudioSmilTest.cxx,v $ ------------------------------------------------------------------------------*/ @@ -62,12 +62,31 @@ CPPUNIT_TEST_SUITE_REGISTRATION(MinimalAudioSmilTest); */ static const char * simpleFile = "var/simple.smil"; +/** + * A simple smil file with clipBegin and clipEnd attributes + */ +static const char * simpleClipBeginFile = + "var/simple-clipBegin.smil"; + +/** + * A simple smil file with clipBegin and clipEnd attributes + */ +static const char * simpleClipBeginEndFile = + "var/simple-clipBegin-clipEnd.smil"; + /** * A parallel smil file. */ static const char * parallelFile = "var/parallel.smil"; +/** + * A parallel smil file with clipBegin and clipEnd attributes. + */ +static const char * parallelClipBeginEndFile = + "var/parallel-clipBegin-clipEnd.smil"; + + /* =============================================== local function prototypes */ @@ -150,6 +169,36 @@ MinimalAudioSmilTest :: firstTest(void) } +/*------------------------------------------------------------------------------ + * A simple test with clipBegin attribute + *----------------------------------------------------------------------------*/ +void +MinimalAudioSmilTest :: simpleClipBeginTest(void) + throw (CPPUNIT_NS::Exception) +{ + gint64 timePlayed; + + timePlayed = playSmilFile(simpleClipBeginFile); + CPPUNIT_ASSERT(timePlayed > 4.9 * GST_SECOND); + CPPUNIT_ASSERT(timePlayed < 5.1 * GST_SECOND); +} + + +/*------------------------------------------------------------------------------ + * A simple test with clipBegin and clipEnd attributes + *----------------------------------------------------------------------------*/ +void +MinimalAudioSmilTest :: simpleClipBeginEndTest(void) + throw (CPPUNIT_NS::Exception) +{ + gint64 timePlayed; + + timePlayed = playSmilFile(simpleClipBeginEndFile); + CPPUNIT_ASSERT(timePlayed > 4.9 * GST_SECOND); + CPPUNIT_ASSERT(timePlayed < 5.1 * GST_SECOND); +} + + /*------------------------------------------------------------------------------ * Test SMIL elements *----------------------------------------------------------------------------*/ @@ -164,3 +213,18 @@ MinimalAudioSmilTest :: parallelTest(void) CPPUNIT_ASSERT(timePlayed < 8.1 * GST_SECOND); } + +/*------------------------------------------------------------------------------ + * Test SMIL elements with clipBegin and clipEnd attributes + *----------------------------------------------------------------------------*/ +void +MinimalAudioSmilTest :: parallelClipBeginEndTest(void) + throw (CPPUNIT_NS::Exception) +{ + gint64 timePlayed; + + timePlayed = playSmilFile(parallelClipBeginEndFile); + CPPUNIT_ASSERT(timePlayed > 7.9 * GST_SECOND); + CPPUNIT_ASSERT(timePlayed < 8.1 * GST_SECOND); +} + diff --git a/livesupport/modules/gstreamerElements/src/MinimalAudioSmilTest.h b/livesupport/modules/gstreamerElements/src/MinimalAudioSmilTest.h index 75303afdc..01c41902a 100644 --- a/livesupport/modules/gstreamerElements/src/MinimalAudioSmilTest.h +++ b/livesupport/modules/gstreamerElements/src/MinimalAudioSmilTest.h @@ -22,7 +22,7 @@ Author : $Author: maroy $ - Version : $Revision: 1.3 $ + Version : $Revision: 1.4 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/gstreamerElements/src/MinimalAudioSmilTest.h,v $ ------------------------------------------------------------------------------*/ @@ -58,13 +58,16 @@ namespace GstreamerElements { * Unit test for the partialplay gstreamer element. * * @author $Author: maroy $ - * @version $Revision: 1.3 $ + * @version $Revision: 1.4 $ */ class MinimalAudioSmilTest : public CPPUNIT_NS::TestFixture { CPPUNIT_TEST_SUITE(MinimalAudioSmilTest); CPPUNIT_TEST(firstTest); + CPPUNIT_TEST(simpleClipBeginTest); + CPPUNIT_TEST(simpleClipBeginEndTest); CPPUNIT_TEST(parallelTest); + CPPUNIT_TEST(parallelClipBeginEndTest); CPPUNIT_TEST_SUITE_END(); private: @@ -91,6 +94,22 @@ class MinimalAudioSmilTest : public CPPUNIT_NS::TestFixture void firstTest(void) throw (CPPUNIT_NS::Exception); + /** + * A simple test with clipBegin attribute. + * + * @exception CPPUNIT_NS::Exception on test failures. + */ + void + simpleClipBeginTest(void) throw (CPPUNIT_NS::Exception); + + /** + * A simple test with clipBegin and clipEnd attributes. + * + * @exception CPPUNIT_NS::Exception on test failures. + */ + void + simpleClipBeginEndTest(void) throw (CPPUNIT_NS::Exception); + /** * Test on elements in a SMIL file. * @@ -99,6 +118,15 @@ class MinimalAudioSmilTest : public CPPUNIT_NS::TestFixture void parallelTest(void) throw (CPPUNIT_NS::Exception); + /** + * Test on elements in a SMIL file, with clipBegin and + * clipEnd attributes. + * + * @exception CPPUNIT_NS::Exception on test failures. + */ + void + parallelClipBeginEndTest(void) throw (CPPUNIT_NS::Exception); + public: diff --git a/livesupport/modules/gstreamerElements/var/parallel-clipBegin-clipEnd.smil b/livesupport/modules/gstreamerElements/var/parallel-clipBegin-clipEnd.smil new file mode 100644 index 000000000..3efe2e3fe --- /dev/null +++ b/livesupport/modules/gstreamerElements/var/parallel-clipBegin-clipEnd.smil @@ -0,0 +1,16 @@ + + + + + + + diff --git a/livesupport/modules/gstreamerElements/var/parallel.smil b/livesupport/modules/gstreamerElements/var/parallel.smil index 3efe2e3fe..d23f733ff 100644 --- a/livesupport/modules/gstreamerElements/var/parallel.smil +++ b/livesupport/modules/gstreamerElements/var/parallel.smil @@ -2,14 +2,10 @@ - diff --git a/livesupport/modules/gstreamerElements/var/simple-clipBegin-clipEnd.smil b/livesupport/modules/gstreamerElements/var/simple-clipBegin-clipEnd.smil new file mode 100644 index 000000000..65dafb028 --- /dev/null +++ b/livesupport/modules/gstreamerElements/var/simple-clipBegin-clipEnd.smil @@ -0,0 +1,12 @@ + + + + + + + diff --git a/livesupport/modules/gstreamerElements/var/simple-clipBegin.smil b/livesupport/modules/gstreamerElements/var/simple-clipBegin.smil new file mode 100644 index 000000000..aa6e569f1 --- /dev/null +++ b/livesupport/modules/gstreamerElements/var/simple-clipBegin.smil @@ -0,0 +1,11 @@ + + + + + + +