example03.run-fail.cpp 948 B

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