diff --git a/livesupport/modules/playlistExecutor/src/HelixPlayerTest.cxx b/livesupport/modules/playlistExecutor/src/HelixPlayerTest.cxx index a77d64127..003192dbe 100644 --- a/livesupport/modules/playlistExecutor/src/HelixPlayerTest.cxx +++ b/livesupport/modules/playlistExecutor/src/HelixPlayerTest.cxx @@ -22,7 +22,7 @@ Author : $Author: maroy $ - Version : $Revision: 1.4 $ + Version : $Revision: 1.5 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/playlistExecutor/src/Attic/HelixPlayerTest.cxx,v $ ------------------------------------------------------------------------------*/ @@ -213,21 +213,16 @@ HelixPlayerTest :: smilTest(void) /*------------------------------------------------------------------------------ - * Test different SMIL file features + * Play a specific file. + * Assumes that the player was already initialized. *----------------------------------------------------------------------------*/ void -HelixPlayerTest :: smilParallelTest(void) +HelixPlayerTest :: playFile(const std::string & fileName) throw (CPPUNIT_NS::Exception) { Ptr::Ref sleepT(new time_duration(microseconds(10))); - helixPlayer->initialize(); - - /* TODO: there is a bug with playing parallel, as it doesn't end - for some reason. - see https://bugs.helixcommunity.org/show_bug.cgi?id=3311 - */ - helixPlayer->playThis("file:var/parallel.smil"); + helixPlayer->playThis(fileName.c_str()); CPPUNIT_ASSERT(!helixPlayer->isPlaying()); helixPlayer->start(); CPPUNIT_ASSERT(helixPlayer->isPlaying()); @@ -238,6 +233,66 @@ HelixPlayerTest :: smilParallelTest(void) } +/*------------------------------------------------------------------------------ + * Test parallel play + *----------------------------------------------------------------------------*/ +void +HelixPlayerTest :: smilParallelTest0(void) + throw (CPPUNIT_NS::Exception) +{ + helixPlayer->initialize(); + playFile("file:var/parallel-0.smil"); +} + + +/*------------------------------------------------------------------------------ + * Test parallel play + *----------------------------------------------------------------------------*/ +void +HelixPlayerTest :: smilParallelTest1(void) + throw (CPPUNIT_NS::Exception) +{ + helixPlayer->initialize(); + playFile("file:var/parallel-1.smil"); +} + + +/*------------------------------------------------------------------------------ + * Test parallel play + *----------------------------------------------------------------------------*/ +void +HelixPlayerTest :: smilParallelTest2(void) + throw (CPPUNIT_NS::Exception) +{ + helixPlayer->initialize(); + playFile("file:var/parallel-2.smil"); +} + + +/*------------------------------------------------------------------------------ + * Test parallel play + *----------------------------------------------------------------------------*/ +void +HelixPlayerTest :: smilParallelTest3(void) + throw (CPPUNIT_NS::Exception) +{ + helixPlayer->initialize(); + playFile("file:var/parallel-3.smil"); +} + + +/*------------------------------------------------------------------------------ + * Test parallel play + *----------------------------------------------------------------------------*/ +void +HelixPlayerTest :: smilParallelTest4(void) + throw (CPPUNIT_NS::Exception) +{ + helixPlayer->initialize(); + playFile("file:var/parallel-4.smil"); +} + + /*------------------------------------------------------------------------------ * Test different SMIL file features *----------------------------------------------------------------------------*/ diff --git a/livesupport/modules/playlistExecutor/src/HelixPlayerTest.h b/livesupport/modules/playlistExecutor/src/HelixPlayerTest.h index 1b65f5b8e..25e66384f 100644 --- a/livesupport/modules/playlistExecutor/src/HelixPlayerTest.h +++ b/livesupport/modules/playlistExecutor/src/HelixPlayerTest.h @@ -22,7 +22,7 @@ Author : $Author: maroy $ - Version : $Revision: 1.4 $ + Version : $Revision: 1.5 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/playlistExecutor/src/Attic/HelixPlayerTest.h,v $ ------------------------------------------------------------------------------*/ @@ -58,7 +58,7 @@ namespace PlaylistExecutor { * Unit test for the HelixPlayer class. * * @author $Author: maroy $ - * @version $Revision: 1.4 $ + * @version $Revision: 1.5 $ * @see HelixPlayer */ class HelixPlayerTest : public CPPUNIT_NS::TestFixture @@ -68,7 +68,11 @@ class HelixPlayerTest : public CPPUNIT_NS::TestFixture CPPUNIT_TEST(simplePlayTest); CPPUNIT_TEST(checkErrorConditions); CPPUNIT_TEST(smilTest); -// CPPUNIT_TEST(smilParallelTest); + CPPUNIT_TEST(smilParallelTest0); + CPPUNIT_TEST(smilParallelTest1); + CPPUNIT_TEST(smilParallelTest2); + CPPUNIT_TEST(smilParallelTest3); + CPPUNIT_TEST(smilParallelTest4); // CPPUNIT_TEST(smilSoundAnimationTest); CPPUNIT_TEST_SUITE_END(); @@ -79,6 +83,16 @@ class HelixPlayerTest : public CPPUNIT_NS::TestFixture */ Ptr::Ref helixPlayer; + /** + * Play a specific file. + * + * @param fileName the name of the file to play. + * @exception CPPUNIT_NS::Exception on playing failures + */ + void + playFile(const std::string & fileName) + throw (CPPUNIT_NS::Exception); + protected: @@ -120,7 +134,39 @@ class HelixPlayerTest : public CPPUNIT_NS::TestFixture * @exception CPPUNIT_NS::Exception on test failures. */ void - smilParallelTest(void) throw (CPPUNIT_NS::Exception); + smilParallelTest0(void) throw (CPPUNIT_NS::Exception); + + /** + * Test SMIL files, when playing audio clips in parallel. + * + * @exception CPPUNIT_NS::Exception on test failures. + */ + void + smilParallelTest1(void) throw (CPPUNIT_NS::Exception); + + /** + * Test SMIL files, when playing audio clips in parallel. + * + * @exception CPPUNIT_NS::Exception on test failures. + */ + void + smilParallelTest2(void) throw (CPPUNIT_NS::Exception); + + /** + * Test SMIL files, when playing audio clips in parallel. + * + * @exception CPPUNIT_NS::Exception on test failures. + */ + void + smilParallelTest3(void) throw (CPPUNIT_NS::Exception); + + /** + * Test SMIL files, when playing audio clips in parallel. + * + * @exception CPPUNIT_NS::Exception on test failures. + */ + void + smilParallelTest4(void) throw (CPPUNIT_NS::Exception); /** * Test SMIL files, when animating the sound of a played clip. diff --git a/livesupport/modules/playlistExecutor/var/parallel-0.smil b/livesupport/modules/playlistExecutor/var/parallel-0.smil new file mode 100644 index 000000000..bc2a6e567 --- /dev/null +++ b/livesupport/modules/playlistExecutor/var/parallel-0.smil @@ -0,0 +1,11 @@ + + + + + + + diff --git a/livesupport/modules/playlistExecutor/var/parallel-1.smil b/livesupport/modules/playlistExecutor/var/parallel-1.smil new file mode 100644 index 000000000..0179faf1d --- /dev/null +++ b/livesupport/modules/playlistExecutor/var/parallel-1.smil @@ -0,0 +1,10 @@ + + + + + + + diff --git a/livesupport/modules/playlistExecutor/var/parallel-2.smil b/livesupport/modules/playlistExecutor/var/parallel-2.smil new file mode 100644 index 000000000..61920ce91 --- /dev/null +++ b/livesupport/modules/playlistExecutor/var/parallel-2.smil @@ -0,0 +1,11 @@ + + + + + + + diff --git a/livesupport/modules/playlistExecutor/var/parallel-3.smil b/livesupport/modules/playlistExecutor/var/parallel-3.smil new file mode 100644 index 000000000..9b5b31746 --- /dev/null +++ b/livesupport/modules/playlistExecutor/var/parallel-3.smil @@ -0,0 +1,11 @@ + + + + + + + diff --git a/livesupport/modules/playlistExecutor/var/parallel.smil b/livesupport/modules/playlistExecutor/var/parallel-4.smil similarity index 100% rename from livesupport/modules/playlistExecutor/var/parallel.smil rename to livesupport/modules/playlistExecutor/var/parallel-4.smil diff --git a/livesupport/modules/playlistExecutor/var/test-short.mp3 b/livesupport/modules/playlistExecutor/var/test-short.mp3 new file mode 100644 index 000000000..03814e73d Binary files /dev/null and b/livesupport/modules/playlistExecutor/var/test-short.mp3 differ