LRAUV  revA
Timespan_Test Class Reference

Unit Tests for class Timespan. More...

#include <Timestamp_Test.h>

Inheritance diagram for Timespan_Test:
Collaboration diagram for Timespan_Test:

Public Member Functions

void testConstructorNoArguments (void)
 Tests:

  1. Create a new object w/o params.
More...
 
void testConstructorDoubleArg (void)
 Tests:

  1. Create a new object with double param, Expect asDouble() == param.
More...
 
void testConstructorCopyArg (void)
 Constructor with copy param tests

  1. Create new object copied from another object.
More...
 
void testCopyOperator (void)
 Copy operator. More...
 
void testSetOperatorOne (void)
 Set operator. More...
 
void testSetOperatorTwo (void)
 
void testAdditionAndSubtraction (void)
 Standard addition/subtraction functions. More...
 
void testInquality (void)
 Inequality operator. More...
 
void testSleepFor (void)
 Test the sleepFor function. More...
 
void testToString (void)
 

Detailed Description

Unit Tests for class Timespan.

Member Function Documentation

void Timespan_Test::testAdditionAndSubtraction ( void  )
inline

Standard addition/subtraction functions.

Tests for each:

  1. Create double A and B (A>B). Create timestampA, and timespanB.
  2. Verify timespanA + timespanB = A+B
  3. Verify timespanA - timespanB = A-B
  4. Repeat above with B>A

References TIMESPAN_FUDGE().

void Timespan_Test::testConstructorCopyArg ( void  )
inline

Constructor with copy param tests

  1. Create new object copied from another object.

asDouble == asDouble

  1. Create new object copied from another object. Equal with == operator

References Timespan::asDouble().

void Timespan_Test::testConstructorDoubleArg ( void  )
inline

Tests:

  1. Create a new object with double param, Expect asDouble() == param.

References Timespan::asDouble().

void Timespan_Test::testConstructorNoArguments ( void  )
inline

Tests:

  1. Create a new object w/o params.

Expect ZERO_TIMESPAN

References Timespan::asDouble(), and Timespan::ZERO_TIMESPAN.

void Timespan_Test::testCopyOperator ( void  )
inline

Copy operator.

Test:

  1. Create two objects with different double params. Test they are different. Use copy to set one to the other. Test they are same with equality operator.

References Timestamp::asDouble().

void Timespan_Test::testInquality ( void  )
inline

Inequality operator.

Tests:

  1. Generate two times A and B with A > B. Verify A>B true and A<B false.
void Timespan_Test::testSetOperatorOne ( void  )
inline

Set operator.

Test:

  1. Create object with double param A. Test asDouble is not equal to B. Use operator to set to B. Test asDouble is equal to B
  2. Create two objects with different double params. Test they are different. Use copy to set one to the other's asDouble. Test they are same with equality operator.

References Timestamp::asDouble().

void Timespan_Test::testSetOperatorTwo ( void  )
inline

References Timestamp::asDouble().

void Timespan_Test::testSleepFor ( void  )
inline

Test the sleepFor function.

References Timespan::Milliseconds(), Timestamp::Now(), and Timespan::sleepFor().

void Timespan_Test::testToString ( void  )
inline

References Timespan::toString().


The documentation for this class was generated from the following file: