Files
Filesteststest_util_data_dsp_filters | |
---|---|
.. | |
readme.md | |
test_util_data_dsp_filters.ino | |
testdata.cpp | |
testdata.h | |
testdata.ods |
readme.mdPurpose of the tests
To confirm that any of the recent modifications of classes derived from class TemplateFilter in file util_data, namespace util::dsp (digital signal processing and filtering) did not introduce anomalies to classes' performance
Test data
Refer to testdata.ods for test data sets and related calculactions (Free LibreOffice Calc is reqired to open an .ods file).
Running the tests
Copy here all necessary files from main project directory. The files to be copied are as follows:
- util_data.h
- util_data.cpp
Copy here all necessary files from tests/common directory. The files to be copied are as follows:
- test.h
Open .ino file in IDE, compile, upload and open serial monitor to observe test results
Expected test results
The following is expected in serial monitor window:
---------------- TESTING STARTED ----------------
Test function started: static void TestAbstractFilter::filterpassInputValueexpectValuePassedToFilter(), file testutildatadspfilters.ino PASSED Test function started: static void TestAbstractFilter::filterpassMultipleValuesexpectValuesPassedToFilter(), file testutildatadspfilters.ino PASSED Test function started: static void TestAbstractFilter::filtergetOutputValueexpectOutputValueReturned(), file testutildatadspfilters.ino PASSED Test function started: static void TestAbstractFilter::getDeltaTimefirstCallexpectZero(), file testutildatadspfilters.ino PASSED Test function started: static void TestAbstractFilter::getDeltaTimesecondCallexpectTimeDifference(), file testutildatadspfilters.ino PASSED Test function started: static void TestAbstractFilter::filterinitErrorsexpectFilterProcessNotCalled(), file testutildatadspfilters.ino PASSED Test function started: static void TestAbstractFilter::filtertooFewInputexpectFilterProcessNotCalled(), file testutildatadspfilters.ino PASSED Test function started: static void TestAbstractFilter::filtertooManyInputexpectWarningGeneratedIfFilterProcessReturnsOK(), file testutildatadspfilters.ino PASSED Test function started: static void TestMovingAverage::testPulseStepResponsesAvg2(), file testutildatadspfilters.ino PASSED Test function started: static void TestMovingAverage::testPulseStepResponsesAvg16(), file testutildatadspfilters.ino PASSED Test function started: static void TestMovingAverage::testFrequenciesResponsesAvg2(), file testutildatadspfilters.ino PASSED Test function started: static void TestMovingAverage::testFrequenciesResponsesAvg16(), file testutildatadspfilters.ino PASSED Test function started: static void TestMovingAverage::testSumOverflow(), file testutildatadspfilters.ino PASSED Test function started: static void TestLowPass::testPulseStepResponses20Hz(), file testutildatadspfilters.ino PASSED Test function started: static void TestLowPass::testFrequenciesResponses20Hz(), file testutildatadspfilters.ino PASSED Test function started: static void TestLowPass::testIncorrectFcValues(), file testutildatadspfilters.ino PASSED Test function started: static void TestLinearScale::testInitWithFactorAndOffsetexpectCorrectValues(), file testutildatadspfilters.ino PASSED Test function started: static void TestLinearScale::testInitWithTwoPointsexpectCorrectValues(), file testutildatadspfilters.ino PASSED Test function started: static void TestLinearScale::testInitWithOffsetexpectCorrectValues(), file testutildatadspfilters.ino PASSED Test function started: static void TestLinearScale::testIncorrectInitDataexpectZero(), file testutildatadspfilters.ino PASSED Test function started: static void TestSquareScale::testInitWithThreePointsexpectCorrectValues(), file testutildatadspfilters.ino PASSED Test function started: static void TestSquareScale::testInitWithABCexpectCorrectValues(), file testutildatadspfilters.ino PASSED Test function started: static void TestSquareScale::testVertexWarningexpectWarningWhenParabolaVertexIsInRange(), file testutildatadspfilters.ino PASSED Test function started: static void TestSquareScale::testIncorrectInitDataexpectZero(), file testutildatadspfilters.ino PASSED Test function started: static void TestSplineScale::testInitWithThreePointsexpectCorrectValues(), file testutildatadspfilters.ino PASSED Test function started: static void TestSplineScale::testInitWithUnsortedPointsexpectCorrectValues(), file testutildatadspfilters.ino PASSED Test function started: static void TestSplineScale::testIncorrectInitDataexpectZero(), file testutildatadspfilters.ino PASSED
---------------- TESTING FINISHED --------------- Test functions passed: 27 Test functions failed: 0
Failed tests
The following example illustrates failed tests reporting:
Test function started: static void test(), file test.ino
FAILED in line 1, file test.ino
Filter test data
Please refer to testdata.ods for a sets of filter input data and expected output data