1 #define BOOST_TEST_MODULE (simple_stats test) 2 #include "boost/test/unit_test.hpp" 10 BOOST_AUTO_TEST_SUITE(simple_stats_test)
16 BOOST_TEST(s.
size() == 0u);
17 BOOST_TEST((std::isinf(s.
max()) && s.
max() < 0.0));
18 BOOST_TEST((std::isinf(s.
min()) && s.
min() > 0.0));
19 BOOST_TEST(std::isinf(s.
small()));
20 BOOST_TEST(s.
sum() == 0.0);
21 BOOST_TEST(s.
sumsq() == 0.0);
23 BOOST_TEST(std::isnan(s.
mean()));
24 BOOST_TEST(std::isnan(s.
rms()));
25 BOOST_TEST(std::isnan(s.
rms0()));
33 BOOST_TEST(s.
size() == 1u);
34 BOOST_TEST(s.
max() ==
pi);
35 BOOST_TEST(s.
min() ==
pi);
37 BOOST_TEST(s.
sum() ==
pi);
38 BOOST_TEST(s.
sumsq() == pi *
pi);
40 BOOST_TEST(s.
mean() ==
pi);
41 BOOST_TEST(std::isnan(s.
rms()));
42 BOOST_TEST(std::isnan(s.
rms0(1u)));
51 BOOST_TEST(s.
size() == 2u);
52 BOOST_TEST(s.
max() ==
pi);
53 BOOST_TEST(s.
min() == -
pi);
55 BOOST_TEST(s.
sum() == 0.0);
56 BOOST_TEST(s.
sumsq() == 2 * pi *
pi);
58 BOOST_TEST(s.
mean() == 0.0);
61 BOOST_AUTO_TEST_SUITE_END()
std::size_t size() const noexcept
double small() const noexcept
double mean() const noexcept
BOOST_AUTO_TEST_CASE(default_ctor_test)
void sample(double) noexcept
double rms0(std::size_t nparams=0u) const noexcept
double min() const noexcept
double max() const noexcept
double sum() const noexcept
double sumsq() const noexcept
double rms(std::size_t nparams=1u) const noexcept