4 // Copyright (C) 2008-2018 Lorenzo Caminiti
5 // Distributed under the Boost Software License, Version 1.0 (see accompanying
6 // file LICENSE_1_0.txt or a copy at http://www.boost.org/LICENSE_1_0.txt).
7 // See: http://www.boost.org/doc/libs/release/libs/contract/doc/html/index.html
9 #include <boost/contract/check.hpp>
10 #include <boost/contract/core/exception.hpp>
11 #include <boost/detail/lightweight_test.hpp>
13 struct err {}; // Global decl so visible in MSVC10 lambdas.
16 boost::contract::set_check_failure([] { throw err(); });
20 #ifdef BOOST_CONTRACT_TEST_ERROR
21 BOOST_CONTRACT_CHECK_AUDIT(
22 BOOST_CONTRACT_TEST_ERROR_expected_undeclared_identifier);
24 BOOST_CONTRACT_CHECK_AUDIT(false);
26 } catch(err const&) { threw = true; }
28 #if defined(BOOST_CONTRACT_AUDITS) && !defined(BOOST_CONTRACT_NO_CHECKS)
34 return boost::report_errors();