minor refinement
This commit is contained in:
parent
91b6a72bd1
commit
4554a90752
4 changed files with 14 additions and 13 deletions
|
@ -22,7 +22,7 @@
|
|||
|
||||
|
||||
Author : $Author: fgerlits $
|
||||
Version : $Revision: 1.7 $
|
||||
Version : $Revision: 1.8 $
|
||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/core/include/LiveSupport/Core/TimeConversion.h,v $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
|
@ -71,7 +71,7 @@ using namespace LiveSupport;
|
|||
* A helper object holding static time conversion functions.
|
||||
*
|
||||
* @author $Author: fgerlits $
|
||||
* @version $Revision: 1.7 $
|
||||
* @version $Revision: 1.8 $
|
||||
*/
|
||||
class TimeConversion
|
||||
{
|
||||
|
@ -145,7 +145,7 @@ class TimeConversion
|
|||
* @param duration sleep for this duration.
|
||||
*/
|
||||
static Ptr<std::string>::Ref
|
||||
timeDurationToStringMilliseconds(Ptr<time_duration>::Ref duration)
|
||||
timeDurationToSmilString(Ptr<time_duration>::Ref duration)
|
||||
throw ();
|
||||
};
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
|
||||
Author : $Author: fgerlits $
|
||||
Version : $Revision: 1.7 $
|
||||
Version : $Revision: 1.8 $
|
||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/core/src/TimeConversion.cxx,v $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
|
@ -157,7 +157,7 @@ TimeConversion :: sleep(Ptr<time_duration>::Ref duration)
|
|||
* Convert a time_duration to a format used in SMILs.
|
||||
*----------------------------------------------------------------------------*/
|
||||
Ptr<std::string>::Ref
|
||||
TimeConversion :: timeDurationToStringMilliseconds(
|
||||
TimeConversion :: timeDurationToSmilString(
|
||||
Ptr<time_duration>::Ref duration)
|
||||
throw ()
|
||||
{
|
||||
|
@ -166,7 +166,7 @@ TimeConversion :: timeDurationToStringMilliseconds(
|
|||
int microseconds = duration->fractional_seconds();
|
||||
stringStream << "."
|
||||
<< std::setw(3) << std::setfill('0') << std::dec
|
||||
<< microseconds / 1000
|
||||
<< (microseconds + 500) / 1000
|
||||
<< 's';
|
||||
Ptr<std::string>::Ref result(new std::string(stringStream.str()));
|
||||
return result;
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
|
||||
Author : $Author: fgerlits $
|
||||
Version : $Revision: 1.6 $
|
||||
Version : $Revision: 1.7 $
|
||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/core/src/TimeConversionTest.cxx,v $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
|
@ -215,16 +215,17 @@ TimeConversionTest :: sleepTest(void)
|
|||
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
* Test the timeDurationToStringMilliseconds() function
|
||||
* Test the timeDurationToSmilString() function
|
||||
*----------------------------------------------------------------------------*/
|
||||
void
|
||||
TimeConversionTest :: durationToStringTest(void)
|
||||
throw (CPPUNIT_NS::Exception)
|
||||
{
|
||||
Ptr<time_duration>::Ref duration(new time_duration(1,2,3,4000));
|
||||
Ptr<time_duration>::Ref duration(new time_duration(duration_from_string(
|
||||
"01:02:03.003700" )));
|
||||
|
||||
Ptr<std::string>::Ref durationString
|
||||
= TimeConversion::timeDurationToStringMilliseconds(
|
||||
= TimeConversion::timeDurationToSmilString(
|
||||
duration);
|
||||
CPPUNIT_ASSERT_EQUAL(std::string("3723.004s"), *durationString);
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
|
||||
Author : $Author: fgerlits $
|
||||
Version : $Revision: 1.5 $
|
||||
Version : $Revision: 1.6 $
|
||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/core/src/TimeConversionTest.h,v $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
|
@ -58,7 +58,7 @@ namespace Core {
|
|||
* Unit test for the TimeConversion class.
|
||||
*
|
||||
* @author $Author: fgerlits $
|
||||
* @version $Revision: 1.5 $
|
||||
* @version $Revision: 1.6 $
|
||||
* @see TimeConversion
|
||||
*/
|
||||
class TimeConversionTest : public CPPUNIT_NS::TestFixture
|
||||
|
@ -115,7 +115,7 @@ class TimeConversionTest : public CPPUNIT_NS::TestFixture
|
|||
sleepTest(void) throw (CPPUNIT_NS::Exception);
|
||||
|
||||
/**
|
||||
* Test the timeDurationToStringMilliseconds() function.
|
||||
* Test the timeDurationToSmilString() function.
|
||||
*
|
||||
* @exception CPPUNIT_NS::Exception on test failures.
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue