9 #include <boost/test/unit_test.hpp>
16 namespace utf = boost::unit_test;
21 volatile float j = 0.0;
22 volatile float r = 123 /
j;
27 std::cout <<
"PRE OVERFLOW" << std::endl;
28 volatile float j = std::numeric_limits<float>::max();
29 volatile float r = j *
j;
31 std::cout <<
"POST OVERFLOW" << std::endl;
35 volatile float j = -1;
36 volatile float r = std::sqrt(j);
42 volatile float p = k / 0.0;
48 namespace Acts::Test {
50 BOOST_AUTO_TEST_SUITE(FpeMonitorTest)
126 BOOST_CHECK_EQUAL(mon.
result().
count(FpeType::FLTINV), 0);
130 BOOST_CHECK_EQUAL(mon.
result().
count(FpeType::FLTINV), 1);
135 BOOST_CHECK_EQUAL(mon.
result().
count(FpeType::FLTINV), 1);
140 BOOST_CHECK_EQUAL(mon.
result().
count(FpeType::FLTINV), 2);
146 BOOST_CHECK_EQUAL(mon.
result().
count(FpeType::FLTINV), 3);
182 BOOST_CHECK_EQUAL(mon.
result().
count(FpeType::FLTINV), 1);
183 BOOST_CHECK_EQUAL(mon2.
result().
count(FpeType::FLTOVF), 1);
184 BOOST_CHECK_EQUAL(merged.count(FpeType::FLTINV), 1);
185 BOOST_CHECK_EQUAL(merged.count(FpeType::FLTOVF), 1);
186 BOOST_CHECK_EQUAL(merged.numStackTraces(), 2);
188 BOOST_CHECK_EQUAL(merged.count(FpeType::FLTINV), 1);
189 BOOST_CHECK_EQUAL(merged.count(FpeType::FLTOVF), 1);
190 BOOST_CHECK_EQUAL(merged.count(FpeType::FLTDIV), 1);
191 BOOST_CHECK_EQUAL(merged.numStackTraces(), 3);
212 BOOST_CHECK_EQUAL(
merged.count(FpeType::FLTINV), 2);
213 BOOST_CHECK_EQUAL(
merged.stackTraces().size(), 1);
225 BOOST_CHECK_EQUAL(mon.
result().
count(FpeType::FLTINV), 1);
226 BOOST_CHECK_EQUAL(mon.
result().
count(FpeType::FLTOVF), 0);
227 BOOST_CHECK_EQUAL(mon.
result().
count(FpeType::FLTDIV), 0);
231 BOOST_CHECK(!mon2.result().encountered(FpeType::FLTINV));
232 BOOST_CHECK(!mon2.result().encountered(FpeType::FLTOVF));
233 BOOST_CHECK(!mon2.result().encountered(FpeType::FLTDIV));
238 BOOST_CHECK(!mon2.result().encountered(FpeType::FLTINV));
239 BOOST_CHECK(!mon2.result().encountered(FpeType::FLTOVF));
240 BOOST_CHECK(!mon2.result().encountered(FpeType::FLTDIV));
244 BOOST_CHECK_EQUAL(mon.
result().
count(FpeType::FLTINV), 1);
245 BOOST_CHECK_EQUAL(mon.
result().
count(FpeType::FLTOVF), 0);
246 BOOST_CHECK_EQUAL(mon.
result().
count(FpeType::FLTDIV), 0);
251 BOOST_CHECK_EQUAL(mon.
result().
count(FpeType::FLTINV), 2);
252 BOOST_CHECK_EQUAL(mon.
result().
count(FpeType::FLTOVF), 0);
253 BOOST_CHECK_EQUAL(mon.
result().
count(FpeType::FLTDIV), 0);
256 BOOST_AUTO_TEST_SUITE_END()