Skip to content

Commit 07947ff

Browse files
committed
Merge #9: [tests] Fix BOOST_CHECK_THROW macro
ec849d9 [tests] Fix BOOST_CHECK_THROW macro (John Newbery) Pull request description: BOOST_CHECK_THROW doesn't correctly fail the test if no exception is throw. Fix that (and add an assert message). Bug and fix found by MarcoFalke. @MarcoFalke Tree-SHA512: 6920a5091cb432d6914b4f961ab398dfdbd5ae3f46831d164b2d3d65786c450b284ca0c3cd433a5402020d25191b00aaa76f302e3164b62092a75fbb1e8fee83
2 parents 31bc9f5 + ec849d9 commit 07947ff

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

test/object.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,10 @@
1919
#define BOOST_CHECK_THROW(stmt, excMatch) { \
2020
try { \
2121
(stmt); \
22+
assert(0 && "No exception caught"); \
2223
} catch (excMatch & e) { \
2324
} catch (...) { \
24-
assert(0); \
25+
assert(0 && "Wrong exception caught"); \
2526
} \
2627
}
2728
#define BOOST_CHECK_NO_THROW(stmt) { \

0 commit comments

Comments
 (0)