1 // 2 // Negative test for BOOST_TEST_THROWS 3 // 4 // Copyright (c) 2014 Peter Dimov 5 // 6 // Distributed under the Boost Software License, Version 1.0. 7 // See accompanying file LICENSE_1_0.txt or copy at 8 // http://www.boost.org/LICENSE_1_0.txt 9 // 10 11 #include <boost/core/lightweight_test.hpp> 12 13 struct X 14 { 15 }; 16 f()17void f() 18 { 19 throw 5; 20 } 21 main()22int main() 23 { 24 BOOST_TEST_THROWS( f(), X ); 25 26 return boost::report_errors(); 27 } 28