9 #include <boost/test/data/test_case.hpp>
10 #include <boost/test/tools/context.hpp>
11 #include <boost/test/unit_test.hpp>
19 #include <type_traits>
23 BOOST_AUTO_TEST_SUITE(TrackStatePropMaskTest)
28 auto bs1 = PM::Predicted;
33 auto bs2 = PM::Calibrated;
38 auto bs3 = PM::Calibrated | PM::Predicted;
53 auto cnv = [](
auto a) -> std::bitset<8> {
57 BOOST_CHECK(cnv(PM::All).all());
58 BOOST_CHECK(cnv(PM::None).none());
61 std::array<PM, 5>
values{PM::Predicted, PM::Filtered, PM::Smoothed,
63 for (
size_t i = 0;
i <
values.size();
i++) {
64 for (
size_t j = 0;
j <
values.size();
j++) {
69 BOOST_CHECK(cnv(a & b).
count() == 1);
71 BOOST_CHECK(cnv(a & b).none());
76 BOOST_CHECK(cnv(PM::Predicted ^ PM::Filtered).
count() == 2);
77 BOOST_CHECK(cnv(PM::Predicted ^ PM::Predicted).none());
78 BOOST_CHECK(~(PM::Predicted | PM::Calibrated) ==
79 (PM::All ^ PM::Predicted ^ PM::Calibrated));
82 BOOST_CHECK(cnv(base) == 0);
85 BOOST_CHECK(cnv(base) == 0);
88 BOOST_CHECK(base == PM::Filtered);
90 base |= PM::Calibrated;
91 BOOST_CHECK(base == (PM::Filtered | PM::Calibrated));
94 BOOST_CHECK(base == ~(PM::Filtered | PM::Calibrated));
96 BOOST_AUTO_TEST_SUITE_END()