exception_test.cpp 646 B

1234567891011121314151617181920212223242526272829303132333435
  1. //Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
  2. //Distributed under the Boost Software License, Version 1.0. (See accompanying
  3. //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  4. #include <boost/exception/exception.hpp>
  5. #include <boost/detail/lightweight_test.hpp>
  6. class
  7. test_exception:
  8. public boost::exception
  9. {
  10. };
  11. void
  12. test_throw()
  13. {
  14. throw test_exception();
  15. }
  16. int
  17. main()
  18. {
  19. try
  20. {
  21. test_throw();
  22. BOOST_TEST(false);
  23. }
  24. catch(
  25. test_exception & )
  26. {
  27. BOOST_TEST(true);
  28. }
  29. return boost::report_errors();
  30. }