From ec849d9a2889e89ba484dacbc7d2ce258f090545 Mon Sep 17 00:00:00 2001 From: John Newbery Date: Tue, 12 Dec 2017 17:53:49 -0500 Subject: [PATCH] [tests] Fix BOOST_CHECK_THROW macro 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. --- test/object.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/object.cpp b/test/object.cpp index 02446292a1aa4a..679cc9f143da30 100644 --- a/test/object.cpp +++ b/test/object.cpp @@ -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) { \