]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/accumulators/test/min.cpp
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / boost / libs / accumulators / test / min.cpp
1 // (C) Copyright Eric Niebler 2005.
2 // Use, modification and distribution are subject to the
3 // Boost Software License, Version 1.0. (See accompanying file
4 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
5
6 #include <boost/test/unit_test.hpp>
7 #include <boost/accumulators/accumulators.hpp>
8 #include <boost/accumulators/statistics/stats.hpp>
9 #include <boost/accumulators/statistics/min.hpp>
10
11 using namespace boost;
12 using namespace unit_test;
13 using namespace accumulators;
14
15 ///////////////////////////////////////////////////////////////////////////////
16 // test_stat
17 //
18 void test_stat()
19 {
20 accumulator_set<int, stats<tag::min> > acc;
21
22 acc(1);
23 BOOST_CHECK_EQUAL(1, (min)(acc));
24
25 acc(0);
26 BOOST_CHECK_EQUAL(0, (min)(acc));
27
28 acc(2);
29 BOOST_CHECK_EQUAL(0, (min)(acc));
30 }
31
32 ///////////////////////////////////////////////////////////////////////////////
33 // init_unit_test_suite
34 //
35 test_suite* init_unit_test_suite( int argc, char* argv[] )
36 {
37 test_suite *test = BOOST_TEST_SUITE("min test");
38
39 test->add(BOOST_TEST_CASE(&test_stat));
40
41 return test;
42 }