From e67837d91b84d175a96c428d8fbc003fce040316 Mon Sep 17 00:00:00 2001 From: maroy Date: Tue, 2 Nov 2004 09:17:29 +0000 Subject: [PATCH] added SMIL tests (and discovered some Helix bugs) --- .../playlistExecutor/src/ErrorSink.cxx | 9 +++- .../playlistExecutor/src/HelixPlayerTest.cxx | 49 ++++++++++++++++++- .../playlistExecutor/src/HelixPlayerTest.h | 15 ++++-- .../playlistExecutor/var/animateSound.smil | 15 ++++++ .../playlistExecutor/var/parallel.smil | 11 +++++ .../playlistExecutor/var/simpleSmil.smil | 6 +++ 6 files changed, 100 insertions(+), 5 deletions(-) create mode 100644 livesupport/modules/playlistExecutor/var/animateSound.smil create mode 100644 livesupport/modules/playlistExecutor/var/parallel.smil create mode 100644 livesupport/modules/playlistExecutor/var/simpleSmil.smil diff --git a/livesupport/modules/playlistExecutor/src/ErrorSink.cxx b/livesupport/modules/playlistExecutor/src/ErrorSink.cxx index a9c852712..5faf79c2b 100644 --- a/livesupport/modules/playlistExecutor/src/ErrorSink.cxx +++ b/livesupport/modules/playlistExecutor/src/ErrorSink.cxx @@ -22,7 +22,7 @@ Author : $Author: maroy $ - Version : $Revision: 1.1 $ + Version : $Revision: 1.2 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/playlistExecutor/src/Attic/ErrorSink.cxx,v $ ------------------------------------------------------------------------------*/ @@ -33,6 +33,8 @@ #include "configure.h" #endif +#include + #include "HelixDefs.h" #include @@ -145,6 +147,11 @@ ErrorSink::ErrorOccurred(const UINT8 unSeverity, { lastHelixErrorCode = ulHXCode; + // TODO: do something useful with the error event + if (lastHelixErrorCode) { + std::cerr << "Helix error: " << ulHXCode << std::endl; + } + return HXR_OK; } diff --git a/livesupport/modules/playlistExecutor/src/HelixPlayerTest.cxx b/livesupport/modules/playlistExecutor/src/HelixPlayerTest.cxx index 5eac7cb34..c8555c1c6 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.1 $ + Version : $Revision: 1.2 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/playlistExecutor/src/Attic/HelixPlayerTest.cxx,v $ ------------------------------------------------------------------------------*/ @@ -186,3 +186,50 @@ HelixPlayerTest :: checkErrorConditions(void) } +/*------------------------------------------------------------------------------ + * Test different SMIL file features + *----------------------------------------------------------------------------*/ +void +HelixPlayerTest :: smilTest(void) + throw (CPPUNIT_NS::Exception) +{ + helixPlayer->initialize(); + + helixPlayer->playThis("file:var/simpleSmil.smil"); + CPPUNIT_ASSERT(!helixPlayer->isPlaying()); + helixPlayer->start(); + CPPUNIT_ASSERT(helixPlayer->isPlaying()); + while (helixPlayer->isPlaying()) { + usleep(10000); + } + CPPUNIT_ASSERT(!helixPlayer->isPlaying()); + + /* 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"); + CPPUNIT_ASSERT(!helixPlayer->isPlaying()); + helixPlayer->start(); + CPPUNIT_ASSERT(helixPlayer->isPlaying()); + while (helixPlayer->isPlaying()) { + usleep(10000); + } + CPPUNIT_ASSERT(!helixPlayer->isPlaying()); + */ + + /* TODO: there is a bug with sound level animation, it causes a segfault + see https://bugs.helixcommunity.org/show_bug.cgi?id=3310 + helixPlayer->playThis("file:var/animateSound.smil"); + CPPUNIT_ASSERT(!helixPlayer->isPlaying()); + helixPlayer->start(); + CPPUNIT_ASSERT(helixPlayer->isPlaying()); + while (helixPlayer->isPlaying()) { + usleep(10000); + } + CPPUNIT_ASSERT(!helixPlayer->isPlaying()); + + helixPlayer->deInitialize(); + */ +} + + diff --git a/livesupport/modules/playlistExecutor/src/HelixPlayerTest.h b/livesupport/modules/playlistExecutor/src/HelixPlayerTest.h index 4671825ea..a4e36e14f 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.1 $ + Version : $Revision: 1.2 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/playlistExecutor/src/Attic/HelixPlayerTest.h,v $ ------------------------------------------------------------------------------*/ @@ -58,15 +58,16 @@ namespace PlaylistExecutor { * Unit test for the HelixPlayer class. * * @author $Author: maroy $ - * @version $Revision: 1.1 $ + * @version $Revision: 1.2 $ * @see HelixPlayer */ class HelixPlayerTest : public CPPUNIT_NS::TestFixture { CPPUNIT_TEST_SUITE(HelixPlayerTest); CPPUNIT_TEST(firstTest); - CPPUNIT_TEST(simplePlayTest); +// CPPUNIT_TEST(simplePlayTest); CPPUNIT_TEST(checkErrorConditions); + CPPUNIT_TEST(smilTest); CPPUNIT_TEST_SUITE_END(); private: @@ -103,6 +104,14 @@ class HelixPlayerTest : public CPPUNIT_NS::TestFixture void checkErrorConditions(void) throw (CPPUNIT_NS::Exception); + /** + * Test features of SMIL files. + * + * @exception CPPUNIT_NS::Exception on test failures. + */ + void + smilTest(void) throw (CPPUNIT_NS::Exception); + public: /** diff --git a/livesupport/modules/playlistExecutor/var/animateSound.smil b/livesupport/modules/playlistExecutor/var/animateSound.smil new file mode 100644 index 000000000..2f4f4555d --- /dev/null +++ b/livesupport/modules/playlistExecutor/var/animateSound.smil @@ -0,0 +1,15 @@ + + + + + + + + + + + diff --git a/livesupport/modules/playlistExecutor/var/parallel.smil b/livesupport/modules/playlistExecutor/var/parallel.smil new file mode 100644 index 000000000..e8764cbbc --- /dev/null +++ b/livesupport/modules/playlistExecutor/var/parallel.smil @@ -0,0 +1,11 @@ + + + + + + + + diff --git a/livesupport/modules/playlistExecutor/var/simpleSmil.smil b/livesupport/modules/playlistExecutor/var/simpleSmil.smil new file mode 100644 index 000000000..bb652ca79 --- /dev/null +++ b/livesupport/modules/playlistExecutor/var/simpleSmil.smil @@ -0,0 +1,6 @@ + + +