added more SMIL test cases
This commit is contained in:
parent
fa3951f819
commit
0ac70b4e14
6 changed files with 136 additions and 9 deletions
|
@ -22,7 +22,7 @@
|
||||||
|
|
||||||
|
|
||||||
Author : $Author: maroy $
|
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 $
|
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";
|
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.
|
* A parallel smil file.
|
||||||
*/
|
*/
|
||||||
static const char * parallelFile = "var/parallel.smil";
|
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 */
|
/* =============================================== 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 <par> SMIL elements
|
* Test <par> SMIL elements
|
||||||
*----------------------------------------------------------------------------*/
|
*----------------------------------------------------------------------------*/
|
||||||
|
@ -164,3 +213,18 @@ MinimalAudioSmilTest :: parallelTest(void)
|
||||||
CPPUNIT_ASSERT(timePlayed < 8.1 * GST_SECOND);
|
CPPUNIT_ASSERT(timePlayed < 8.1 * GST_SECOND);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*------------------------------------------------------------------------------
|
||||||
|
* Test <par> 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);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
|
|
||||||
|
|
||||||
Author : $Author: maroy $
|
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 $
|
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.
|
* Unit test for the partialplay gstreamer element.
|
||||||
*
|
*
|
||||||
* @author $Author: maroy $
|
* @author $Author: maroy $
|
||||||
* @version $Revision: 1.3 $
|
* @version $Revision: 1.4 $
|
||||||
*/
|
*/
|
||||||
class MinimalAudioSmilTest : public CPPUNIT_NS::TestFixture
|
class MinimalAudioSmilTest : public CPPUNIT_NS::TestFixture
|
||||||
{
|
{
|
||||||
CPPUNIT_TEST_SUITE(MinimalAudioSmilTest);
|
CPPUNIT_TEST_SUITE(MinimalAudioSmilTest);
|
||||||
CPPUNIT_TEST(firstTest);
|
CPPUNIT_TEST(firstTest);
|
||||||
|
CPPUNIT_TEST(simpleClipBeginTest);
|
||||||
|
CPPUNIT_TEST(simpleClipBeginEndTest);
|
||||||
CPPUNIT_TEST(parallelTest);
|
CPPUNIT_TEST(parallelTest);
|
||||||
|
CPPUNIT_TEST(parallelClipBeginEndTest);
|
||||||
CPPUNIT_TEST_SUITE_END();
|
CPPUNIT_TEST_SUITE_END();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -91,6 +94,22 @@ class MinimalAudioSmilTest : public CPPUNIT_NS::TestFixture
|
||||||
void
|
void
|
||||||
firstTest(void) throw (CPPUNIT_NS::Exception);
|
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 <par> elements in a SMIL file.
|
* Test on <par> elements in a SMIL file.
|
||||||
*
|
*
|
||||||
|
@ -99,6 +118,15 @@ class MinimalAudioSmilTest : public CPPUNIT_NS::TestFixture
|
||||||
void
|
void
|
||||||
parallelTest(void) throw (CPPUNIT_NS::Exception);
|
parallelTest(void) throw (CPPUNIT_NS::Exception);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test on <par> 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:
|
public:
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<smil xmlns="http://www.w3.org/2001/SMIL20/Language" >
|
||||||
|
<body>
|
||||||
|
<par>
|
||||||
|
<audio src = "file:var/1minutecounter.mp3"
|
||||||
|
clipBegin = "10s"
|
||||||
|
clipEnd = "15s"
|
||||||
|
/>
|
||||||
|
<audio src = "file:var/1minutecounter.mp3"
|
||||||
|
begin = "3s"
|
||||||
|
clipBegin = "10s"
|
||||||
|
clipEnd = "15s"
|
||||||
|
/>
|
||||||
|
</par>
|
||||||
|
</body>
|
||||||
|
</smil>
|
|
@ -2,14 +2,10 @@
|
||||||
<smil xmlns="http://www.w3.org/2001/SMIL20/Language" >
|
<smil xmlns="http://www.w3.org/2001/SMIL20/Language" >
|
||||||
<body>
|
<body>
|
||||||
<par>
|
<par>
|
||||||
<audio src = "file:var/1minutecounter.mp3"
|
<audio src = "file:var/5seccounter.mp3"
|
||||||
clipBegin = "10s"
|
|
||||||
clipEnd = "15s"
|
|
||||||
/>
|
/>
|
||||||
<audio src = "file:var/1minutecounter.mp3"
|
<audio src = "file:var/5seccounter.mp3"
|
||||||
begin = "3s"
|
begin = "3s"
|
||||||
clipBegin = "10s"
|
|
||||||
clipEnd = "15s"
|
|
||||||
/>
|
/>
|
||||||
</par>
|
</par>
|
||||||
</body>
|
</body>
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<smil xmlns="http://www.w3.org/2001/SMIL20/Language" >
|
||||||
|
<body>
|
||||||
|
<par>
|
||||||
|
<audio src = "file:var/1minutecounter.mp3"
|
||||||
|
begin = "2s"
|
||||||
|
clipBegin = "10s"
|
||||||
|
clipEnd = "13s"
|
||||||
|
/>
|
||||||
|
</par>
|
||||||
|
</body>
|
||||||
|
</smil>
|
|
@ -0,0 +1,11 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<smil xmlns="http://www.w3.org/2001/SMIL20/Language" >
|
||||||
|
<body>
|
||||||
|
<par>
|
||||||
|
<audio src = "file:var/1minutecounter.mp3"
|
||||||
|
begin = "2s"
|
||||||
|
clipBegin = "57s"
|
||||||
|
/>
|
||||||
|
</par>
|
||||||
|
</body>
|
||||||
|
</smil>
|
Loading…
Add table
Add a link
Reference in a new issue