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) 5 6 // See http://www.boost.org/libs/test for the library home page. 7 8 //[example_code 9 #include <boost/test/included/unit_test.hpp> 10 #include <boost/bind/bind.hpp> 11 using namespace boost::unit_test; 12 13 class test_class 14 { 15 public: test_method1()16 void test_method1() 17 { 18 BOOST_TEST( true /* test assertion */ ); 19 } test_method2()20 void test_method2() 21 { 22 BOOST_TEST( false /* test assertion */ ); 23 } 24 }; 25 init_unit_test_suite(int,char * [])26test_suite* init_unit_test_suite( int /*argc*/, char* /*argv*/[] ) 27 { 28 boost::shared_ptr<test_class> tester( new test_class ); 29 30 framework::master_test_suite(). 31 add( BOOST_TEST_CASE( boost::bind( &test_class::test_method1, tester ))); 32 framework::master_test_suite(). 33 add( BOOST_TEST_CASE( boost::bind( &test_class::test_method2, tester ))); 34 return 0; 35 } 36 //] 37