diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index 693ba1fe..0b91890f 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -1,4 +1,4 @@ -# (C) Copyright Gennadiy Rozental 2001-2007. +# (C) Copyright Gennadiy Rozental 2001-2010. # 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) diff --git a/test/algorithms_test.cpp b/test/algorithms_test.cpp index ae95fb1d..b3fbf65f 100644 --- a/test/algorithms_test.cpp +++ b/test/algorithms_test.cpp @@ -1,4 +1,4 @@ -// (C) Copyright Gennadiy Rozental 2003-2008. +// (C) Copyright Gennadiy Rozental 2003-2010. // Distributed under 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) diff --git a/test/basic_cstring_test.cpp b/test/basic_cstring_test.cpp index 3dd72147..501813e8 100644 --- a/test/basic_cstring_test.cpp +++ b/test/basic_cstring_test.cpp @@ -1,4 +1,4 @@ -// (C) Copyright Gennadiy Rozental 2001-2008. +// (C) Copyright Gennadiy Rozental 2001-2010. // Distributed under 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) diff --git a/test/boost_check_equal_str.cpp b/test/boost_check_equal_str.cpp index 325543d0..434d0e83 100644 --- a/test/boost_check_equal_str.cpp +++ b/test/boost_check_equal_str.cpp @@ -1,4 +1,4 @@ -// (C) Copyright Gennadiy Rozental 2001-2008. +// (C) Copyright Gennadiy Rozental 2001-2010. // Distributed under 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) diff --git a/test/class_properties_test.cpp b/test/class_properties_test.cpp index cf85af5d..0b8a70db 100644 --- a/test/class_properties_test.cpp +++ b/test/class_properties_test.cpp @@ -1,4 +1,4 @@ -// (C) Copyright Gennadiy Rozental 2003-2008. +// (C) Copyright Gennadiy Rozental 2003-2010. // Distributed under 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) diff --git a/test/config_file_iterator_test.cpp b/test/config_file_iterator_test.cpp index 59c40128..01b22e70 100644 --- a/test/config_file_iterator_test.cpp +++ b/test/config_file_iterator_test.cpp @@ -1,4 +1,4 @@ -// (C) Copyright Gennadiy Rozental 2001-2008. +// (C) Copyright Gennadiy Rozental 2001-2010. // Distributed under 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) diff --git a/test/config_file_test.cpp b/test/config_file_test.cpp index 9c24fdec..e33cf5ec 100644 --- a/test/config_file_test.cpp +++ b/test/config_file_test.cpp @@ -1,4 +1,4 @@ -// (C) Copyright Gennadiy Rozental 2001-2008. +// (C) Copyright Gennadiy Rozental 2001-2010. // Distributed under 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) diff --git a/test/custom_exception_test.cpp b/test/custom_exception_test.cpp index ec53e3c8..e0a81811 100644 --- a/test/custom_exception_test.cpp +++ b/test/custom_exception_test.cpp @@ -1,4 +1,4 @@ -// (C) Copyright Gennadiy Rozental 2003-2008. +// (C) Copyright Gennadiy Rozental 2003-2010. // Distributed under 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) diff --git a/test/errors_handling_test.cpp b/test/errors_handling_test.cpp index e48ca03f..f9576a62 100644 --- a/test/errors_handling_test.cpp +++ b/test/errors_handling_test.cpp @@ -1,4 +1,4 @@ -// (C) Copyright Gennadiy Rozental 2001-2008. +// (C) Copyright Gennadiy Rozental 2001-2010. // (C) Copyright Beman Dawes 2001. // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at diff --git a/test/fixed_mapping_test.cpp b/test/fixed_mapping_test.cpp index b91b0d4f..cfcfc197 100644 --- a/test/fixed_mapping_test.cpp +++ b/test/fixed_mapping_test.cpp @@ -1,4 +1,4 @@ -// (C) Copyright Gennadiy Rozental 2001-2008. +// (C) Copyright Gennadiy Rozental 2001-2010. // Distributed under 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) diff --git a/test/foreach_test.cpp b/test/foreach_test.cpp index 7034bc57..8ca4a435 100644 --- a/test/foreach_test.cpp +++ b/test/foreach_test.cpp @@ -1,4 +1,4 @@ -// (C) Copyright Gennadiy Rozental 2001-2008. +// (C) Copyright Gennadiy Rozental 2001-2010. // Distributed under 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) diff --git a/test/ifstream_line_iterator_test.cpp b/test/ifstream_line_iterator_test.cpp index 7a665ec2..7d12d75c 100644 --- a/test/ifstream_line_iterator_test.cpp +++ b/test/ifstream_line_iterator_test.cpp @@ -1,4 +1,4 @@ -// (C) Copyright Gennadiy Rozental 2001-2008. +// (C) Copyright Gennadiy Rozental 2001-2010. // Distributed under 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) diff --git a/test/minimal_test.cpp b/test/minimal_test.cpp index 350c00c3..ae5b6b83 100644 --- a/test/minimal_test.cpp +++ b/test/minimal_test.cpp @@ -1,4 +1,4 @@ -// (C) Copyright Gennadiy Rozental 2001-2008. +// (C) Copyright Gennadiy Rozental 2001-2010. // Distributed under 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) diff --git a/test/online_test.cpp b/test/online_test.cpp index 89282835..54ee65ac 100644 --- a/test/online_test.cpp +++ b/test/online_test.cpp @@ -1,4 +1,4 @@ -// (C) Copyright Gennadiy Rozental 2001-2008. +// (C) Copyright Gennadiy Rozental 2001-2010. // Distributed under 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) diff --git a/test/output_test_stream_test.cpp b/test/output_test_stream_test.cpp index 82a4bb1f..6cedae9f 100644 --- a/test/output_test_stream_test.cpp +++ b/test/output_test_stream_test.cpp @@ -1,4 +1,4 @@ -// (C) Copyright Gennadiy Rozental 2001-2008. +// (C) Copyright Gennadiy Rozental 2001-2010. // Distributed under 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) diff --git a/test/parameterized_test_test.cpp b/test/parameterized_test_test.cpp index 93965e42..d9fab98e 100644 --- a/test/parameterized_test_test.cpp +++ b/test/parameterized_test_test.cpp @@ -1,4 +1,4 @@ -// (C) Copyright Gennadiy Rozental 2002-2008. +// (C) Copyright Gennadiy Rozental 2002-2010. // Distributed under 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) diff --git a/test/prg_exec_fail1.cpp b/test/prg_exec_fail1.cpp index d246c74f..e2885a21 100644 --- a/test/prg_exec_fail1.cpp +++ b/test/prg_exec_fail1.cpp @@ -1,4 +1,4 @@ -// (C) Copyright Gennadiy Rozental 2001-2008. +// (C) Copyright Gennadiy Rozental 2001-2010. // (C) Copyright Beman Dawes 2001. // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at diff --git a/test/prg_exec_fail2.cpp b/test/prg_exec_fail2.cpp index 8663a4e4..eddfb735 100644 --- a/test/prg_exec_fail2.cpp +++ b/test/prg_exec_fail2.cpp @@ -1,4 +1,4 @@ -// (C) Copyright Gennadiy Rozental 2001-2008. +// (C) Copyright Gennadiy Rozental 2001-2010. // (C) Copyright Beman Dawes 2001. // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at diff --git a/test/prg_exec_fail3.cpp b/test/prg_exec_fail3.cpp index 76a81146..dba918cc 100644 --- a/test/prg_exec_fail3.cpp +++ b/test/prg_exec_fail3.cpp @@ -1,4 +1,4 @@ -// (C) Copyright Gennadiy Rozental 2002-2008. +// (C) Copyright Gennadiy Rozental 2002-2010. // Distributed under 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) diff --git a/test/prg_exec_fail4.cpp b/test/prg_exec_fail4.cpp index 9772f520..51165c52 100644 --- a/test/prg_exec_fail4.cpp +++ b/test/prg_exec_fail4.cpp @@ -1,4 +1,4 @@ -// (C) Copyright Gennadiy Rozental 2003-2008. +// (C) Copyright Gennadiy Rozental 2003-2010. // Distributed under 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) diff --git a/test/result_report_test.cpp b/test/result_report_test.cpp index 576771d4..e17e6296 100644 --- a/test/result_report_test.cpp +++ b/test/result_report_test.cpp @@ -1,4 +1,4 @@ -// (C) Copyright Gennadiy Rozental 2001-2008. +// (C) Copyright Gennadiy Rozental 2001-2010. // Distributed under 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) diff --git a/test/sync_access_test.cpp b/test/sync_access_test.cpp index b65160f3..d410a541 100644 --- a/test/sync_access_test.cpp +++ b/test/sync_access_test.cpp @@ -1,3 +1,18 @@ +// (C) Copyright Gennadiy Rozental 2008-2010. +// Distributed under 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) + +// See http://www.boost.org/libs/test for the library home page. +// +// File : $RCSfile$ +// +// Version : $Revision$ +// +// Description : tests Unit Test Framework usability in MT environment with +// Boost.Test calls externally synchronized +// *************************************************************************** + #define BOOST_TEST_MODULE sync_access_test #include diff --git a/test/test_case_template_test.cpp b/test/test_case_template_test.cpp index 0b55600e..3387de52 100644 --- a/test/test_case_template_test.cpp +++ b/test/test_case_template_test.cpp @@ -1,4 +1,4 @@ -// (C) Copyright Gennadiy Rozental 2003-2008. +// (C) Copyright Gennadiy Rozental 2003-2010. // Distributed under 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) diff --git a/test/test_fp_comparisons.cpp b/test/test_fp_comparisons.cpp index 3557d542..dfad0892 100644 --- a/test/test_fp_comparisons.cpp +++ b/test/test_fp_comparisons.cpp @@ -1,4 +1,4 @@ -// (C) Copyright Gennadiy Rozental 2001-2008. +// (C) Copyright Gennadiy Rozental 2001-2010. // Distributed under 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) @@ -50,8 +50,9 @@ BOOST_AUTO_TEST_CASE_TEMPLATE( test_BOOST_CHECK_CLOSE, FPT, test_types ) fp2 = static_cast(second); \ epsilon = static_cast(e); \ \ - BOOST_CHECK_PREDICATE( bind(not_func, bind(check_is_close, _1, _2, _3)), \ - (fp1)(fp2)(percent_tolerance( epsilon )) ); \ + BOOST_CHECK_PREDICATE( \ + bind(not_func, bind(check_is_close, _1, _2, _3)), \ + (fp1)(fp2)(fpc::percent_tolerance( epsilon )) ); \ /**/ FPT fp1, fp2, epsilon; @@ -99,8 +100,9 @@ BOOST_AUTO_TEST_CASE_TEMPLATE( test_CHECK_CLOSE_FRACTION, FPT, test_types ) fp2 = static_cast(second); \ epsilon = static_cast(e); \ \ - BOOST_CHECK_PREDICATE( bind(not_func, bind(check_is_close, _1, _2, _3)), \ - (fp1)(fp2)(fraction_tolerance( epsilon )) ); \ + BOOST_CHECK_PREDICATE( \ + bind(not_func, bind(check_is_close, _1, _2, _3)), \ + (fp1)(fp2)(epsilon) ); \ /**/ FPT fp1, fp2, epsilon; @@ -152,26 +154,28 @@ BOOST_AUTO_TEST_CASE( test_CHECK_SMALL ) //____________________________________________________________________________// +namespace fpc = boost::math::fpc; + BOOST_AUTO_TEST_CASE( test_close_at_tolerance ) { double fp1 = 1.00000001; double fp2 = 1.00000002; double epsilon = 1e-6; - close_at_tolerance pred( percent_tolerance( epsilon ), FPC_WEAK ); + fpc::close_at_tolerance pred( fpc::percent_tolerance( epsilon ), fpc::FPC_WEAK ); BOOST_CHECK_PREDICATE( pred, (fp1)(fp2) ); BOOST_CHECK_PREDICATE( bind(not_func, bind(check_is_close, _1, _2, _3)), - (fp1)(fp2)(percent_tolerance( epsilon )) ); + (fp1)(fp2)(fpc::percent_tolerance( epsilon )) ); fp1 = 1.23456e-10; fp2 = 1.23457e-10; epsilon = 8.1e-4; - BOOST_CHECK_PREDICATE( close_at_tolerance( percent_tolerance( epsilon ), FPC_WEAK ), (fp1)(fp2) ); + BOOST_CHECK_PREDICATE( fpc::close_at_tolerance( fpc::percent_tolerance( epsilon ), fpc::FPC_WEAK ), (fp1)(fp2) ); BOOST_CHECK_PREDICATE( bind(not_func, - bind(close_at_tolerance( percent_tolerance( epsilon ) ), _1, _2)), (fp1)(fp2) ); + bind(fpc::close_at_tolerance( fpc::percent_tolerance( epsilon ) ), _1, _2)), (fp1)(fp2) ); } //____________________________________________________________________________// diff --git a/test/test_tools_test.cpp b/test/test_tools_test.cpp index a23e1265..89ef55f1 100644 --- a/test/test_tools_test.cpp +++ b/test/test_tools_test.cpp @@ -1,4 +1,4 @@ -// (C) Copyright Gennadiy Rozental 2001-2008. +// (C) Copyright Gennadiy Rozental 2001-2010. // Distributed under 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) @@ -548,7 +548,7 @@ TEST_CASE( test_BOOST_TEST_PASSPOINT ) //____________________________________________________________________________// -TEST_CASE( test_BOOST_IS_DEFINED ) +BOOST_AUTO_TEST_CASE( test_BOOST_IS_DEFINED ) { #define SYMBOL1 #define SYMBOL2 std::cout @@ -566,6 +566,38 @@ TEST_CASE( test_BOOST_IS_DEFINED ) //____________________________________________________________________________// +int goo() +{ + static int i = 0; + return i++; +} + +struct Foo : boost::noncopyable { + static int copy_counter; + + Foo() {} + Foo( Foo const& ) { copy_counter++; } +}; + +int Foo::copy_counter = 0; + +bool operator==( Foo const&, Foo const& ) { return true; } +std::ostream& operator<<( std::ostream& os, Foo const& ) { return os << "Foo"; } + +BOOST_AUTO_TEST_CASE( test_argument_handling ) +{ + BOOST_CHECK_EQUAL( goo(), 0 ); + BOOST_CHECK_EQUAL( goo(), 1 ); + BOOST_CHECK_EQUAL( 2, goo() ); + BOOST_CHECK_EQUAL( 3, goo() ); + BOOST_CHECK_NE( goo(), 5 ); + BOOST_CHECK_EQUAL( Foo(), Foo() ); + BOOST_CHECK_EQUAL( Foo::copy_counter, 0 ); +} + +//____________________________________________________________________________// + + // !! CHECK_SMALL // EOF diff --git a/test/test_tree_management_test.cpp b/test/test_tree_management_test.cpp index 54090877..4fea7f5f 100644 --- a/test/test_tree_management_test.cpp +++ b/test/test_tree_management_test.cpp @@ -1,4 +1,4 @@ -// (C) Copyright Gennadiy Rozental 2007. +// (C) Copyright Gennadiy Rozental 2007-2010. // Distributed under 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) diff --git a/test/token_iterator_test.cpp b/test/token_iterator_test.cpp index 71188567..23674efb 100644 --- a/test/token_iterator_test.cpp +++ b/test/token_iterator_test.cpp @@ -1,4 +1,4 @@ -// (C) Copyright Gennadiy Rozental 2001-2008. +// (C) Copyright Gennadiy Rozental 2001-2010. // Distributed under 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)