OpenWalnut
1.4.0
|
Unit tests the time series class. More...
#include <WDataSetTimeSeries_test.h>
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 < boost::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 ×) |
A helper function that creates some input data. More... | |
void | setUp () |
Setup logger and other stuff for each test. More... | |
Unit tests the time series class.
Definition at line 45 of file WDataSetTimeSeries_test.h.
|
private |
a typedef
Definition at line 48 of file WDataSetTimeSeries_test.h.
|
private |
a typdef
Definition at line 51 of file WDataSetTimeSeries_test.h.
|
inlineprivate |
A helper function that creates some input data.
data | An array of data values, one for each time slice. |
number | The number of time slices. |
dsets | The output datasets. |
times | Some 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().
|
inlineprivate |
Setup logger and other stuff for each test.
Definition at line 572 of file WDataSetTimeSeries_test.h.
References WLogger::startup().
|
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 58 of file WDataSetTimeSeries_test.h.
References createData(), WDataSetTimeSeries::m_dataSets, and WMatrix< T >::makeIdentity().
|
inline |
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().
|
inline |
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.
|
inline |
Interpolation of values should be correct.
Definition at line 431 of file WDataSetTimeSeries_test.h.
References createData(), wlimits::FLT_EPS, and WDataSetTimeSeries::interpolate().
|
inline |
Interpolated datasets need to be correct.
Definition at line 359 of file WDataSetTimeSeries_test.h.
References WDataSetTimeSeries::calcDataSetAtTime(), createData(), and wlimits::FLT_EPS.
|
inline |
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().
|
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 476 of file WDataSetTimeSeries_test.h.
References createData(), wlimits::FLT_EPS, and WDataSetTimeSeries::getLBTimeSlice().
|
inline |
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().
|
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 509 of file WDataSetTimeSeries_test.h.
References createData(), wlimits::FLT_EPS, and WDataSetTimeSeries::getUBTimeSlice().