From 483eb2f56657e8e7f419ab1a4fab8dce9ade8609 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 27 Apr 2024 20:24:20 +0200 Subject: Adding upstream version 14.2.21. Signed-off-by: Daniel Baumann --- src/boost/libs/accumulators/test/value.cpp | 45 ++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 src/boost/libs/accumulators/test/value.cpp (limited to 'src/boost/libs/accumulators/test/value.cpp') diff --git a/src/boost/libs/accumulators/test/value.cpp b/src/boost/libs/accumulators/test/value.cpp new file mode 100644 index 00000000..3f059ce2 --- /dev/null +++ b/src/boost/libs/accumulators/test/value.cpp @@ -0,0 +1,45 @@ +// (C) Copyright Eric Niebler 2005. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include + +using namespace boost; +using namespace unit_test; +using namespace accumulators; + +namespace my +{ + BOOST_PARAMETER_KEYWORD(tag, int_val) +} + +/////////////////////////////////////////////////////////////////////////////// +// test_stat +// +void test_stat() +{ + int i = 42; + accumulator_set > > acc2( + my::int_val = i); + + int val1 = value(acc2); + int val2 = value_tag(acc2); + + BOOST_CHECK_EQUAL(i, val1); + BOOST_CHECK_EQUAL(i, val2); +} + +/////////////////////////////////////////////////////////////////////////////// +// init_unit_test_suite +// +test_suite* init_unit_test_suite( int argc, char* argv[] ) +{ + test_suite *test = BOOST_TEST_SUITE("value_accumulator test"); + + test->add(BOOST_TEST_CASE(&test_stat)); + + return test; +} -- cgit v1.2.3