summaryrefslogtreecommitdiff
path: root/boost/test/tools/old/interface.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'boost/test/tools/old/interface.hpp')
-rw-r--r--boost/test/tools/old/interface.hpp26
1 files changed, 15 insertions, 11 deletions
diff --git a/boost/test/tools/old/interface.hpp b/boost/test/tools/old/interface.hpp
index 0c35c82b87..2d6f8b78c0 100644
--- a/boost/test/tools/old/interface.hpp
+++ b/boost/test/tools/old/interface.hpp
@@ -1,4 +1,4 @@
-// (C) Copyright Gennadiy Rozental 2001-2014.
+// (C) Copyright Gennadiy Rozental 2001.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
@@ -95,16 +95,17 @@ do {
//____________________________________________________________________________//
-#define BOOST_CHECK_THROW_IMPL( S, E, P, prefix, TL ) \
+#define BOOST_CHECK_THROW_IMPL( S, E, P, postfix, TL ) \
do { \
try { \
BOOST_TEST_PASSPOINT(); \
S; \
- BOOST_TEST_TOOL_IMPL( 2, false, "exception " BOOST_STRINGIZE(E) " is expected", \
+ BOOST_TEST_TOOL_IMPL( 2, false, "exception " BOOST_STRINGIZE(E) " expected but not raised", \
TL, CHECK_MSG, _ ); \
} catch( E const& ex ) { \
::boost::unit_test::ut_detail::ignore_unused_variable_warning( ex ); \
- BOOST_TEST_TOOL_IMPL( 2, P, prefix BOOST_STRINGIZE( E ) " is caught", \
+ BOOST_TEST_TOOL_IMPL( 2, P, \
+ "exception \"" BOOST_STRINGIZE( E )"\" raised as expected" postfix, \
TL, CHECK_MSG, _ ); \
} \
} while( ::boost::test_tools::tt_detail::dummy_cond() ) \
@@ -112,15 +113,18 @@ do {
//____________________________________________________________________________//
-#define BOOST_WARN_THROW( S, E ) BOOST_CHECK_THROW_IMPL( S, E, true, "exception ", WARN )
-#define BOOST_CHECK_THROW( S, E ) BOOST_CHECK_THROW_IMPL( S, E, true, "exception ", CHECK )
-#define BOOST_REQUIRE_THROW( S, E ) BOOST_CHECK_THROW_IMPL( S, E, true, "exception ", REQUIRE )
+#define BOOST_WARN_THROW( S, E ) BOOST_CHECK_THROW_IMPL( S, E, true, "", WARN )
+#define BOOST_CHECK_THROW( S, E ) BOOST_CHECK_THROW_IMPL( S, E, true, "", CHECK )
+#define BOOST_REQUIRE_THROW( S, E ) BOOST_CHECK_THROW_IMPL( S, E, true, "", REQUIRE )
//____________________________________________________________________________//
-#define BOOST_WARN_EXCEPTION( S, E, P ) BOOST_CHECK_THROW_IMPL( S, E, P( ex ), "incorrect exception ", WARN )
-#define BOOST_CHECK_EXCEPTION( S, E, P ) BOOST_CHECK_THROW_IMPL( S, E, P( ex ), "incorrect exception ", CHECK )
-#define BOOST_REQUIRE_EXCEPTION( S, E, P ) BOOST_CHECK_THROW_IMPL( S, E, P( ex ), "incorrect exception ", REQUIRE )
+#define BOOST_WARN_EXCEPTION( S, E, P ) BOOST_CHECK_THROW_IMPL( S, E, P( ex ), \
+ ": validation on the raised exception through predicate \"" BOOST_STRINGIZE(P) "\"", WARN )
+#define BOOST_CHECK_EXCEPTION( S, E, P ) BOOST_CHECK_THROW_IMPL( S, E, P( ex ), \
+ ": validation on the raised exception through predicate \"" BOOST_STRINGIZE(P) "\"", CHECK )
+#define BOOST_REQUIRE_EXCEPTION( S, E, P ) BOOST_CHECK_THROW_IMPL( S, E, P( ex ), \
+ ": validation on the raised exception through predicate \"" BOOST_STRINGIZE(P) "\"", REQUIRE )
//____________________________________________________________________________//
@@ -131,7 +135,7 @@ do {
BOOST_TEST_TOOL_IMPL( 2, true, "no exceptions thrown by " BOOST_STRINGIZE( S ), \
TL, CHECK_MSG, _ ); \
} catch( ... ) { \
- BOOST_TEST_TOOL_IMPL( 2, false, "exception thrown by " BOOST_STRINGIZE( S ), \
+ BOOST_TEST_TOOL_IMPL( 2, false, "unexpected exception thrown by " BOOST_STRINGIZE( S ), \
TL, CHECK_MSG, _ ); \
} \
} while( ::boost::test_tools::tt_detail::dummy_cond() ) \