Skip to content

Commit

Permalink
Merge bitcoin#9: [tests] Fix BOOST_CHECK_THROW macro
Browse files Browse the repository at this point in the history
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
  • Loading branch information
laanwj committed Dec 19, 2017
2 parents 31bc9f5 + ec849d9 commit 07947ff
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion test/object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@
#define BOOST_CHECK_THROW(stmt, excMatch) { \
try { \
(stmt); \
assert(0 && "No exception caught"); \
} catch (excMatch & e) { \
} catch (...) { \
assert(0); \
assert(0 && "Wrong exception caught"); \
} \
}
#define BOOST_CHECK_NO_THROW(stmt) { \
Expand Down

0 comments on commit 07947ff

Please sign in to comment.