added SMIL tests (and discovered some Helix bugs)

This commit is contained in:
maroy 2004-11-02 09:17:29 +00:00
parent d6fdf26a7c
commit e67837d91b
6 changed files with 100 additions and 5 deletions

View File

@ -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 <iostream>
#include "HelixDefs.h"
#include <hxcom.h>
@ -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;
}

View File

@ -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();
*/
}

View File

@ -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:
/**

View File

@ -0,0 +1,15 @@
<smil xmlns="http://www.w3.org/2001/SMIL20/Language">
<head>
<layout>
<root-layout height="1" width="1"/>
<region id="audio_region" soundLevel="100%"/>
</layout>
</head>
<body>
<audio src="file:var/test.mp3" region="audio_region">
<animate targetElement="audio_region" attributeName="soundLevel" from="100%" to="20%" calcMode="linear" begin="2s" dur="5s" fill="freeze"/>
<animate targetElement="audio_region" attributeName="soundLevel" from="20%" to="200%" calcMode="linear" begin="8s" dur="5s" fill="freeze"/>
<animate targetElement="audio_region" attributeName="soundLevel" from="200%" to="100%" calcMode="linear" begin="16s" dur="5s" fill="freeze"/>
</audio>
</body>
</smil>

View File

@ -0,0 +1,11 @@
<smil xmlns = "http://www.w3.org/2001/SMIL20/Language"
xmlns:rn = "http://features.real.com/2001/SMIL20/Extensions">
<body>
<par>
<!-- play the same files over each other, with some offset -->
<audio src="file:var/test.mp3"/>
<audio src="file:var/test.mp3" begin="3s"/>
</par>
</body>
</smil>

View File

@ -0,0 +1,6 @@
<smil xmlns = "http://www.w3.org/2001/SMIL20/Language"
xmlns:rn = "http://features.real.com/2001/SMIL20/Extensions">
<body>
<audio src="file:var/test.mp3"/>
</body>
</smil>