• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
2 
3 //Distributed under the Boost Software License, Version 1.0. (See accompanying
4 //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
5 
6 #include <boost/config.hpp>
7 
8 #if defined( BOOST_NO_EXCEPTIONS )
9 #   error This program requires exception handling.
10 #endif
11 
12 #include <boost/exception/exception.hpp>
13 #include <boost/detail/lightweight_test.hpp>
14 
15 class
16 test_exception:
17     public boost::exception
18     {
19     };
20 
21 void
test_throw()22 test_throw()
23     {
24     throw test_exception();
25     }
26 
27 int
main()28 main()
29     {
30     try
31         {
32         test_throw();
33         BOOST_TEST(false);
34         }
35     catch(
36     test_exception & )
37         {
38         BOOST_TEST(true);
39         }
40     return boost::report_errors();
41     }
42