mirror of
https://github.com/boostorg/contract.git
synced 2026-02-27 04:52:22 +00:00
compiled contracts on/off for all destructor tests
This commit is contained in:
@@ -80,28 +80,55 @@ int main() {
|
||||
a aa;
|
||||
out.str("");
|
||||
}
|
||||
BOOST_TEST(false);
|
||||
} catch(b::err const&) {
|
||||
#if BOOST_CONTRACT_POSTCONDITIONS
|
||||
BOOST_TEST(false);
|
||||
} catch(b::err const&) {
|
||||
#endif
|
||||
ok.str(""); ok
|
||||
<< "a::static_inv" << std::endl
|
||||
<< "a::inv" << std::endl
|
||||
<< "a::dtor::old" << std::endl
|
||||
#if BOOST_CONTRACT_ENTRY_INVARIANTS
|
||||
<< "a::static_inv" << std::endl
|
||||
<< "a::inv" << std::endl
|
||||
#endif
|
||||
#if BOOST_CONTRACT_POSTCONDITIONS
|
||||
<< "a::dtor::old" << std::endl
|
||||
#endif
|
||||
<< "a::dtor::body" << std::endl
|
||||
// Test a destructed (so only static_inv and post, but no inv).
|
||||
<< "a::static_inv" << std::endl
|
||||
<< "a::dtor::post" << std::endl
|
||||
#if BOOST_CONTRACT_EXIT_INVARIANTS
|
||||
// Test a destructed (so only static_inv and post, but no inv).
|
||||
<< "a::static_inv" << std::endl
|
||||
#endif
|
||||
#if BOOST_CONTRACT_POSTCONDITIONS
|
||||
<< "a::dtor::post" << std::endl
|
||||
#endif
|
||||
|
||||
<< "b::static_inv" << std::endl
|
||||
<< "b::inv" << std::endl
|
||||
<< "b::dtor::old" << std::endl // Test this threw.
|
||||
#if BOOST_CONTRACT_ENTRY_INVARIANTS
|
||||
<< "b::static_inv" << std::endl
|
||||
<< "b::inv" << std::endl
|
||||
#endif
|
||||
#if BOOST_CONTRACT_POSTCONDITIONS
|
||||
<< "b::dtor::old" << std::endl // Test this threw.
|
||||
#else
|
||||
<< "b::dtor::body" << std::endl
|
||||
#if BOOST_CONTRACT_EXIT_INVARIANTS
|
||||
<< "b::static_inv" << std::endl
|
||||
#endif
|
||||
#endif
|
||||
|
||||
<< "c::static_inv" << std::endl
|
||||
<< "c::inv" << std::endl
|
||||
<< "c::dtor::old" << std::endl
|
||||
#if BOOST_CONTRACT_ENTRY_INVARIANTS
|
||||
<< "c::static_inv" << std::endl
|
||||
<< "c::inv" << std::endl
|
||||
#endif
|
||||
#if BOOST_CONTRACT_POSTCONDITIONS
|
||||
<< "c::dtor::old" << std::endl
|
||||
#endif
|
||||
<< "c::dtor::body" << std::endl
|
||||
// Test c not destructed (so both static_inv and inv, but no post).
|
||||
<< "c::static_inv" << std::endl
|
||||
<< "c::inv" << std::endl
|
||||
#if BOOST_CONTRACT_EXIT_INVARIANTS
|
||||
<< "c::static_inv" << std::endl
|
||||
#if BOOST_CONTRACT_POSTCONDITIONS
|
||||
// Test c not destructed (so both static_inv and inv).
|
||||
<< "c::inv" << std::endl
|
||||
#endif
|
||||
#endif
|
||||
;
|
||||
BOOST_TEST(out.eq(ok.str()));
|
||||
} catch(...) { BOOST_TEST(false); }
|
||||
|
||||
Reference in New Issue
Block a user