#include "aux_/oteststream.hpp" #include #include #include // Test free-function. boost::contract::aux::test::oteststream out; void f() { boost::contract::type c = boost::contract::free_function() .precondition([&] () { out << "f::pre" << std::endl; }) .postcondition([&] () { out << "f::post" << std::endl; }) ; out << "f::body" << std::endl; } int main() { std::ostringstream ok; out.str(""); f(); ok.str(""); ok << "f::pre" << std::endl << "f::body" << std::endl << "f::post" << std::endl ; BOOST_TEST(out.check(ok.str())); return boost::report_errors(); }