Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorPhil Nash2012-11-06 07:52:28 +0000
committerPhil Nash2012-11-06 07:52:28 +0000
commitec5956f47114ff8b597be85fd7654d29da93aea0 (patch)
tree6bc55f80c3ddb31cd90d0ee4172b3051525dbefa /include
parent88b70828f24bbbeae636d663b14fd0117165108a (diff)
downloadcatch3-ec5956f47114ff8b597be85fd7654d29da93aea0.tar.gz
Fix for #134
The INTERNAL_CATCH_MSG macro, which is used by INFO, WARN and FAIL places its lines in a do…while block so it can be used after an if statement with no block
Diffstat (limited to 'include')
-rw-r--r--include/internal/catch_capture.hpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/include/internal/catch_capture.hpp b/include/internal/catch_capture.hpp
index 602be000..cc05a845 100644
--- a/include/internal/catch_capture.hpp
+++ b/include/internal/catch_capture.hpp
@@ -167,8 +167,10 @@ inline bool isTrue( bool value ){ return value; }
///////////////////////////////////////////////////////////////////////////////
#define INTERNAL_CATCH_MSG( reason, resultType, stopOnFailure, macroName ) \
- INTERNAL_CATCH_ACCEPT_INFO( "", macroName, false ); \
- INTERNAL_CATCH_ACCEPT_EXPR( Catch::ExpressionResultBuilder( resultType ) << reason, stopOnFailure, true );
+ do { \
+ INTERNAL_CATCH_ACCEPT_INFO( "", macroName, false ); \
+ INTERNAL_CATCH_ACCEPT_EXPR( Catch::ExpressionResultBuilder( resultType ) << reason, stopOnFailure, true ) \
+ } while( Catch::isTrue( false ) )
///////////////////////////////////////////////////////////////////////////////
#define INTERNAL_CATCH_SCOPED_INFO( log, macroName ) \