]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/test/doc/examples/example08.run-fail.cpp
1 // (C) Copyright Gennadiy Rozental 2011-2015.
2 // Distributed under the Boost Software License, Version 1.0.
3 // (See accompanying file LICENSE_1_0.txt or copy at
4 // http://www.boost.org/LICENSE_1_0.txt)
6 // See http://www.boost.org/libs/test for the library home page.
9 #define BOOST_TEST_ALTERNATIVE_INIT_API
10 #include <boost/test/included/unit_test.hpp>
11 #include <boost/test/floating_point_comparison.hpp>
12 #include <boost/test/parameterized_test.hpp>
13 #include <boost/bind.hpp>
14 using namespace boost::unit_test
;
15 namespace tt
=boost::test_tools
;
16 using namespace boost
;
20 void test_method( double d
)
22 BOOST_TEST( d
* 100 == (double)(int)(d
*100), tt::tolerance(0.0001) );
28 double params
[] = { 1., 1.1, 1.01, 1.001, 1.0001 };
30 boost::function
<void (double)> test_method
= bind( &test_class::test_method
, &tester
, _1
);
32 framework::master_test_suite().
33 add( BOOST_PARAM_TEST_CASE( test_method
, params
, params
+5 ) );