added ogg vorbis and SMIL test cases
This commit is contained in:
parent
25637f9cef
commit
d7bf5ec50d
2 changed files with 137 additions and 19 deletions
|
@ -22,7 +22,7 @@
|
||||||
|
|
||||||
|
|
||||||
Author : $Author: maroy $
|
Author : $Author: maroy $
|
||||||
Version : $Revision: 1.4 $
|
Version : $Revision: 1.5 $
|
||||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/gstreamerElements/src/PartialPlayTest.cxx,v $
|
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/gstreamerElements/src/PartialPlayTest.cxx,v $
|
||||||
|
|
||||||
------------------------------------------------------------------------------*/
|
------------------------------------------------------------------------------*/
|
||||||
|
@ -51,9 +51,19 @@ using namespace LiveSupport::GstreamerElements;
|
||||||
CPPUNIT_TEST_SUITE_REGISTRATION(PartialPlayTest);
|
CPPUNIT_TEST_SUITE_REGISTRATION(PartialPlayTest);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A test file.
|
* An mp3 test file.
|
||||||
*/
|
*/
|
||||||
static const char * testFile = "var/5seccounter.mp3";
|
static const char * mp3File = "var/5seccounter.mp3";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An ogg vorbis test file.
|
||||||
|
*/
|
||||||
|
static const char * oggVorbisFile = "var/5seccounter.ogg";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A SMIL test file.
|
||||||
|
*/
|
||||||
|
static const char * smilFile = "var/simple.smil";
|
||||||
|
|
||||||
|
|
||||||
/* =============================================== local function prototypes */
|
/* =============================================== local function prototypes */
|
||||||
|
@ -158,14 +168,16 @@ eos_signal_handler(GstElement * element,
|
||||||
* A simple smoke test.
|
* A simple smoke test.
|
||||||
*----------------------------------------------------------------------------*/
|
*----------------------------------------------------------------------------*/
|
||||||
void
|
void
|
||||||
PartialPlayTest :: firstTest(void)
|
PartialPlayTest :: mp3Test(void)
|
||||||
throw (CPPUNIT_NS::Exception)
|
throw (CPPUNIT_NS::Exception)
|
||||||
{
|
{
|
||||||
gint64 timePlayed;
|
gint64 timePlayed;
|
||||||
|
char str[256];
|
||||||
|
|
||||||
timePlayed = playFile(testFile, "2s;1s-4s");
|
timePlayed = playFile(mp3File, "2s;1s-4s");
|
||||||
CPPUNIT_ASSERT(timePlayed > 4.9 * GST_SECOND);
|
g_snprintf(str, 256, "time played: %" G_GINT64_FORMAT, timePlayed);
|
||||||
CPPUNIT_ASSERT(timePlayed < 5.1 * GST_SECOND);
|
CPPUNIT_ASSERT_MESSAGE(str, timePlayed > 4.9 * GST_SECOND);
|
||||||
|
CPPUNIT_ASSERT_MESSAGE(str, timePlayed < 5.1 * GST_SECOND);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -173,13 +185,83 @@ PartialPlayTest :: firstTest(void)
|
||||||
* Open ended test
|
* Open ended test
|
||||||
*----------------------------------------------------------------------------*/
|
*----------------------------------------------------------------------------*/
|
||||||
void
|
void
|
||||||
PartialPlayTest :: openEndedTest(void)
|
PartialPlayTest :: mp3OpenEndedTest(void)
|
||||||
throw (CPPUNIT_NS::Exception)
|
throw (CPPUNIT_NS::Exception)
|
||||||
{
|
{
|
||||||
gint64 timePlayed;
|
gint64 timePlayed;
|
||||||
|
char str[256];
|
||||||
|
|
||||||
timePlayed = playFile(testFile, "2s;2s-");
|
timePlayed = playFile(mp3File, "2s;2s-");
|
||||||
CPPUNIT_ASSERT(timePlayed > 4.9 * GST_SECOND);
|
g_snprintf(str, 256, "time played: %" G_GINT64_FORMAT, timePlayed);
|
||||||
CPPUNIT_ASSERT(timePlayed < 5.1 * GST_SECOND);
|
CPPUNIT_ASSERT_MESSAGE(str, timePlayed > 4.9 * GST_SECOND);
|
||||||
|
CPPUNIT_ASSERT_MESSAGE(str, timePlayed < 5.1 * GST_SECOND);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*------------------------------------------------------------------------------
|
||||||
|
* A simple smoke test.
|
||||||
|
*----------------------------------------------------------------------------*/
|
||||||
|
void
|
||||||
|
PartialPlayTest :: oggVorbisTest(void)
|
||||||
|
throw (CPPUNIT_NS::Exception)
|
||||||
|
{
|
||||||
|
gint64 timePlayed;
|
||||||
|
char str[256];
|
||||||
|
|
||||||
|
timePlayed = playFile(oggVorbisFile, "2s;1s-4s");
|
||||||
|
g_snprintf(str, 256, "time played: %" G_GINT64_FORMAT, timePlayed);
|
||||||
|
CPPUNIT_ASSERT_MESSAGE(str, timePlayed > 4.9 * GST_SECOND);
|
||||||
|
CPPUNIT_ASSERT_MESSAGE(str, timePlayed < 5.1 * GST_SECOND);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*------------------------------------------------------------------------------
|
||||||
|
* Open ended test
|
||||||
|
*----------------------------------------------------------------------------*/
|
||||||
|
void
|
||||||
|
PartialPlayTest :: oggVorbisOpenEndedTest(void)
|
||||||
|
throw (CPPUNIT_NS::Exception)
|
||||||
|
{
|
||||||
|
gint64 timePlayed;
|
||||||
|
char str[256];
|
||||||
|
|
||||||
|
timePlayed = playFile(oggVorbisFile, "2s;2s-");
|
||||||
|
g_snprintf(str, 256, "time played: %" G_GINT64_FORMAT, timePlayed);
|
||||||
|
CPPUNIT_ASSERT_MESSAGE(str, timePlayed > 4.9 * GST_SECOND);
|
||||||
|
CPPUNIT_ASSERT_MESSAGE(str, timePlayed < 5.1 * GST_SECOND);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*------------------------------------------------------------------------------
|
||||||
|
* A simple smoke test.
|
||||||
|
*----------------------------------------------------------------------------*/
|
||||||
|
void
|
||||||
|
PartialPlayTest :: smilTest(void)
|
||||||
|
throw (CPPUNIT_NS::Exception)
|
||||||
|
{
|
||||||
|
gint64 timePlayed;
|
||||||
|
char str[256];
|
||||||
|
|
||||||
|
timePlayed = playFile(smilFile, "2s;1s-4s");
|
||||||
|
g_snprintf(str, 256, "time played: %" G_GINT64_FORMAT, timePlayed);
|
||||||
|
CPPUNIT_ASSERT_MESSAGE(str, timePlayed > 4.9 * GST_SECOND);
|
||||||
|
CPPUNIT_ASSERT_MESSAGE(str, timePlayed < 5.1 * GST_SECOND);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*------------------------------------------------------------------------------
|
||||||
|
* Open ended test
|
||||||
|
*----------------------------------------------------------------------------*/
|
||||||
|
void
|
||||||
|
PartialPlayTest :: smilOpenEndedTest(void)
|
||||||
|
throw (CPPUNIT_NS::Exception)
|
||||||
|
{
|
||||||
|
gint64 timePlayed;
|
||||||
|
char str[256];
|
||||||
|
|
||||||
|
timePlayed = playFile(smilFile, "2s;2s-");
|
||||||
|
g_snprintf(str, 256, "time played: %" G_GINT64_FORMAT, timePlayed);
|
||||||
|
CPPUNIT_ASSERT_MESSAGE(str, timePlayed > 4.9 * GST_SECOND);
|
||||||
|
CPPUNIT_ASSERT_MESSAGE(str, timePlayed < 5.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/PartialPlayTest.h,v $
|
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/gstreamerElements/src/PartialPlayTest.h,v $
|
||||||
|
|
||||||
------------------------------------------------------------------------------*/
|
------------------------------------------------------------------------------*/
|
||||||
|
@ -58,13 +58,17 @@ 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 PartialPlayTest : public CPPUNIT_NS::TestFixture
|
class PartialPlayTest : public CPPUNIT_NS::TestFixture
|
||||||
{
|
{
|
||||||
CPPUNIT_TEST_SUITE(PartialPlayTest);
|
CPPUNIT_TEST_SUITE(PartialPlayTest);
|
||||||
CPPUNIT_TEST(firstTest);
|
CPPUNIT_TEST(mp3Test);
|
||||||
CPPUNIT_TEST(openEndedTest);
|
CPPUNIT_TEST(mp3OpenEndedTest);
|
||||||
|
CPPUNIT_TEST(oggVorbisTest);
|
||||||
|
CPPUNIT_TEST(oggVorbisOpenEndedTest);
|
||||||
|
CPPUNIT_TEST(smilTest);
|
||||||
|
CPPUNIT_TEST(smilOpenEndedTest);
|
||||||
CPPUNIT_TEST_SUITE_END();
|
CPPUNIT_TEST_SUITE_END();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -86,20 +90,52 @@ class PartialPlayTest : public CPPUNIT_NS::TestFixture
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A simple smoke test.
|
* A simple mp3 smoke test.
|
||||||
*
|
*
|
||||||
* @exception CPPUNIT_NS::Exception on test failures.
|
* @exception CPPUNIT_NS::Exception on test failures.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
firstTest(void) throw (CPPUNIT_NS::Exception);
|
mp3Test(void) throw (CPPUNIT_NS::Exception);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An open ended play test.
|
* An open ended mp3 play test.
|
||||||
*
|
*
|
||||||
* @exception CPPUNIT_NS::Exception on test failures.
|
* @exception CPPUNIT_NS::Exception on test failures.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
openEndedTest(void) throw (CPPUNIT_NS::Exception);
|
mp3OpenEndedTest(void) throw (CPPUNIT_NS::Exception);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A simple ogg vorbis smoke test.
|
||||||
|
*
|
||||||
|
* @exception CPPUNIT_NS::Exception on test failures.
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
oggVorbisTest(void) throw (CPPUNIT_NS::Exception);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An open ended ogg vorbis play test.
|
||||||
|
*
|
||||||
|
* @exception CPPUNIT_NS::Exception on test failures.
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
oggVorbisOpenEndedTest(void) throw (CPPUNIT_NS::Exception);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A simple SMIL smoke test.
|
||||||
|
*
|
||||||
|
* @exception CPPUNIT_NS::Exception on test failures.
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
smilTest(void) throw (CPPUNIT_NS::Exception);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An open ended SMIL play test.
|
||||||
|
*
|
||||||
|
* @exception CPPUNIT_NS::Exception on test failures.
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
smilOpenEndedTest(void) throw (CPPUNIT_NS::Exception);
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue