OpenWalnut
1.5.0dev
|
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< 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 ×) |
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 44 of file WDataSetTimeSeries_test.h.
|
private |
a typedef
Definition at line 47 of file WDataSetTimeSeries_test.h.
|
private |
a typdef
Definition at line 50 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 545 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 571 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 57 of file WDataSetTimeSeries_test.h.
References createData(), and WMatrix< T >::makeIdentity().
|
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().
|
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.
|
inline |
Interpolation of values should be correct.
Definition at line 430 of file WDataSetTimeSeries_test.h.
References createData(), wlimits::FLT_EPS, and WDataSetTimeSeries::interpolate().
|
inline |
Interpolated datasets need to be correct.
Definition at line 358 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 243 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 475 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 214 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 508 of file WDataSetTimeSeries_test.h.
References createData(), wlimits::FLT_EPS, and WDataSetTimeSeries::getUBTimeSlice().