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. | |
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 ×) |
A helper function that creates some input data. | |
void | setUp () |
Setup logger and other stuff for each test. |
Unit tests the time series class.
Definition at line 45 of file WDataSetTimeSeries_test.h.
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.
void WDataSetTimeSeriesTest::createData | ( | double * | data, |
int | number, | ||
DataSetPtrVector & | dsets, | ||
TimesVector & | times | ||
) | [inline, private] |
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().
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().
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 58 of file WDataSetTimeSeries_test.h.
References createData(), WDataSetTimeSeries::m_dataSets, and WMatrix< T >::makeIdentity().
void WDataSetTimeSeriesTest::testGetDataSetPtrAtTimeSlice | ( | ) | [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().
void WDataSetTimeSeriesTest::testGetNearestTimeSlice | ( | ) | [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.
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().
void WDataSetTimeSeriesTest::testInterpolatedDataSets | ( | ) | [inline] |
Interpolated datasets need to be correct.
Definition at line 359 of file WDataSetTimeSeries_test.h.
References WDataSetTimeSeries::calcDataSetAtTime(), createData(), and wlimits::FLT_EPS.
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 244 of file WDataSetTimeSeries_test.h.
References createData(), wlimits::FLT_EPS, and WDataSetTimeSeries::isTimeSlice().
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 476 of file WDataSetTimeSeries_test.h.
References createData(), wlimits::FLT_EPS, and WDataSetTimeSeries::getLBTimeSlice().
void WDataSetTimeSeriesTest::testTimeMinMax | ( | ) | [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().
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 509 of file WDataSetTimeSeries_test.h.
References createData(), wlimits::FLT_EPS, and WDataSetTimeSeries::getUBTimeSlice().