#include "boost/test/unit_test.hpp"
#include "cetlib/simple_stats.h"
#include <cmath>
Go to the source code of this file.
BOOST_AUTO_TEST_CASE |
( |
default_ctor_test |
| ) |
|
Definition at line 12 of file simple_stats_t.cc.
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()));
std::size_t size() const noexcept
double small() const noexcept
double mean() const 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
BOOST_AUTO_TEST_CASE |
( |
value_ctor_test |
| ) |
|
Definition at line 28 of file simple_stats_t.cc.
33 BOOST_TEST(
s.
size() == 1u);
34 BOOST_TEST(
s.max() ==
pi);
35 BOOST_TEST(
s.min() ==
pi);
36 BOOST_TEST(
s.small() ==
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)));
BOOST_AUTO_TEST_CASE |
( |
sample_test |
| ) |
|
Definition at line 45 of file simple_stats_t.cc.
51 BOOST_TEST(
s.
size() == 2u);
52 BOOST_TEST(
s.max() ==
pi);
53 BOOST_TEST(
s.min() == -
pi);
54 BOOST_TEST(
s.small() ==
pi);
55 BOOST_TEST(
s.sum() == 0.0);
56 BOOST_TEST(
s.sumsq() == 2 * pi *
pi);
58 BOOST_TEST(
s.mean() == 0.0);