20 #define BOOST_TEST_MODULE ( WaveformBaseline_test )
21 #include <boost/test/unit_test.hpp>
35 constexpr
float baselineValue { 6.6f };
39 BOOST_TEST((
baseline.fBaseline == baselineValue));
40 BOOST_TEST((
baseline.baseline() == baselineValue));
41 BOOST_TEST((
baseline() == baselineValue));
43 std::ostringstream sstr;
45 std::string
const baselineStr { sstr.str() };
47 sstr << baselineValue;
48 std::string
const baselineValueStr { sstr.str() };
50 BOOST_TEST((baselineStr == baselineValueStr));
57 std::ostringstream sstr;
67 sstr <<
"Baseline: " <<
baseline <<
" ADC";
70 BOOST_TEST((sstr.str() ==
"Baseline: 1.2 ADC"));
84 std::vector<ADCCount_t>
const data
85 { ADCCount_t{ -6 }, ADCCount_t{ -8 }, ADCCount_t{ -2 } };
95 std::vector<ADCCount_t> subtracted;
96 subtracted.reserve(data.size());
97 for (ADCCount_t sample: data) {
98 subtracted.emplace_back
99 (std::round(waveOps.subtractBaseline(sample.value())));
105 BOOST_TEST((subtracted.size() == data.size()));
107 BOOST_TEST((subtracted[0U] == ADCCount_t{ 4 }));
108 BOOST_TEST((subtracted[1U] == ADCCount_t{ 6 }));
109 BOOST_TEST((subtracted[2U] == ADCCount_t{ 0 }));
counts_as<> counts
Number of ADC counts, represented by signed short int.
Dimensioned variables related to electronics.