The exception checking in unit tests is partly verbose, fragile, inconsistent and thus confusing.
Fix all those issues by using BOOST_CHECK_EXCEPTION consistently:
- The test code is less bloated and follows a standard pattern; Extra state and dead code like
exceptionThrown = false;orBOOST_CHECK(0)can be removed. - The checks are more strict, because they use
HasReason{...}or a similar predicate.