OpenWalnut  1.5.0dev
Public Member Functions | Private Types | Private Member Functions | List of all members
WDataSetTimeSeriesTest Class Reference

Unit tests the time series class. More...

#include <WDataSetTimeSeries_test.h>

+ Inheritance diagram for WDataSetTimeSeriesTest:
+ Collaboration diagram for WDataSetTimeSeriesTest:

Public Member Functions

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

Private Types

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

Private Member Functions

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

Detailed Description

Unit tests the time series class.

Definition at line 44 of file WDataSetTimeSeries_test.h.

Member Typedef Documentation

◆ DataSetPtrVector

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

a typedef

Definition at line 47 of file WDataSetTimeSeries_test.h.

◆ TimesVector

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

a typdef

Definition at line 50 of file WDataSetTimeSeries_test.h.

Member Function Documentation

◆ createData()

void WDataSetTimeSeriesTest::createData ( double *  data,
int  number,
DataSetPtrVector dsets,
TimesVector times 
)
inlineprivate

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 545 of file WDataSetTimeSeries_test.h.

References WMatrix< T >::makeIdentity().

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

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setUp()

void WDataSetTimeSeriesTest::setUp ( )
inlineprivate

Setup logger and other stuff for each test.

Definition at line 571 of file WDataSetTimeSeries_test.h.

References WLogger::startup().

+ Here is the call graph for this function:

◆ testConstruction()

void WDataSetTimeSeriesTest::testConstruction ( )
inline

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 57 of file WDataSetTimeSeries_test.h.

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

+ Here is the call graph for this function:

◆ testGetDataSetPtrAtTimeSlice()

void WDataSetTimeSeriesTest::testGetDataSetPtrAtTimeSlice ( )
inline

Provided datasets should be returned for provided time slices.

Definition at line 333 of file WDataSetTimeSeries_test.h.

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

+ Here is the call graph for this function:

◆ testGetNearestTimeSlice()

void WDataSetTimeSeriesTest::testGetNearestTimeSlice ( )
inline

The nearest time slices should be calculated correctly.

Boundary conditions must be handled correctly.

Definition at line 286 of file WDataSetTimeSeries_test.h.

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

+ Here is the call graph for this function:

◆ testInterpolate()

void WDataSetTimeSeriesTest::testInterpolate ( )
inline

Interpolation of values should be correct.

Definition at line 430 of file WDataSetTimeSeries_test.h.

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

+ Here is the call graph for this function:

◆ testInterpolatedDataSets()

void WDataSetTimeSeriesTest::testInterpolatedDataSets ( )
inline

Interpolated datasets need to be correct.

Definition at line 358 of file WDataSetTimeSeries_test.h.

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

+ Here is the call graph for this function:

◆ testIsTimeSlice()

void WDataSetTimeSeriesTest::testIsTimeSlice ( )
inline

Times that were provided on construction should be found.

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

Definition at line 243 of file WDataSetTimeSeries_test.h.

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

+ Here is the call graph for this function:

◆ testLBTime()

void WDataSetTimeSeriesTest::testLBTime ( )
inline

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 475 of file WDataSetTimeSeries_test.h.

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

+ Here is the call graph for this function:

◆ testTimeMinMax()

void WDataSetTimeSeriesTest::testTimeMinMax ( )
inline

The correct minimum and maximum times should be returned.

Definition at line 214 of file WDataSetTimeSeries_test.h.

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

+ Here is the call graph for this function:

◆ testUBTime()

void WDataSetTimeSeriesTest::testUBTime ( )
inline

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 508 of file WDataSetTimeSeries_test.h.

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

+ Here is the call graph for this function:

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