]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/contract/test/public_function/decl_pre_none.cpp
2 // Copyright (C) 2008-2018 Lorenzo Caminiti
3 // Distributed under the Boost Software License, Version 1.0 (see accompanying
4 // file LICENSE_1_0.txt or a copy at http://www.boost.org/LICENSE_1_0.txt).
5 // See: http://www.boost.org/doc/libs/release/libs/contract/doc/html/index.html
7 // Test all derived and base classes without preconditions.
9 #define BOOST_CONTRACT_TEST_NO_A_PRE
10 #define BOOST_CONTRACT_TEST_NO_B_PRE
11 #define BOOST_CONTRACT_TEST_NO_C_PRE
14 #include <boost/detail/lightweight_test.hpp>
18 std::ostringstream ok
; ok
// Test nothing fails.
19 #ifndef BOOST_CONTRACT_NO_ENTRY_INVARIANTS
20 << "c::static_inv" << std::endl
21 << "c::inv" << std::endl
22 << "b::static_inv" << std::endl
23 << "b::inv" << std::endl
24 << "a::static_inv" << std::endl
25 << "a::inv" << std::endl
27 // No preconditions here.
28 #ifndef BOOST_CONTRACT_NO_OLDS
29 << "c::f::old" << std::endl
30 << "b::f::old" << std::endl
31 << "a::f::old" << std::endl
33 << "a::f::body" << std::endl
34 #ifndef BOOST_CONTRACT_NO_EXIT_INVARIANTS
35 << "c::static_inv" << std::endl
36 << "c::inv" << std::endl
37 << "b::static_inv" << std::endl
38 << "b::inv" << std::endl
39 << "a::static_inv" << std::endl
40 << "a::inv" << std::endl
42 #ifndef BOOST_CONTRACT_NO_POSTCONDITIONS
43 << "c::f::old" << std::endl
// Old only if post (or except) run.
44 << "c::f::post" << std::endl
45 << "b::f::old" << std::endl
46 << "b::f::post" << std::endl
47 << "a::f::post" << std::endl
58 BOOST_TEST(out
.eq(ok
.str()));
65 BOOST_TEST(out
.eq(ok
.str()));
72 BOOST_TEST(out
.eq(ok
.str()));
79 BOOST_TEST(out
.eq(ok
.str()));
86 BOOST_TEST(out
.eq(ok
.str()));
88 return boost::report_errors();