diff --git a/REGRESSION.xlsx b/REGRESSION.xlsx index 196122b..887a4a5 100755 Binary files a/REGRESSION.xlsx and b/REGRESSION.xlsx differ diff --git a/meta/explicit-failures-markup.xml b/meta/explicit-failures-markup.xml index faed539..3e495b2 100644 --- a/meta/explicit-failures-markup.xml +++ b/meta/explicit-failures-markup.xml @@ -3,13 +3,15 @@ + + - - - + + + @@ -25,6 +27,7 @@ + diff --git a/test/check/audit.hpp b/test/check/audit.hpp index 867b41b..9043dec 100644 --- a/test/check/audit.hpp +++ b/test/check/audit.hpp @@ -9,9 +9,10 @@ #include #include #include + +struct err {}; // Global decl so visible in MSVC10 lambdas. int main() { - struct err {}; boost::contract::set_check_failure([] { throw err(); }); bool threw = false; diff --git a/test/check/decl.hpp b/test/check/decl.hpp index 140abf2..460be40 100644 --- a/test/check/decl.hpp +++ b/test/check/decl.hpp @@ -14,6 +14,8 @@ boost::contract::test::detail::oteststream out; +struct err {}; // Global decl so visible in MSVC10 lambdas. + void f(bool check) { #ifdef BOOST_CONTRACT_TEST_CHECK_MACRO BOOST_CONTRACT_CHECK([&] () -> bool { @@ -42,7 +44,6 @@ int main() { ; BOOST_TEST(out.eq(ok.str())); - struct err {}; boost::contract::set_check_failure([] { throw err(); }); out.str(""); diff --git a/test/check/ifdef.cpp b/test/check/ifdef.cpp index 408361b..e995cd4 100644 --- a/test/check/ifdef.cpp +++ b/test/check/ifdef.cpp @@ -34,6 +34,8 @@ void f(bool check1, bool check2) { out << "f::body" << std::endl; } +struct err {}; // Global decl so visible in MSVC10 lambdas. + int main() { std::ostringstream ok; @@ -48,7 +50,6 @@ int main() { ; BOOST_TEST(out.eq(ok.str())); - struct err {}; boost::contract::set_check_failure([] { throw err(); }); out.str(""); diff --git a/test/check/ifdef_macro.cpp b/test/check/ifdef_macro.cpp index a842534..1adcaa1 100644 --- a/test/check/ifdef_macro.cpp +++ b/test/check/ifdef_macro.cpp @@ -26,6 +26,8 @@ void f(bool check) { out << "f::body" << std::endl; } +struct err {}; // Global decl so visible in MSVC10 lambdas. + int main() { std::ostringstream ok; @@ -39,7 +41,6 @@ int main() { ; BOOST_TEST(out.eq(ok.str())); - struct err {}; boost::contract::set_check_failure([] { throw err(); }); out.str(""); diff --git a/test/constructor/decl_entry_static_inv_all.cpp b/test/constructor/decl_entry_static_inv_all.cpp index 561ff06..f4ba304 100644 --- a/test/constructor/decl_entry_static_inv_all.cpp +++ b/test/constructor/decl_entry_static_inv_all.cpp @@ -90,6 +90,8 @@ std::string ok_end() { return ok.str(); } +struct err {}; // Global decl so visible in MSVC10 lambdas. + int main() { std::ostringstream ok; @@ -116,7 +118,6 @@ int main() { BOOST_TEST(out.eq(ok.str())); } - struct err {}; boost::contract::set_entry_invariant_failure( [] (boost::contract::from) { throw err(); }); diff --git a/test/constructor/decl_entry_static_inv_ends.cpp b/test/constructor/decl_entry_static_inv_ends.cpp index cc2f71d..412d7e2 100644 --- a/test/constructor/decl_entry_static_inv_ends.cpp +++ b/test/constructor/decl_entry_static_inv_ends.cpp @@ -86,6 +86,8 @@ std::string ok_end() { return ok.str(); } +struct err {}; // Global decl so visible in MSVC10 lambdas. + int main() { std::ostringstream ok; @@ -112,7 +114,6 @@ int main() { BOOST_TEST(out.eq(ok.str())); } - struct err {}; boost::contract::set_entry_invariant_failure( [] (boost::contract::from) { throw err(); }); diff --git a/test/constructor/decl_entry_static_inv_mid.cpp b/test/constructor/decl_entry_static_inv_mid.cpp index 33bc98e..d1b56b7 100644 --- a/test/constructor/decl_entry_static_inv_mid.cpp +++ b/test/constructor/decl_entry_static_inv_mid.cpp @@ -83,6 +83,8 @@ std::string ok_end() { return ok.str(); } +struct err {}; // Global decl so visible in MSVC10 lambdas. + int main() { std::ostringstream ok; @@ -109,7 +111,6 @@ int main() { BOOST_TEST(out.eq(ok.str())); } - struct err {}; boost::contract::set_entry_invariant_failure( [] (boost::contract::from) { throw err(); }); diff --git a/test/constructor/decl_exit_inv_all.cpp b/test/constructor/decl_exit_inv_all.cpp index deb28bd..5da23cc 100644 --- a/test/constructor/decl_exit_inv_all.cpp +++ b/test/constructor/decl_exit_inv_all.cpp @@ -89,6 +89,8 @@ std::string ok_end() { return ok.str(); } +struct err {}; // Global decl so visible in MSVC10 lambdas. + int main() { std::ostringstream ok; @@ -107,7 +109,6 @@ int main() { BOOST_TEST(out.eq(ok.str())); } - struct err {}; boost::contract::set_exit_invariant_failure( [] (boost::contract::from) { throw err(); }); diff --git a/test/constructor/decl_exit_inv_ends.cpp b/test/constructor/decl_exit_inv_ends.cpp index 1ca734d..e91b25e 100644 --- a/test/constructor/decl_exit_inv_ends.cpp +++ b/test/constructor/decl_exit_inv_ends.cpp @@ -89,6 +89,8 @@ std::string ok_end() { return ok.str(); } +struct err {}; // Global decl so visible in MSVC10 lambdas. + int main() { std::ostringstream ok; @@ -107,7 +109,6 @@ int main() { BOOST_TEST(out.eq(ok.str())); } - struct err {}; boost::contract::set_exit_invariant_failure( [] (boost::contract::from) { throw err(); }); diff --git a/test/constructor/decl_exit_inv_mid.cpp b/test/constructor/decl_exit_inv_mid.cpp index b5efe4d..95a2b88 100644 --- a/test/constructor/decl_exit_inv_mid.cpp +++ b/test/constructor/decl_exit_inv_mid.cpp @@ -89,6 +89,8 @@ std::string ok_end() { return ok.str(); } +struct err {}; // Global decl so visible in MSVC10 lambdas. + int main() { std::ostringstream ok; @@ -107,7 +109,6 @@ int main() { BOOST_TEST(out.eq(ok.str())); } - struct err {}; boost::contract::set_exit_invariant_failure( [] (boost::contract::from) { throw err(); }); diff --git a/test/constructor/decl_exit_static_inv_all.cpp b/test/constructor/decl_exit_static_inv_all.cpp index d347807..f712851 100644 --- a/test/constructor/decl_exit_static_inv_all.cpp +++ b/test/constructor/decl_exit_static_inv_all.cpp @@ -96,6 +96,8 @@ std::string ok_end() { return ok.str(); } +struct err {}; // Global decl so visible in MSVC10 lambdas. + int main() { std::ostringstream ok; @@ -122,7 +124,6 @@ int main() { BOOST_TEST(out.eq(ok.str())); } - struct err {}; boost::contract::set_exit_invariant_failure( [] (boost::contract::from) { throw err(); }); diff --git a/test/constructor/decl_exit_static_inv_ends.cpp b/test/constructor/decl_exit_static_inv_ends.cpp index aae0ffe..244f63e 100644 --- a/test/constructor/decl_exit_static_inv_ends.cpp +++ b/test/constructor/decl_exit_static_inv_ends.cpp @@ -90,6 +90,8 @@ std::string ok_end() { return ok.str(); } +struct err {}; // Global decl so visible in MSVC10 lambdas. + int main() { std::ostringstream ok; @@ -116,7 +118,6 @@ int main() { BOOST_TEST(out.eq(ok.str())); } - struct err {}; boost::contract::set_exit_invariant_failure( [] (boost::contract::from) { throw err(); }); diff --git a/test/constructor/decl_exit_static_inv_mid.cpp b/test/constructor/decl_exit_static_inv_mid.cpp index 6989228..2d8593d 100644 --- a/test/constructor/decl_exit_static_inv_mid.cpp +++ b/test/constructor/decl_exit_static_inv_mid.cpp @@ -86,6 +86,8 @@ std::string ok_end() { return ok.str(); } +struct err {}; // Global decl so visible in MSVC10 lambdas. + int main() { std::ostringstream ok; @@ -112,7 +114,6 @@ int main() { BOOST_TEST(out.eq(ok.str())); } - struct err {}; boost::contract::set_exit_invariant_failure( [] (boost::contract::from) { throw err(); }); diff --git a/test/constructor/decl_post_all.cpp b/test/constructor/decl_post_all.cpp index 4b2f51a..1548863 100644 --- a/test/constructor/decl_post_all.cpp +++ b/test/constructor/decl_post_all.cpp @@ -81,6 +81,8 @@ std::string ok_a() { return ok.str(); } +struct err {}; // Global decl so visible in MSVC10 lambdas. + int main() { std::ostringstream ok; @@ -98,7 +100,6 @@ int main() { BOOST_TEST(out.eq(ok.str())); } - struct err {}; boost::contract::set_postcondition_failure( [] (boost::contract::from) { throw err(); }); diff --git a/test/constructor/decl_post_ends.cpp b/test/constructor/decl_post_ends.cpp index 076c17f..cc31513 100644 --- a/test/constructor/decl_post_ends.cpp +++ b/test/constructor/decl_post_ends.cpp @@ -74,6 +74,8 @@ std::string ok_ba() { return ok.str(); } +struct err {}; // Global decl so visible in MSVC10 lambdas. + int main() { std::ostringstream ok; @@ -90,7 +92,6 @@ int main() { BOOST_TEST(out.eq(ok.str())); } - struct err {}; boost::contract::set_postcondition_failure( [] (boost::contract::from) { throw err(); }); diff --git a/test/constructor/decl_post_mid.cpp b/test/constructor/decl_post_mid.cpp index 1f94b16..6eea7c1 100644 --- a/test/constructor/decl_post_mid.cpp +++ b/test/constructor/decl_post_mid.cpp @@ -70,6 +70,8 @@ std::string ok_a() { return ok.str(); } +struct err {}; // Global decl so visible in MSVC10 lambdas. + int main() { std::ostringstream ok; @@ -86,7 +88,6 @@ int main() { BOOST_TEST(out.eq(ok.str())); } - struct err {}; boost::contract::set_postcondition_failure( [] (boost::contract::from) { throw err(); }); diff --git a/test/constructor/decl_pre_all.cpp b/test/constructor/decl_pre_all.cpp index 0971841..26ae2e7 100644 --- a/test/constructor/decl_pre_all.cpp +++ b/test/constructor/decl_pre_all.cpp @@ -65,6 +65,8 @@ std::string ok_after() { return ok.str(); } +struct err {}; // Global decl so visible in MSVC10 lambdas. + int main() { std::ostringstream ok; @@ -85,7 +87,6 @@ int main() { BOOST_TEST(out.eq(ok.str())); } - struct err {}; boost::contract::set_precondition_failure( [] (boost::contract::from) { throw err(); }); diff --git a/test/constructor/decl_pre_ends.cpp b/test/constructor/decl_pre_ends.cpp index d457059..9723301 100644 --- a/test/constructor/decl_pre_ends.cpp +++ b/test/constructor/decl_pre_ends.cpp @@ -65,6 +65,8 @@ std::string ok_after() { return ok.str(); } +struct err {}; // Global decl so visible in MSVC10 lambdas. + int main() { std::ostringstream ok; @@ -84,7 +86,6 @@ int main() { BOOST_TEST(out.eq(ok.str())); } - struct err {}; boost::contract::set_precondition_failure( [] (boost::contract::from) { throw err(); }); diff --git a/test/constructor/decl_pre_mid.cpp b/test/constructor/decl_pre_mid.cpp index dcad895..c6c5c42 100644 --- a/test/constructor/decl_pre_mid.cpp +++ b/test/constructor/decl_pre_mid.cpp @@ -65,6 +65,8 @@ std::string ok_after() { return ok.str(); } +struct err {}; // Global decl so visible in MSVC10 lambdas. + int main() { std::ostringstream ok; @@ -83,7 +85,6 @@ int main() { BOOST_TEST(out.eq(ok.str())); } - struct err {}; boost::contract::set_precondition_failure( [] (boost::contract::from) { throw err(); }); diff --git a/test/constructor/throwing_body.cpp b/test/constructor/throwing_body.cpp index 5e9195c..89c3752 100644 --- a/test/constructor/throwing_body.cpp +++ b/test/constructor/throwing_body.cpp @@ -40,6 +40,8 @@ struct c } }; +struct b_err {}; // Global decl so visible in MSVC10 lambdas. + struct b #define BASES private boost::contract::constructor_precondition, public c : BASES @@ -50,8 +52,6 @@ struct b static void static_invariant() { out << "b::static_inv" << std::endl; } void invariant() const { out << "b::inv" << std::endl; } - struct err {}; - b() : boost::contract::constructor_precondition([] { out << "b::ctor::pre" << std::endl; @@ -63,7 +63,7 @@ struct b .except([] { out << "b::ctor::except" << std::endl; }) ; out << "b::ctor::body" << std::endl; - throw b::err(); // Test body throws (from inheritance mid branch). + throw b_err(); // Test body throws (from inheritance mid branch). } }; @@ -99,7 +99,7 @@ int main() { out.str(""); a aa; BOOST_TEST(false); - } catch(b::err const&) { + } catch(b_err const&) { ok.str(""); ok #ifndef BOOST_CONTRACT_NO_PRECONDITIONS << "a::ctor::pre" << std::endl diff --git a/test/constructor/throwing_old.cpp b/test/constructor/throwing_old.cpp index f29405d..ceda5bf 100644 --- a/test/constructor/throwing_old.cpp +++ b/test/constructor/throwing_old.cpp @@ -40,6 +40,8 @@ struct c } }; +struct b_err {}; // Global decl so visible in MSVC10 lambdas. + struct b #define BASES private boost::contract::constructor_precondition, public c : BASES @@ -50,8 +52,6 @@ struct b static void static_invariant() { out << "b::static_inv" << std::endl; } void invariant() const { out << "b::inv" << std::endl; } - struct err {}; - b() : boost::contract::constructor_precondition([] { out << "b::ctor::pre" << std::endl; @@ -60,7 +60,7 @@ struct b boost::contract::check c = boost::contract::constructor(this) .old([] { out << "b::ctor::old" << std::endl; - throw b::err(); // Test this throws (from mid branch). + throw b_err(); // Test this throws (from mid branch). }) .postcondition([] { out << "b::ctor::post" << std::endl; }) .except([] { out << "b::ctor::except" << std::endl; }) @@ -104,7 +104,7 @@ int main() { a aa; #ifndef BOOST_CONTRACT_NO_OLDS BOOST_TEST(false); - } catch(b::err const&) { + } catch(b_err const&) { #endif ok.str(""); ok #ifndef BOOST_CONTRACT_NO_PRECONDITIONS diff --git a/test/constructor/throwing_post.cpp b/test/constructor/throwing_post.cpp index 75f018d..0a3dd62 100644 --- a/test/constructor/throwing_post.cpp +++ b/test/constructor/throwing_post.cpp @@ -40,6 +40,8 @@ struct c } }; +struct b_err {}; // Global decl so visible in MSVC10 lambdas. + struct b #define BASES private boost::contract::constructor_precondition, public c : BASES @@ -50,8 +52,6 @@ struct b static void static_invariant() { out << "b::static_inv" << std::endl; } void invariant() const { out << "b::inv" << std::endl; } - struct err {}; - b() : boost::contract::constructor_precondition([] { out << "b::ctor::pre" << std::endl; @@ -61,7 +61,7 @@ struct b .old([] { out << "b::ctor::old" << std::endl; }) .postcondition([] { out << "b::ctor::post" << std::endl; - throw b::err(); // Test this throws (from mid branch). + throw b_err(); // Test this throws (from mid branch). }) .except([] { out << "b::ctor::except" << std::endl; }) ; @@ -105,7 +105,7 @@ int main() { a aa; #ifndef BOOST_CONTRACT_NO_POSTCONDITIONS BOOST_TEST(false); - } catch(b::err const&) { + } catch(b_err const&) { #endif ok.str(""); ok #ifndef BOOST_CONTRACT_NO_PRECONDITIONS diff --git a/test/constructor/throwing_pre.cpp b/test/constructor/throwing_pre.cpp index e7559f7..7f9fa13 100644 --- a/test/constructor/throwing_pre.cpp +++ b/test/constructor/throwing_pre.cpp @@ -40,6 +40,8 @@ struct c } }; +struct b_err {}; // Global decl so visible in MSVC10 lambdas. + struct b #define BASES private boost::contract::constructor_precondition, public c : BASES @@ -50,12 +52,10 @@ struct b static void static_invariant() { out << "b::static_inv" << std::endl; } void invariant() const { out << "b::inv" << std::endl; } - struct err {}; - b() : boost::contract::constructor_precondition([] { out << "b::ctor::pre" << std::endl; - throw b::err(); // Test this throws (from mid branch). + throw b_err(); // Test this throws (from mid branch). }) { boost::contract::check c = boost::contract::constructor(this) @@ -103,7 +103,7 @@ int main() { a aa; #ifndef BOOST_CONTRACT_NO_PRECONDITIONS BOOST_TEST(false); - } catch(b::err const&) { + } catch(b_err const&) { #endif ok.str(""); ok #ifndef BOOST_CONTRACT_NO_PRECONDITIONS diff --git a/test/destructor/decl_entry_inv_all.cpp b/test/destructor/decl_entry_inv_all.cpp index 4fc769f..26f35b3 100644 --- a/test/destructor/decl_entry_inv_all.cpp +++ b/test/destructor/decl_entry_inv_all.cpp @@ -85,6 +85,8 @@ std::string ok_c(checked check = passed) { return ok.str(); } +struct err {}; // Global decl so visible in MSVC10 lambdas. + int main() { std::ostringstream ok; @@ -102,7 +104,6 @@ int main() { ; BOOST_TEST(out.eq(ok.str())); - struct err {}; boost::contract::set_entry_invariant_failure([&ok] (boost::contract::from) { BOOST_TEST(out.eq(ok.str())); // Must check before dtor throws. throw err(); // For testing only (dtors should never throw otherwise). diff --git a/test/destructor/decl_entry_inv_ends.cpp b/test/destructor/decl_entry_inv_ends.cpp index a00f227..32cd59b 100644 --- a/test/destructor/decl_entry_inv_ends.cpp +++ b/test/destructor/decl_entry_inv_ends.cpp @@ -82,6 +82,8 @@ std::string ok_c(checked check = passed) { return ok.str(); } +struct err {}; // Global decl so visible in MSVC10 lambdas. + int main() { std::ostringstream ok; @@ -99,7 +101,6 @@ int main() { ; BOOST_TEST(out.eq(ok.str())); - struct err {}; boost::contract::set_entry_invariant_failure([&ok] (boost::contract::from) { BOOST_TEST(out.eq(ok.str())); // Must check before dtor throws... throw err(); // for testing (as dtors should never throw anyways). diff --git a/test/destructor/decl_entry_inv_mid.cpp b/test/destructor/decl_entry_inv_mid.cpp index 37c55b8..4ae7ebb 100644 --- a/test/destructor/decl_entry_inv_mid.cpp +++ b/test/destructor/decl_entry_inv_mid.cpp @@ -76,6 +76,8 @@ std::string ok_c(bool threw = false) { return ok.str(); } +struct err {}; // Global decl so visible in MSVC10 lambdas. + int main() { std::ostringstream ok; @@ -93,7 +95,6 @@ int main() { ; BOOST_TEST(out.eq(ok.str())); - struct err {}; boost::contract::set_entry_invariant_failure([&ok] (boost::contract::from) { BOOST_TEST(out.eq(ok.str())); // Must check before dtor throws... throw err(); // for testing (as dtors should never throw anyways). diff --git a/test/destructor/decl_entry_static_inv_all.cpp b/test/destructor/decl_entry_static_inv_all.cpp index 56f39a2..173c171 100644 --- a/test/destructor/decl_entry_static_inv_all.cpp +++ b/test/destructor/decl_entry_static_inv_all.cpp @@ -78,6 +78,8 @@ std::string ok_c(bool threw = false) { return ok.str(); } +struct err {}; // Global decl so visible in MSVC10 lambdas. + int main() { std::ostringstream ok; @@ -103,7 +105,6 @@ int main() { ; BOOST_TEST(out.eq(ok.str())); - struct err {}; boost::contract::set_entry_invariant_failure([&ok] (boost::contract::from) { BOOST_TEST(out.eq(ok.str())); // Must check before dtor throws. throw err(); // For testing only (dtors should never throw otherwise). diff --git a/test/destructor/decl_entry_static_inv_ends.cpp b/test/destructor/decl_entry_static_inv_ends.cpp index 60956a4..845839b 100644 --- a/test/destructor/decl_entry_static_inv_ends.cpp +++ b/test/destructor/decl_entry_static_inv_ends.cpp @@ -76,6 +76,8 @@ std::string ok_c(bool threw = false) { return ok.str(); } +struct err {}; // Global decl so visible in MSVC10 lambdas. + int main() { std::ostringstream ok; @@ -101,7 +103,6 @@ int main() { ; BOOST_TEST(out.eq(ok.str())); - struct err {}; boost::contract::set_entry_invariant_failure([&ok] (boost::contract::from) { BOOST_TEST(out.eq(ok.str())); // Must check before dtor throws. throw err(); // For testing only (dtors should never throw otherwise). diff --git a/test/destructor/decl_entry_static_inv_mid.cpp b/test/destructor/decl_entry_static_inv_mid.cpp index d2c3427..7d39e14 100644 --- a/test/destructor/decl_entry_static_inv_mid.cpp +++ b/test/destructor/decl_entry_static_inv_mid.cpp @@ -71,6 +71,8 @@ std::string ok_c(bool threw = false) { return ok.str(); } +struct err {}; // Global decl so visible in MSVC10 lambdas. + int main() { std::ostringstream ok; @@ -96,7 +98,6 @@ int main() { ; BOOST_TEST(out.eq(ok.str())); - struct err {}; boost::contract::set_entry_invariant_failure([&ok] (boost::contract::from) { BOOST_TEST(out.eq(ok.str())); // Must check before dtor throws. throw err(); // For testing only (dtors should never throw otherwise). diff --git a/test/destructor/decl_exit_static_inv_all.cpp b/test/destructor/decl_exit_static_inv_all.cpp index e6c4278..96a27b1 100644 --- a/test/destructor/decl_exit_static_inv_all.cpp +++ b/test/destructor/decl_exit_static_inv_all.cpp @@ -80,6 +80,8 @@ std::string ok_c(checked check = passed) { return ok.str(); } +struct err {}; // Global decl so visible in MSVC10 lambdas. + int main() { std::ostringstream ok; @@ -110,7 +112,6 @@ int main() { ; BOOST_TEST(out.eq(ok.str())); - struct err {}; boost::contract::set_exit_invariant_failure([&ok] (boost::contract::from) { BOOST_TEST(out.eq(ok.str())); // Must check before dtor throws. throw err(); // For testing only (as dtors should not throw otherwise). diff --git a/test/destructor/decl_exit_static_inv_ends.cpp b/test/destructor/decl_exit_static_inv_ends.cpp index 4ed3497..7314ca8 100644 --- a/test/destructor/decl_exit_static_inv_ends.cpp +++ b/test/destructor/decl_exit_static_inv_ends.cpp @@ -78,6 +78,8 @@ std::string ok_c(checked check = passed) { return ok.str(); } +struct err {}; // Global decl so visible in MSVC10 lambdas. + int main() { std::ostringstream ok; @@ -108,7 +110,6 @@ int main() { ; BOOST_TEST(out.eq(ok.str())); - struct err {}; boost::contract::set_exit_invariant_failure([&ok] (boost::contract::from) { BOOST_TEST(out.eq(ok.str())); // Must check before dtor throws. throw err(); // For testing only (as dtors should not throw otherwise). diff --git a/test/destructor/decl_exit_static_inv_mid.cpp b/test/destructor/decl_exit_static_inv_mid.cpp index 3b125c3..6e739d4 100644 --- a/test/destructor/decl_exit_static_inv_mid.cpp +++ b/test/destructor/decl_exit_static_inv_mid.cpp @@ -71,6 +71,8 @@ std::string ok_c(bool threw = false) { return ok.str(); } +struct err {}; // Global decl so visible in MSVC10 lambdas. + int main() { std::ostringstream ok; @@ -101,7 +103,6 @@ int main() { ; BOOST_TEST(out.eq(ok.str())); - struct err {}; boost::contract::set_exit_invariant_failure([&ok] (boost::contract::from) { BOOST_TEST(out.eq(ok.str())); // Must check before dtor throws. throw err(); // For testing only (as dtors should not throw otherwise). diff --git a/test/destructor/decl_post_all.cpp b/test/destructor/decl_post_all.cpp index 2e20a5c..ca5ef59 100644 --- a/test/destructor/decl_post_all.cpp +++ b/test/destructor/decl_post_all.cpp @@ -77,6 +77,8 @@ std::string ok_c(bool threw = false) { return ok.str(); } +struct err {}; // Global decl so visible in MSVC10 lambdas. + int main() { std::ostringstream ok; @@ -94,7 +96,6 @@ int main() { ; BOOST_TEST(out.eq(ok.str())); - struct err {}; boost::contract::set_postcondition_failure([&ok] (boost::contract::from) { BOOST_TEST(out.eq(ok.str())); // Must check before dtor throws... throw err(); // for testing (as dtors should never throw anyways). diff --git a/test/destructor/decl_post_ends.cpp b/test/destructor/decl_post_ends.cpp index ffa27a5..b083ce0 100644 --- a/test/destructor/decl_post_ends.cpp +++ b/test/destructor/decl_post_ends.cpp @@ -74,6 +74,8 @@ std::string ok_c(bool threw = false) { return ok.str(); } +struct err {}; // Global decl so visible in MSVC10 lambdas. + int main() { std::ostringstream ok; @@ -91,7 +93,6 @@ int main() { ; BOOST_TEST(out.eq(ok.str())); - struct err {}; boost::contract::set_postcondition_failure([&ok] (boost::contract::from) { BOOST_TEST(out.eq(ok.str())); // Must check before dtor throws... throw err(); // ... for testing (as dtors should never throw anyways). diff --git a/test/destructor/decl_post_mid.cpp b/test/destructor/decl_post_mid.cpp index 5d37884..236b0ed 100644 --- a/test/destructor/decl_post_mid.cpp +++ b/test/destructor/decl_post_mid.cpp @@ -70,6 +70,8 @@ std::string ok_c(bool threw = false) { return ok.str(); } +struct err {}; // Global decl so visible in MSVC10 lambdas. + int main() { std::ostringstream ok; @@ -87,7 +89,6 @@ int main() { ; BOOST_TEST(out.eq(ok.str())); - struct err {}; boost::contract::set_postcondition_failure([&ok] (boost::contract::from) { BOOST_TEST(out.eq(ok.str())); // Must check before dtor throws... throw err(); // ... for testing (as dtors should never throw anyways). diff --git a/test/destructor/throwing_body.cpp b/test/destructor/throwing_body.cpp index fcba379..b192c15 100644 --- a/test/destructor/throwing_body.cpp +++ b/test/destructor/throwing_body.cpp @@ -31,6 +31,8 @@ struct c { } }; +struct b_err {}; // Global decl so visible in MSVC10 lambdas. + struct b #define BASES public c : BASES @@ -41,8 +43,6 @@ struct b static void static_invariant() { out << "b::static_inv" << std::endl; } void invariant() const { out << "b::inv" << std::endl; } - struct err {}; - ~b() BOOST_NOEXCEPT_IF(false) { boost::contract::check c = boost::contract::destructor(this) .old([] { out << "b::dtor::old" << std::endl; }) @@ -50,7 +50,7 @@ struct b .except([] { out << "b::dtor::except" << std::endl; }) ; out << "b::dtor::body" << std::endl; - throw b::err(); // Test body throw (from inheritance mid branch). + throw b_err(); // Test body throw (from inheritance mid branch). } }; @@ -84,7 +84,7 @@ int main() { out.str(""); } BOOST_TEST(false); - } catch(b::err const&) { + } catch(b_err const&) { ok.str(""); ok #ifndef BOOST_CONTRACT_NO_ENTRY_INVARIANTS << "a::static_inv" << std::endl diff --git a/test/destructor/throwing_old.cpp b/test/destructor/throwing_old.cpp index 06ce952..973d05b 100644 --- a/test/destructor/throwing_old.cpp +++ b/test/destructor/throwing_old.cpp @@ -31,6 +31,8 @@ struct c { } }; +struct b_err {}; // Global decl so visible in MSVC10 lambdas. + struct b #define BASES public c : BASES @@ -41,13 +43,11 @@ struct b static void static_invariant() { out << "b::static_inv" << std::endl; } void invariant() const { out << "b::inv" << std::endl; } - struct err {}; - ~b() BOOST_NOEXCEPT_IF(false) { boost::contract::check c = boost::contract::destructor(this) .old([] { out << "b::dtor::old" << std::endl; - throw b::err(); // Test this throws (from mid branch). + throw b_err(); // Test this throws (from mid branch). }) .postcondition([] { out << "b::dtor::post" << std::endl; }) .except([] { out << "b::dtor::except" << std::endl; }) @@ -89,7 +89,7 @@ int main() { } #ifndef BOOST_CONTRACT_NO_OLDS BOOST_TEST(false); - } catch(b::err const&) { + } catch(b_err const&) { #endif ok.str(""); ok #ifndef BOOST_CONTRACT_NO_ENTRY_INVARIANTS diff --git a/test/destructor/throwing_post.cpp b/test/destructor/throwing_post.cpp index d576105..a09b06b 100644 --- a/test/destructor/throwing_post.cpp +++ b/test/destructor/throwing_post.cpp @@ -31,6 +31,8 @@ struct c { } }; +struct b_err {}; // Global decl so visible in MSVC10 lambdas. + struct b #define BASES public c : BASES @@ -41,14 +43,12 @@ struct b static void static_invariant() { out << "b::static_inv" << std::endl; } void invariant() const { out << "b::inv" << std::endl; } - struct err {}; - ~b() BOOST_NOEXCEPT_IF(false) { boost::contract::check c = boost::contract::destructor(this) .old([] { out << "b::dtor::old" << std::endl; }) .postcondition([] { out << "b::dtor::post" << std::endl; - throw b::err(); // Test this throws (from mid branch). + throw b_err(); // Test this throws (from mid branch). }) .except([] { out << "b::dtor::except" << std::endl; }) ; @@ -90,7 +90,7 @@ int main() { } #ifndef BOOST_CONTRACT_NO_POSTCONDITIONS BOOST_TEST(false); - } catch(b::err const&) { + } catch(b_err const&) { #endif ok.str(""); ok #ifndef BOOST_CONTRACT_NO_ENTRY_INVARIANTS diff --git a/test/function/decl_post_all.cpp b/test/function/decl_post_all.cpp index cadbc63..bc4f0a1 100644 --- a/test/function/decl_post_all.cpp +++ b/test/function/decl_post_all.cpp @@ -29,6 +29,8 @@ std::string ok_f() { return ok.str(); } +struct err {}; // Global decl so visible in MSVC10 lambdas. + int main() { std::ostringstream ok; @@ -40,7 +42,6 @@ int main() { ; BOOST_TEST(out.eq(ok.str())); - struct err {}; boost::contract::set_postcondition_failure( [] (boost::contract::from) { throw err(); }); diff --git a/test/function/decl_pre_all.cpp b/test/function/decl_pre_all.cpp index d92e7e2..e60e2aa 100644 --- a/test/function/decl_pre_all.cpp +++ b/test/function/decl_pre_all.cpp @@ -31,6 +31,8 @@ std::string ok_f(bool failed = false) { return ok.str(); } +struct err {}; // Global decl so visible in MSVC10 lambdas. + int main() { std::ostringstream ok; @@ -48,7 +50,6 @@ int main() { #define BOOST_CONTRACT_TEST_pre 1 #endif - struct err {}; boost::contract::set_precondition_failure( [] (boost::contract::from) { throw err(); }); diff --git a/test/function/except_throw.cpp b/test/function/except_throw.cpp index 66cf419..01d4b13 100644 --- a/test/function/except_throw.cpp +++ b/test/function/except_throw.cpp @@ -14,7 +14,7 @@ boost::contract::test::detail::oteststream out; -struct err {}; +struct err {}; // Global decl so visible in MSVC10 lambdas. void f() { boost::contract::check c = boost::contract::function() diff --git a/test/function/throwing_body.cpp b/test/function/throwing_body.cpp index 0b539b5..06a02d5 100644 --- a/test/function/throwing_body.cpp +++ b/test/function/throwing_body.cpp @@ -14,7 +14,7 @@ boost::contract::test::detail::oteststream out; -struct err {}; +struct err {}; // Global decl so visible in MSVC10 lambdas. void f() { boost::contract::check c = boost::contract::function() diff --git a/test/function/throwing_old.cpp b/test/function/throwing_old.cpp index f24641f..5bfabc9 100644 --- a/test/function/throwing_old.cpp +++ b/test/function/throwing_old.cpp @@ -14,7 +14,7 @@ boost::contract::test::detail::oteststream out; -struct err {}; +struct err {}; // Global decl so visible in MSVC10 lambdas. void f() { boost::contract::check c = boost::contract::function() diff --git a/test/function/throwing_post.cpp b/test/function/throwing_post.cpp index 40635fd..be754da 100644 --- a/test/function/throwing_post.cpp +++ b/test/function/throwing_post.cpp @@ -14,7 +14,7 @@ boost::contract::test::detail::oteststream out; -struct err {}; +struct err {}; // Global decl so visible in MSVC10 lambdas. void f() { boost::contract::check c = boost::contract::function() diff --git a/test/function/throwing_pre.cpp b/test/function/throwing_pre.cpp index 7f23472..7acb773 100644 --- a/test/function/throwing_pre.cpp +++ b/test/function/throwing_pre.cpp @@ -14,7 +14,7 @@ boost::contract::test::detail::oteststream out; -struct err {}; +struct err {}; // Global decl so visible in MSVC10 lambdas. void f() { boost::contract::check c = boost::contract::function() diff --git a/test/public_function/decl_entry_inv_all.cpp b/test/public_function/decl_entry_inv_all.cpp index 7a28459..887250c 100644 --- a/test/public_function/decl_entry_inv_all.cpp +++ b/test/public_function/decl_entry_inv_all.cpp @@ -46,6 +46,8 @@ std::string ok_end() { return ok.str(); } +struct err {}; // Global decl so visible in MSVC10 lambdas. + int main() { std::ostringstream ok; @@ -77,7 +79,6 @@ int main() { ; BOOST_TEST(out.eq(ok.str())); - struct err {}; boost::contract::set_entry_invariant_failure( [] (boost::contract::from) { throw err(); }); diff --git a/test/public_function/decl_entry_inv_ends.cpp b/test/public_function/decl_entry_inv_ends.cpp index 79b50bb..c34529a 100644 --- a/test/public_function/decl_entry_inv_ends.cpp +++ b/test/public_function/decl_entry_inv_ends.cpp @@ -45,6 +45,8 @@ std::string ok_end() { return ok.str(); } +struct err {}; // Global decl so visible in MSVC10 lambdas. + int main() { std::ostringstream ok; @@ -75,7 +77,6 @@ int main() { ; BOOST_TEST(out.eq(ok.str())); - struct err {}; boost::contract::set_entry_invariant_failure( [] (boost::contract::from) { throw err(); }); diff --git a/test/public_function/decl_entry_inv_mid.cpp b/test/public_function/decl_entry_inv_mid.cpp index efdad98..ae97ade 100644 --- a/test/public_function/decl_entry_inv_mid.cpp +++ b/test/public_function/decl_entry_inv_mid.cpp @@ -44,6 +44,8 @@ std::string ok_end() { return ok.str(); } +struct err {}; // Global decl so visible in MSVC10 lambdas. + int main() { std::ostringstream ok; @@ -73,7 +75,6 @@ int main() { ; BOOST_TEST(out.eq(ok.str())); - struct err {}; boost::contract::set_entry_invariant_failure( [] (boost::contract::from) { throw err(); }); diff --git a/test/public_function/decl_entry_static_inv_all.cpp b/test/public_function/decl_entry_static_inv_all.cpp index f48deba..6680bd4 100644 --- a/test/public_function/decl_entry_static_inv_all.cpp +++ b/test/public_function/decl_entry_static_inv_all.cpp @@ -46,7 +46,7 @@ std::string ok_end() { return ok.str(); } -struct err {}; +struct err {}; // Global decl so visible in MSVC10 lambdas. int main() { std::ostringstream ok; diff --git a/test/public_function/decl_entry_static_inv_ends.cpp b/test/public_function/decl_entry_static_inv_ends.cpp index f7a7d89..698e8ce 100644 --- a/test/public_function/decl_entry_static_inv_ends.cpp +++ b/test/public_function/decl_entry_static_inv_ends.cpp @@ -45,6 +45,8 @@ std::string ok_end() { return ok.str(); } +struct err {}; // Global decl so visible in MSVC10 lambdas. + int main() { std::ostringstream ok; @@ -75,7 +77,6 @@ int main() { ; BOOST_TEST(out.eq(ok.str())); - struct err {}; boost::contract::set_entry_invariant_failure( [] (boost::contract::from) { throw err(); }); diff --git a/test/public_function/decl_entry_static_inv_mid.cpp b/test/public_function/decl_entry_static_inv_mid.cpp index cb790ba..d8d648e 100644 --- a/test/public_function/decl_entry_static_inv_mid.cpp +++ b/test/public_function/decl_entry_static_inv_mid.cpp @@ -44,6 +44,8 @@ std::string ok_end() { return ok.str(); } +struct err {}; // Global decl so visible in MSVC10 lambdas. + int main() { std::ostringstream ok; @@ -73,7 +75,6 @@ int main() { ; BOOST_TEST(out.eq(ok.str())); - struct err {}; boost::contract::set_entry_invariant_failure( [] (boost::contract::from) { throw err(); }); diff --git a/test/public_function/decl_exit_inv_all.cpp b/test/public_function/decl_exit_inv_all.cpp index 6b21acd..0f7ae6e 100644 --- a/test/public_function/decl_exit_inv_all.cpp +++ b/test/public_function/decl_exit_inv_all.cpp @@ -52,6 +52,8 @@ std::string ok_end() { return ok.str(); } +struct err {}; // Global decl so visible in MSVC10 lambdas. + int main() { std::ostringstream ok; @@ -84,7 +86,6 @@ int main() { ; BOOST_TEST(out.eq(ok.str())); - struct err {}; boost::contract::set_exit_invariant_failure( [] (boost::contract::from) { throw err(); }); diff --git a/test/public_function/decl_exit_inv_ends.cpp b/test/public_function/decl_exit_inv_ends.cpp index 9172bf4..f38bb73 100644 --- a/test/public_function/decl_exit_inv_ends.cpp +++ b/test/public_function/decl_exit_inv_ends.cpp @@ -51,6 +51,8 @@ std::string ok_end() { return ok.str(); } +struct err {}; // Global decl so visible in MSVC10 lambdas. + int main() { std::ostringstream ok; @@ -82,7 +84,6 @@ int main() { ; BOOST_TEST(out.eq(ok.str())); - struct err {}; boost::contract::set_exit_invariant_failure( [] (boost::contract::from) { throw err(); }); diff --git a/test/public_function/decl_exit_inv_mid.cpp b/test/public_function/decl_exit_inv_mid.cpp index a49e833..e7d2b1a 100644 --- a/test/public_function/decl_exit_inv_mid.cpp +++ b/test/public_function/decl_exit_inv_mid.cpp @@ -50,6 +50,8 @@ std::string ok_end() { return ok.str(); } +struct err {}; // Global decl so visible in MSVC10 lambdas. + int main() { std::ostringstream ok; @@ -80,7 +82,6 @@ int main() { ; BOOST_TEST(out.eq(ok.str())); - struct err {}; boost::contract::set_exit_invariant_failure( [] (boost::contract::from) { throw err(); }); diff --git a/test/public_function/decl_exit_inv_none.cpp b/test/public_function/decl_exit_inv_none.cpp index 8632c04..6202ef3 100644 --- a/test/public_function/decl_exit_inv_none.cpp +++ b/test/public_function/decl_exit_inv_none.cpp @@ -15,6 +15,8 @@ #include #include +struct err {}; // Global decl so visible in MSVC10 lambdas. + int main() { std::ostringstream ok; ok.str(""); ok // Test nothing fails. @@ -47,7 +49,6 @@ int main() { #endif ; - struct err {}; boost::contract::set_exit_invariant_failure( [] (boost::contract::from) { throw err(); }); diff --git a/test/public_function/decl_exit_static_inv_all.cpp b/test/public_function/decl_exit_static_inv_all.cpp index ad3a0eb..27af97b 100644 --- a/test/public_function/decl_exit_static_inv_all.cpp +++ b/test/public_function/decl_exit_static_inv_all.cpp @@ -52,6 +52,8 @@ std::string ok_end() { return ok.str(); } +struct err {}; // Global decl so visible in MSVC10 lambdas. + int main() { std::ostringstream ok; @@ -86,7 +88,6 @@ int main() { ; BOOST_TEST(out.eq(ok.str())); - struct err {}; boost::contract::set_exit_invariant_failure( [] (boost::contract::from) { throw err(); }); diff --git a/test/public_function/decl_exit_static_inv_ends.cpp b/test/public_function/decl_exit_static_inv_ends.cpp index dea5237..71e107d 100644 --- a/test/public_function/decl_exit_static_inv_ends.cpp +++ b/test/public_function/decl_exit_static_inv_ends.cpp @@ -51,6 +51,8 @@ std::string ok_end() { return ok.str(); } +struct err {}; // Global decl so visible in MSVC10 lambdas. + int main() { std::ostringstream ok; @@ -82,7 +84,6 @@ int main() { ; BOOST_TEST(out.eq(ok.str())); - struct err {}; boost::contract::set_exit_invariant_failure( [] (boost::contract::from) { throw err(); }); diff --git a/test/public_function/decl_exit_static_inv_mid.cpp b/test/public_function/decl_exit_static_inv_mid.cpp index 672be0b..0ecbd87 100644 --- a/test/public_function/decl_exit_static_inv_mid.cpp +++ b/test/public_function/decl_exit_static_inv_mid.cpp @@ -50,6 +50,8 @@ std::string ok_end() { return ok.str(); } +struct err {}; // Global decl so visible in MSVC10 lambdas. + int main() { std::ostringstream ok; @@ -82,7 +84,6 @@ int main() { ; BOOST_TEST(out.eq(ok.str())); - struct err {}; boost::contract::set_exit_invariant_failure( [] (boost::contract::from) { throw err(); }); diff --git a/test/public_function/decl_exit_static_inv_none.cpp b/test/public_function/decl_exit_static_inv_none.cpp index 8ece28d..4a55344 100644 --- a/test/public_function/decl_exit_static_inv_none.cpp +++ b/test/public_function/decl_exit_static_inv_none.cpp @@ -15,6 +15,8 @@ #include #include +struct err {}; // Global decl so visible in MSVC10 lambdas. + int main() { std::ostringstream ok; ok // Test nothing fails. #ifndef BOOST_CONTRACT_NO_ENTRY_INVARIANTS @@ -46,7 +48,6 @@ int main() { #endif ; - struct err {}; boost::contract::set_exit_invariant_failure( [] (boost::contract::from) { throw err(); }); diff --git a/test/public_function/decl_post_all.cpp b/test/public_function/decl_post_all.cpp index 8548df5..ac36cee 100644 --- a/test/public_function/decl_post_all.cpp +++ b/test/public_function/decl_post_all.cpp @@ -46,6 +46,8 @@ std::string ok_begin() { return ok.str(); } +struct err {}; // Global decl so visible in MSVC10 lambdas. + int main() { std::ostringstream ok; @@ -68,7 +70,6 @@ int main() { ; BOOST_TEST(out.eq(ok.str())); - struct err {}; boost::contract::set_postcondition_failure( [] (boost::contract::from) { throw err(); }); diff --git a/test/public_function/decl_post_ends.cpp b/test/public_function/decl_post_ends.cpp index 68e3d6c..f0a8b68 100644 --- a/test/public_function/decl_post_ends.cpp +++ b/test/public_function/decl_post_ends.cpp @@ -46,6 +46,8 @@ std::string ok_begin() { return ok.str(); } +struct err {}; // Global decl so visible in MSVC10 lambdas. + int main() { std::ostringstream ok; @@ -67,7 +69,6 @@ int main() { ; BOOST_TEST(out.eq(ok.str())); - struct err {}; boost::contract::set_postcondition_failure( [] (boost::contract::from) { throw err(); }); diff --git a/test/public_function/decl_post_mid.cpp b/test/public_function/decl_post_mid.cpp index 2352f2b..9a3e946 100644 --- a/test/public_function/decl_post_mid.cpp +++ b/test/public_function/decl_post_mid.cpp @@ -46,6 +46,8 @@ std::string ok_begin() { return ok.str(); } +struct err {}; // Global decl so visible in MSVC10 lambdas. + int main() { std::ostringstream ok; @@ -66,7 +68,6 @@ int main() { ; BOOST_TEST(out.eq(ok.str())); - struct err {}; boost::contract::set_postcondition_failure( [] (boost::contract::from) { throw err(); }); diff --git a/test/public_function/decl_pre_all.cpp b/test/public_function/decl_pre_all.cpp index 132d1b7..c903e44 100644 --- a/test/public_function/decl_pre_all.cpp +++ b/test/public_function/decl_pre_all.cpp @@ -56,6 +56,8 @@ std::string ok_end() { return ok.str(); } +struct err {}; // Global decl so visible in MSVC10 lambdas. + int main() { std::ostringstream ok; @@ -121,7 +123,6 @@ int main() { ; BOOST_TEST(out.eq(ok.str())); - struct err {}; boost::contract::set_precondition_failure( [] (boost::contract::from) { throw err(); }); diff --git a/test/public_function/decl_pre_ends.cpp b/test/public_function/decl_pre_ends.cpp index 7affc90..4d24120 100644 --- a/test/public_function/decl_pre_ends.cpp +++ b/test/public_function/decl_pre_ends.cpp @@ -56,6 +56,8 @@ std::string ok_end() { return ok.str(); } +struct err {}; // Global decl so visible in MSVC10 lambdas. + int main() { std::ostringstream ok; @@ -105,7 +107,6 @@ int main() { ; BOOST_TEST(out.eq(ok.str())); - struct err {}; boost::contract::set_precondition_failure( [] (boost::contract::from) { throw err(); }); diff --git a/test/public_function/decl_pre_mid.cpp b/test/public_function/decl_pre_mid.cpp index af14158..cec2b79 100644 --- a/test/public_function/decl_pre_mid.cpp +++ b/test/public_function/decl_pre_mid.cpp @@ -56,6 +56,8 @@ std::string ok_end() { return ok.str(); } +struct err {}; // Global decl so visible in MSVC10 lambdas. + int main() { std::ostringstream ok; @@ -90,7 +92,6 @@ int main() { ; BOOST_TEST(out.eq(ok.str())); - struct err {}; boost::contract::set_precondition_failure( [] (boost::contract::from) { throw err(); }); diff --git a/test/public_function/static_throwing_body.cpp b/test/public_function/static_throwing_body.cpp index 20e20ec..f194c54 100644 --- a/test/public_function/static_throwing_body.cpp +++ b/test/public_function/static_throwing_body.cpp @@ -14,12 +14,12 @@ boost::contract::test::detail::oteststream out; +struct a_err {}; // Global decl so visible in MSVC10 lambdas. + struct a { static void static_invariant() { out << "a::static_inv" << std::endl; } void invariant() const { out << "a::inv" << std::endl; } - struct err {}; - static void f() { boost::contract::check c = boost::contract::public_function() .precondition([] { out << "a::f::pre" << std::endl; }) @@ -28,7 +28,7 @@ struct a { .except([] { out << "a::f::except" << std::endl; }) ; out << "a::f::body" << std::endl; - throw a::err(); // Test this throws. + throw a_err(); // Test this throws. } }; @@ -39,7 +39,7 @@ int main() { out.str(""); a::f(); BOOST_TEST(false); - } catch(a::err const&) { + } catch(a_err const&) { ok.str(""); ok #ifndef BOOST_CONTRACT_NO_ENTRY_INVARIANTS << "a::static_inv" << std::endl diff --git a/test/public_function/static_throwing_old.cpp b/test/public_function/static_throwing_old.cpp index 3eb7bd7..fd7797d 100644 --- a/test/public_function/static_throwing_old.cpp +++ b/test/public_function/static_throwing_old.cpp @@ -14,18 +14,18 @@ boost::contract::test::detail::oteststream out; +struct a_err {}; // Global decl so visible in MSVC10 lambdas. + struct a { static void static_invariant() { out << "a::static_inv" << std::endl; } void invariant() const { out << "a::inv" << std::endl; } - struct err {}; - static void f() { boost::contract::check c = boost::contract::public_function() .precondition([] { out << "a::f::pre" << std::endl; }) .old([] { out << "a::f::old" << std::endl; - throw a::err(); // Test this throws. + throw a_err(); // Test this throws. }) .postcondition([] { out << "a::f::post" << std::endl; }) .except([] { out << "a::f::except" << std::endl; }) @@ -44,7 +44,7 @@ int main() { a::f(); #ifndef BOOST_CONTRACT_NO_OLDS BOOST_TEST(false); - } catch(a::err const&) { + } catch(a_err const&) { #endif ok.str(""); ok #ifndef BOOST_CONTRACT_NO_ENTRY_INVARIANTS diff --git a/test/public_function/static_throwing_post.cpp b/test/public_function/static_throwing_post.cpp index 656b6f6..d7a218f 100644 --- a/test/public_function/static_throwing_post.cpp +++ b/test/public_function/static_throwing_post.cpp @@ -14,19 +14,19 @@ boost::contract::test::detail::oteststream out; +struct a_err {}; // Global decl so visible in MSVC10 lambdas. + struct a { static void static_invariant() { out << "a::static_inv" << std::endl; } void invariant() const { out << "a::inv" << std::endl; } - struct err {}; - static void f() { boost::contract::check c = boost::contract::public_function() .precondition([] { out << "a::f::pre" << std::endl; }) .old([] { out << "a::f::old" << std::endl; }) .postcondition([] { out << "a::f::post" << std::endl; - throw a::err(); // Test this throws. + throw a_err(); // Test this throws. }) .except([] { out << "a::f::except" << std::endl; }) ; @@ -45,7 +45,7 @@ int main() { a::f(); #ifndef BOOST_CONTRACT_NO_POSTCONDITIONS BOOST_TEST(false); - } catch(a::err const&) { + } catch(a_err const&) { #endif ok.str(""); ok #ifndef BOOST_CONTRACT_NO_ENTRY_INVARIANTS diff --git a/test/public_function/static_throwing_pre.cpp b/test/public_function/static_throwing_pre.cpp index b9a4c74..140e6b7 100644 --- a/test/public_function/static_throwing_pre.cpp +++ b/test/public_function/static_throwing_pre.cpp @@ -14,17 +14,17 @@ boost::contract::test::detail::oteststream out; +struct a_err {}; // Global decl so visible in MSVC10 lambdas. + struct a { static void static_invariant() { out << "a::static_inv" << std::endl; } void invariant() const { out << "a::inv" << std::endl; } - struct err {}; - static void f() { boost::contract::check c = boost::contract::public_function() .precondition([] { out << "a::f::pre" << std::endl; - throw a::err(); // Test this throws. + throw a_err(); // Test this throws. }) .old([] { out << "a::f::old" << std::endl; }) .postcondition([] { out << "a::f::post" << std::endl; }) @@ -45,7 +45,7 @@ int main() { a::f(); #ifndef BOOST_CONTRACT_NO_PRECONDITIONS BOOST_TEST(false); - } catch(a::err const&) { + } catch(a_err const&) { #endif ok.str(""); ok #ifndef BOOST_CONTRACT_NO_ENTRY_INVARIANTS diff --git a/test/public_function/throwing_old.cpp b/test/public_function/throwing_old.cpp index cbdb3bd..67123a2 100644 --- a/test/public_function/throwing_old.cpp +++ b/test/public_function/throwing_old.cpp @@ -17,12 +17,12 @@ boost::contract::test::detail::oteststream out; +struct c_err {}; // Global decl so visible in MSVC10 lambdas. + struct c { static void static_invariant() { out << "c::static_inv" << std::endl; } void invariant() const { out << "c::inv" << std::endl; } - struct err {}; - virtual void f(boost::contract::virtual_* v = 0) { boost::contract::check c = boost::contract::public_function(v, this) .precondition([] { @@ -31,7 +31,7 @@ struct c { }) .old([] { out << "c::f::old" << std::endl; - throw c::err(); // Test this throws. + throw c_err(); // Test this throws. }) .postcondition([] { out << "c::f::post" << std::endl; }) .except([] { out << "c::f::except" << std::endl; }) @@ -40,6 +40,8 @@ struct c { } }; +struct b_err {}; // Global decl so visible in MSVC10 lambdas. + struct b #define BASES public c : BASES @@ -50,8 +52,6 @@ struct b static void static_invariant() { out << "b::static_inv" << std::endl; } void invariant() const { out << "b::inv" << std::endl; } - struct err {}; - virtual void f(boost::contract::virtual_* v = 0) /* override */ { boost::contract::check c = boost::contract::public_function( v, &b::f, this) @@ -61,7 +61,7 @@ struct b }) .old([] { out << "b::f::old" << std::endl; - throw b::err(); // Test this throws. + throw b_err(); // Test this throws. }) .postcondition([] { out << "b::f::post" << std::endl; }) .except([] { out << "b::f::except" << std::endl; }) @@ -71,6 +71,8 @@ struct b BOOST_CONTRACT_OVERRIDE(f) }; +struct a_err {}; // Global decl so visible in MSVC10 lambdas. + struct a #define BASES public b : BASES @@ -81,15 +83,13 @@ struct a static void static_invariant() { out << "a::static_inv" << std::endl; } void invariant() const { out << "a::inv" << std::endl; } - struct err {}; - void f(boost::contract::virtual_* v = 0) /* override */ { boost::contract::check c = boost::contract::public_function( v, &a::f, this) .precondition([] { out << "a::f::pre" << std::endl; }) .old([] { out << "a::f::old" << std::endl; - throw a::err(); // Test this throws. + throw a_err(); // Test this throws. }) .postcondition([] { out << "a::f::post" << std::endl; }) .except([] { out << "a::f::except" << std::endl; }) @@ -111,7 +111,7 @@ int main() { ba.f(); #ifndef BOOST_CONTRACT_NO_OLDS BOOST_TEST(false); - } catch(c::err const&) { + } catch(c_err const&) { #endif ok.str(""); ok #ifndef BOOST_CONTRACT_NO_ENTRY_INVARIANTS diff --git a/test/public_function/throwing_post.cpp b/test/public_function/throwing_post.cpp index 20172fb..5090acc 100644 --- a/test/public_function/throwing_post.cpp +++ b/test/public_function/throwing_post.cpp @@ -17,12 +17,12 @@ boost::contract::test::detail::oteststream out; +struct c_err {}; // Global decl so visible in MSVC10 lambdas. + struct c { static void static_invariant() { out << "c::static_inv" << std::endl; } void invariant() const { out << "c::inv" << std::endl; } - struct err {}; - virtual void f(boost::contract::virtual_* v = 0) { boost::contract::check c = boost::contract::public_function(v, this) .precondition([] { @@ -40,6 +40,8 @@ struct c { } }; +struct b_err {}; // Global decl so visible in MSVC10 lambdas. + struct b #define BASES public c : BASES @@ -50,8 +52,6 @@ struct b static void static_invariant() { out << "b::static_inv" << std::endl; } void invariant() const { out << "b::inv" << std::endl; } - struct err {}; - virtual void f(boost::contract::virtual_* v = 0) /* override */ { boost::contract::check c = boost::contract::public_function( v, &b::f, this) @@ -62,7 +62,7 @@ struct b .old([] { out << "b::f::old" << std::endl; }) .postcondition([] { out << "b::f::post" << std::endl; - throw b::err(); // Test this (both derived and base) throws. + throw b_err(); // Test this (both derived and base) throws. }) .except([] { out << "b::f::except" << std::endl; }) ; @@ -71,6 +71,8 @@ struct b BOOST_CONTRACT_OVERRIDE(f) }; +struct a_err {}; // Global decl so visible in MSVC10 lambdas. + struct a #define BASES public b : BASES @@ -81,8 +83,6 @@ struct a static void static_invariant() { out << "a::static_inv" << std::endl; } void invariant() const { out << "a::inv" << std::endl; } - struct err {}; - void f(boost::contract::virtual_* v = 0) /* override */ { boost::contract::check c = boost::contract::public_function( v, &a::f, this) @@ -90,7 +90,7 @@ struct a .old([] { out << "a::f::old" << std::endl; }) .postcondition([] { out << "a::f::post" << std::endl; - throw a::err(); // Test base already threw. + throw a_err(); // Test base already threw. }) .except([] { out << "a::f::except" << std::endl; }) ; @@ -112,7 +112,7 @@ int main() { ba.f(); #ifndef BOOST_CONTRACT_NO_POSTCONDITIONS BOOST_TEST(false); - } catch(b::err const&) { + } catch(b_err const&) { #endif ok.str(""); ok #ifndef BOOST_CONTRACT_NO_ENTRY_INVARIANTS diff --git a/test/public_function/throwing_pre.cpp b/test/public_function/throwing_pre.cpp index f8347f1..64d06d0 100644 --- a/test/public_function/throwing_pre.cpp +++ b/test/public_function/throwing_pre.cpp @@ -17,12 +17,12 @@ boost::contract::test::detail::oteststream out; +struct c_err {}; // Global decl so visible in MSVC10 lambdas. + struct c { static void static_invariant() { out << "c::static_inv" << std::endl; } void invariant() const { out << "c::inv" << std::endl; } - struct err {}; - virtual void f(boost::contract::virtual_* v = 0) { boost::contract::check c = boost::contract::public_function(v, this) .precondition([] { @@ -37,6 +37,8 @@ struct c { } }; +struct b_err {}; // Global decl so visible in MSVC10 lambdas. + struct b #define BASES public c : BASES @@ -47,8 +49,6 @@ struct b static void static_invariant() { out << "b::static_inv" << std::endl; } void invariant() const { out << "b::inv" << std::endl; } - struct err {}; - virtual void f(boost::contract::virtual_* v = 0) /* override */ { boost::contract::check c = boost::contract::public_function( v, &b::f, this) @@ -65,6 +65,8 @@ struct b BOOST_CONTRACT_OVERRIDE(f) }; +struct a_err {}; // Global decl so visible in MSVC10 lambdas. + struct a #define BASES public b : BASES @@ -75,14 +77,12 @@ struct a static void static_invariant() { out << "a::static_inv" << std::endl; } void invariant() const { out << "a::inv" << std::endl; } - struct err {}; - void f(boost::contract::virtual_* v = 0) /* override */ { boost::contract::check c = boost::contract::public_function( v, &a::f, this) .precondition([] { out << "a::f::pre" << std::endl; - throw a::err(); // Test this throws. + throw a_err(); // Test this throws. }) .old([] { out << "a::f::old" << std::endl; }) .postcondition([] { out << "a::f::post" << std::endl; }) @@ -106,7 +106,7 @@ int main() { ba.f(); #ifndef BOOST_CONTRACT_NO_PRECONDITIONS BOOST_TEST(false); - } catch(a::err const&) { + } catch(a_err const&) { #endif ok.str(""); ok #ifndef BOOST_CONTRACT_NO_ENTRY_INVARIANTS