2014-06-05 16:57:22 +03:00
|
|
|
//
|
|
|
|
// Negative test for BOOST_TEST_THROWS
|
|
|
|
//
|
|
|
|
// Copyright (c) 2014 Peter Dimov
|
|
|
|
//
|
|
|
|
// Distributed under the Boost Software License, Version 1.0.
|
|
|
|
// See accompanying file LICENSE_1_0.txt or copy at
|
|
|
|
// http://www.boost.org/LICENSE_1_0.txt
|
|
|
|
//
|
|
|
|
|
2021-11-01 04:17:51 +02:00
|
|
|
#if defined(_MSC_VER)
|
|
|
|
# pragma warning(disable: 4702) // unreachable code
|
|
|
|
#endif
|
|
|
|
|
2020-01-01 08:57:25 -05:00
|
|
|
#include <boost/core/lightweight_test.hpp>
|
2014-06-05 16:57:22 +03:00
|
|
|
|
|
|
|
struct X
|
|
|
|
{
|
|
|
|
};
|
|
|
|
|
|
|
|
void f()
|
|
|
|
{
|
|
|
|
throw 5;
|
|
|
|
}
|
|
|
|
|
|
|
|
int main()
|
|
|
|
{
|
|
|
|
BOOST_TEST_THROWS( f(), X );
|
|
|
|
|
|
|
|
return boost::report_errors();
|
|
|
|
}
|