OpenWalnut  1.4.0
Public Member Functions | Private Types | Private Member Functions
WDataSetTimeSeriesTest Class Reference

Unit tests the time series class. More...

#include <WDataSetTimeSeries_test.h>

+ Inheritance diagram for WDataSetTimeSeriesTest:

List of all members.

Public Member Functions

void testConstruction ()
 The input should be sorted correctly and all data should be stored correctly.
void testTimeMinMax ()
 The correct minimum and maximum times should be returned.
void testIsTimeSlice ()
 Times that were provided on construction should be found.
void testGetNearestTimeSlice ()
 The nearest time slices should be calculated correctly.
void testGetDataSetPtrAtTimeSlice ()
 Provided datasets should be returned for provided time slices.
void testInterpolatedDataSets ()
 Interpolated datasets need to be correct.
void testInterpolate ()
 Interpolation of values should be correct.
void testLBTime ()
 Test the lower bound time helper routine.
void testUBTime ()
 Test the upper bound time helper routine.

Private Types

typedef std::vector
< boost::shared_ptr
< WDataSetScalar const > > 
DataSetPtrVector
 a typedef
typedef std::vector< float > TimesVector
 a typdef

Private Member Functions

void createData (double *data, int number, DataSetPtrVector &dsets, TimesVector &times)
 A helper function that creates some input data.
void setUp ()
 Setup logger and other stuff for each test.

Detailed Description

Unit tests the time series class.

Definition at line 45 of file WDataSetTimeSeries_test.h.


Member Typedef Documentation

typedef std::vector< boost::shared_ptr< WDataSetScalar const > > WDataSetTimeSeriesTest::DataSetPtrVector [private]

a typedef

Definition at line 48 of file WDataSetTimeSeries_test.h.

typedef std::vector< float > WDataSetTimeSeriesTest::TimesVector [private]

a typdef

Definition at line 51 of file WDataSetTimeSeries_test.h.


Member Function Documentation

void WDataSetTimeSeriesTest::createData ( double *  data,
int  number,
DataSetPtrVector dsets,
TimesVector times 
) [inline, private]

A helper function that creates some input data.

Parameters:
dataAn array of data values, one for each time slice.
numberThe number of time slices.
dsetsThe output datasets.
timesSome times for the output datasets.

Definition at line 546 of file WDataSetTimeSeries_test.h.

References WMatrix< T >::makeIdentity().

Referenced by testConstruction(), testGetDataSetPtrAtTimeSlice(), testGetNearestTimeSlice(), testInterpolate(), testInterpolatedDataSets(), testIsTimeSlice(), testLBTime(), testTimeMinMax(), and testUBTime().

void WDataSetTimeSeriesTest::setUp ( void  ) [inline, private]

Setup logger and other stuff for each test.

Definition at line 572 of file WDataSetTimeSeries_test.h.

References WLogger::startup().

The input should be sorted correctly and all data should be stored correctly.

Also there should be only one grid for all datasets.

Definition at line 58 of file WDataSetTimeSeries_test.h.

References createData(), WDataSetTimeSeries::m_dataSets, and WMatrix< T >::makeIdentity().

Provided datasets should be returned for provided time slices.

Definition at line 334 of file WDataSetTimeSeries_test.h.

References createData(), wlimits::FLT_EPS, and WDataSetTimeSeries::getDataSetPtrAtTimeSlice().

The nearest time slices should be calculated correctly.

Boundary conditions must be handled correctly.

Definition at line 287 of file WDataSetTimeSeries_test.h.

References createData(), WDataSetTimeSeries::findNearestTimeSlice(), and wlimits::FLT_EPS.

void WDataSetTimeSeriesTest::testInterpolate ( void  ) [inline]

Interpolation of values should be correct.

Definition at line 431 of file WDataSetTimeSeries_test.h.

References createData(), wlimits::FLT_EPS, and WDataSetTimeSeries::interpolate().

Interpolated datasets need to be correct.

Definition at line 359 of file WDataSetTimeSeries_test.h.

References WDataSetTimeSeries::calcDataSetAtTime(), createData(), and wlimits::FLT_EPS.

Times that were provided on construction should be found.

Times outside of the interval [getMinTime(),getMaxTime()] should be rejected.

Definition at line 244 of file WDataSetTimeSeries_test.h.

References createData(), wlimits::FLT_EPS, and WDataSetTimeSeries::isTimeSlice().

Test the lower bound time helper routine.

It should return the largest time slice that is smaller than or equal to the input time, or -inf if there is no such time slice.

Definition at line 476 of file WDataSetTimeSeries_test.h.

References createData(), wlimits::FLT_EPS, and WDataSetTimeSeries::getLBTimeSlice().

The correct minimum and maximum times should be returned.

Definition at line 215 of file WDataSetTimeSeries_test.h.

References createData(), WDataSetTimeSeries::getMaxTime(), and WDataSetTimeSeries::getMinTime().

Test the upper bound time helper routine.

It should return the smallest time slice that is larger than the input time, or inf if there is no such time slice.

Definition at line 509 of file WDataSetTimeSeries_test.h.

References createData(), wlimits::FLT_EPS, and WDataSetTimeSeries::getUBTimeSlice().


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