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
10using namespace boost;
11using namespace unit_test;
12using namespace accumulators;
13
14namespace my
15{
16 BOOST_PARAMETER_KEYWORD(tag, int_val)
17}
18
19///////////////////////////////////////////////////////////////////////////////
20// test_stat
21//
22void test_stat()
23{
24 int i = 42;
25 accumulator_set<double, stats<tag::value<int, my::tag::int_val> > > acc2(
26 my::int_val = i);
27
28 int val1 = value<int, my::tag::int_val>(arg1: acc2);
29 int val2 = value_tag<my::tag::int_val>(arg1: acc2);
30
31 BOOST_CHECK_EQUAL(i, val1);
32 BOOST_CHECK_EQUAL(i, val2);
33}
34
35///////////////////////////////////////////////////////////////////////////////
36// init_unit_test_suite
37//
38test_suite* init_unit_test_suite( int argc, char* argv[] )
39{
40 test_suite *test = BOOST_TEST_SUITE("value_accumulator test");
41
42 test->add(BOOST_TEST_CASE(&test_stat));
43
44 return test;
45}
46

source code of boost/libs/accumulators/test/value.cpp