33 constexpr float step = 0.01;
34 constexpr auto padSeparation = 1. / ClusterType::scalePadPacked;
35 constexpr auto timeSeparation = 1. / ClusterType::scaleTimePacked;
36 constexpr auto sigmaPadSeparation = 1. / ClusterType::scaleSigmaPadPacked;
37 constexpr auto sigmaTimeSeparation = 1. / ClusterType::scaleSigmaTimePacked;
40 static_assert(step < padSeparation,
"inconsistent step size");
41 static_assert(step < timeSeparation,
"inconsistent step size");
43 ClusterType somecluster;
44 for (
float v = 0.;
v < 5.;
v += step) {
45 somecluster.setPad(
v);
46 auto readback = somecluster.getPad();
47 auto delta = padSeparation;
48 BOOST_REQUIRE(readback >
v - delta && readback <
v + delta);
51 somecluster.setTime(
v);
52 readback = somecluster.getTime();
53 delta = timeSeparation;
54 BOOST_REQUIRE(readback >
v - delta && readback <
v + delta);
57 somecluster.setSigmaPad(
v);
58 readback = somecluster.getSigmaPad();
59 delta = sigmaPadSeparation;
60 BOOST_REQUIRE(readback >
v - delta && readback <
v + delta);
63 somecluster.setSigmaTime(
v);
64 readback = somecluster.getSigmaTime();
65 delta = sigmaTimeSeparation;
66 BOOST_REQUIRE(readback >
v - delta && readback <
v + delta);
71 float maxTime = 256 * 512;
73 somecluster.setTimeFlags(maxTime,
flags);
74 auto read = somecluster.getTime();
75 BOOST_REQUIRE(read > maxTime - timeSeparation && read < maxTime + timeSeparation);
76 BOOST_REQUIRE(somecluster.getFlags() == 0x66);
79 somecluster.setFlags(0);
80 somecluster.setTime(4 * maxTime);
81 BOOST_REQUIRE(somecluster.getFlags() == 0);