From 678a42baa162a0c990ed3ac2e140114829e48745 Mon Sep 17 00:00:00 2001 From: Ribulous Barnulous Date: Tue, 14 Oct 2014 01:07:40 -0400 Subject: [PATCH] updated prefix version of catch macros --- README.md | 2 +- include/catch.hpp | 93 +++++++++++++++----------- include/internal/catch_version.hpp | 2 +- single_include/catch.hpp | 102 +++++++++++++++++------------ 4 files changed, 118 insertions(+), 81 deletions(-) diff --git a/README.md b/README.md index 47d85c18..3a748874 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ ![catch logo](catch-logo-small.png) -*v1.0 build 53 (master branch)* +*v1.0 build 57 (master branch)* Build status (on Travis CI) [![Build Status](https://travis-ci.org/philsquared/Catch.png)](https://travis-ci.org/philsquared/Catch) diff --git a/include/catch.hpp b/include/catch.hpp index 0b91fd15..bad6abf0 100644 --- a/include/catch.hpp +++ b/include/catch.hpp @@ -61,22 +61,41 @@ // If this config identifier is defined then all CATCH macros are prefixed with CATCH_ #ifdef CATCH_CONFIG_PREFIX_ALL -#define CATCH_REQUIRE( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::Normal, "CATCH_REQUIRE" ) -#define CATCH_REQUIRE_FALSE( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::Normal | Catch::ResultDisposition::FalseTest, "CATCH_REQUIRE_FALSE" ) +#ifdef CATCH_CONFIG_VARIADIC_MACROS +#define CATCH_REQUIRE( ... ) INTERNAL_CATCH_TEST( ( __VA_ARGS ), Catch::ResultDisposition::Normal, "CATCH_REQUIRE" ) +#define CATCH_REQUIRE_FALSE( ... ) INTERNAL_CATCH_TEST( ( __VA_ARGS ), Catch::ResultDisposition::Normal | Catch::ResultDisposition::FalseTest, "CATCH_REQUIRE_FALSE" ) -#define CATCH_REQUIRE_THROWS( expr ) INTERNAL_CATCH_THROWS( expr, Catch::ResultDisposition::Normal, "CATCH_REQUIRE_THROWS" ) -#define CATCH_REQUIRE_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( expr, exceptionType, Catch::ResultDisposition::Normal, "CATCH_REQUIRE_THROWS_AS" ) -#define CATCH_REQUIRE_NOTHROW( expr ) INTERNAL_CATCH_NO_THROW( expr, Catch::ResultDisposition::Normal, "CATCH_REQUIRE_NOTHROW" ) +#define CATCH_REQUIRE_THROWS( ... ) INTERNAL_CATCH_THROWS( ( __VA_ARGS ), Catch::ResultDisposition::Normal, "CATCH_REQUIRE_THROWS" ) +#define CATCH_REQUIRE_NOTHROW( ... ) INTERNAL_CATCH_NO_THROW( ( __VA_ARGS ), Catch::ResultDisposition::Normal, "CATCH_REQUIRE_NOTHROW" ) -#define CATCH_CHECK( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECK" ) -#define CATCH_CHECK_FALSE( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::FalseTest, "CATCH_CHECK_FALSE" ) -#define CATCH_CHECKED_IF( expr ) INTERNAL_CATCH_IF( expr, Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECKED_IF" ) -#define CATCH_CHECKED_ELSE( expr ) INTERNAL_CATCH_ELSE( expr, Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECKED_ELSE" ) -#define CATCH_CHECK_NOFAIL( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::SuppressFail, "CATCH_CHECK_NOFAIL" ) +#define CATCH_CHECK( ... ) INTERNAL_CATCH_TEST( ( __VA_ARGS ), Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECK" ) +#define CATCH_CHECK_FALSE( ... ) INTERNAL_CATCH_TEST( ( __VA_ARGS ), Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::FalseTest, "CATCH_CHECK_FALSE" ) +#define CATCH_CHECKED_IF( ... ) INTERNAL_CATCH_IF( ( __VA_ARGS ), Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECKED_IF" ) +#define CATCH_CHECKED_ELSE( ... ) INTERNAL_CATCH_ELSE( ( __VA_ARGS ), Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECKED_ELSE" ) +#define CATCH_CHECK_NOFAIL( ... ) INTERNAL_CATCH_TEST( ( __VA_ARGS ), Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::SuppressFail, "CATCH_CHECK_NOFAIL" ) + +#define CATCH_CHECK_THROWS( ... ) INTERNAL_CATCH_THROWS( ( __VA_ARGS ), Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECK_THROWS" ) +#define CATCH_CHECK_NOTHROW( ... ) INTERNAL_CATCH_NO_THROW( ( __VA_ARGS ), Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECK_NOTHROW" ) +#else +#define CATCH_REQUIRE( expr ) INTERNAL_CATCH_TEST( ( expr ), Catch::ResultDisposition::Normal, "CATCH_REQUIRE" ) +#define CATCH_REQUIRE_FALSE( expr ) INTERNAL_CATCH_TEST( ( expr ), Catch::ResultDisposition::Normal | Catch::ResultDisposition::FalseTest, "CATCH_REQUIRE_FALSE" ) + +#define CATCH_REQUIRE_THROWS( expr ) INTERNAL_CATCH_THROWS( ( expr ), Catch::ResultDisposition::Normal, "CATCH_REQUIRE_THROWS" ) +#define CATCH_REQUIRE_NOTHROW( expr ) INTERNAL_CATCH_NO_THROW( ( expr ), Catch::ResultDisposition::Normal, "CATCH_REQUIRE_NOTHROW" ) + +#define CATCH_CHECK( expr ) INTERNAL_CATCH_TEST( ( expr ), Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECK" ) +#define CATCH_CHECK_FALSE( expr ) INTERNAL_CATCH_TEST( ( expr ), Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::FalseTest, "CATCH_CHECK_FALSE" ) +#define CATCH_CHECKED_IF( expr ) INTERNAL_CATCH_IF( ( expr ), Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECKED_IF" ) +#define CATCH_CHECKED_ELSE( expr ) INTERNAL_CATCH_ELSE( ( expr ), Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECKED_ELSE" ) +#define CATCH_CHECK_NOFAIL( expr ) INTERNAL_CATCH_TEST( ( expr ), Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::SuppressFail, "CATCH_CHECK_NOFAIL" ) + +#define CATCH_CHECK_THROWS( expr ) INTERNAL_CATCH_THROWS( ( expr ), Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECK_THROWS" ) +#define CATCH_CHECK_NOTHROW( expr ) INTERNAL_CATCH_NO_THROW( ( expr ), Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECK_NOTHROW" ) +#endif + +#define CATCH_REQUIRE_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( ( expr ), exceptionType, Catch::ResultDisposition::Normal, "CATCH_REQUIRE_THROWS_AS" ) +#define CATCH_CHECK_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( ( expr ), exceptionType, Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECK_THROWS_AS" ) -#define CATCH_CHECK_THROWS( expr ) INTERNAL_CATCH_THROWS( expr, Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECK_THROWS" ) -#define CATCH_CHECK_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( expr, exceptionType, Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECK_THROWS_AS" ) -#define CATCH_CHECK_NOTHROW( expr ) INTERNAL_CATCH_NO_THROW( expr, Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECK_NOTHROW" ) #define CHECK_THAT( arg, matcher ) INTERNAL_CHECK_THAT( arg, matcher, Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECK_THAT" ) #define CATCH_REQUIRE_THAT( arg, matcher ) INTERNAL_CHECK_THAT( arg, matcher, Catch::ResultDisposition::Normal, "CATCH_REQUIRE_THAT" ) @@ -127,38 +146,38 @@ #else #ifdef CATCH_CONFIG_VARIADIC_MACROS -#define REQUIRE( ... ) INTERNAL_CATCH_TEST( (__VA_ARGS__), Catch::ResultDisposition::Normal, "REQUIRE" ) -#define REQUIRE_FALSE( ... ) INTERNAL_CATCH_TEST( (__VA_ARGS__), Catch::ResultDisposition::Normal | Catch::ResultDisposition::FalseTest, "REQUIRE_FALSE" ) +#define REQUIRE( ... ) INTERNAL_CATCH_TEST( ( __VA_ARGS__ ), Catch::ResultDisposition::Normal, "REQUIRE" ) +#define REQUIRE_FALSE( ... ) INTERNAL_CATCH_TEST( ( __VA_ARGS__ ), Catch::ResultDisposition::Normal | Catch::ResultDisposition::FalseTest, "REQUIRE_FALSE" ) -#define REQUIRE_THROWS( ... ) INTERNAL_CATCH_THROWS( (__VA_ARGS__), Catch::ResultDisposition::Normal, "REQUIRE_THROWS" ) -#define REQUIRE_NOTHROW( ... ) INTERNAL_CATCH_NO_THROW( (__VA_ARGS__), Catch::ResultDisposition::Normal, "REQUIRE_NOTHROW" ) +#define REQUIRE_THROWS( ... ) INTERNAL_CATCH_THROWS( ( __VA_ARGS__ ), Catch::ResultDisposition::Normal, "REQUIRE_THROWS" ) +#define REQUIRE_NOTHROW( ... ) INTERNAL_CATCH_NO_THROW( ( __VA_ARGS__ ), Catch::ResultDisposition::Normal, "REQUIRE_NOTHROW" ) -#define CHECK( ... ) INTERNAL_CATCH_TEST( (__VA_ARGS__), Catch::ResultDisposition::ContinueOnFailure, "CHECK" ) -#define CHECK_FALSE( ... ) INTERNAL_CATCH_TEST( (__VA_ARGS__), Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::FalseTest, "CHECK_FALSE" ) -#define CHECKED_IF( ... ) INTERNAL_CATCH_IF( (__VA_ARGS__), Catch::ResultDisposition::ContinueOnFailure, "CHECKED_IF" ) -#define CHECKED_ELSE( ... ) INTERNAL_CATCH_ELSE( (__VA_ARGS__), Catch::ResultDisposition::ContinueOnFailure, "CHECKED_ELSE" ) -#define CHECK_NOFAIL( ... ) INTERNAL_CATCH_TEST( (__VA_ARGS__), Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::SuppressFail, "CHECK_NOFAIL" ) +#define CHECK( ... ) INTERNAL_CATCH_TEST( ( __VA_ARGS__ ), Catch::ResultDisposition::ContinueOnFailure, "CHECK" ) +#define CHECK_FALSE( ... ) INTERNAL_CATCH_TEST( ( __VA_ARGS__ ), Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::FalseTest, "CHECK_FALSE" ) +#define CHECKED_IF( ... ) INTERNAL_CATCH_IF( ( __VA_ARGS__ ), Catch::ResultDisposition::ContinueOnFailure, "CHECKED_IF" ) +#define CHECKED_ELSE( ... ) INTERNAL_CATCH_ELSE( ( __VA_ARGS__ ), Catch::ResultDisposition::ContinueOnFailure, "CHECKED_ELSE" ) +#define CHECK_NOFAIL( ... ) INTERNAL_CATCH_TEST( ( __VA_ARGS__ ), Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::SuppressFail, "CHECK_NOFAIL" ) -#define CHECK_THROWS( ... ) INTERNAL_CATCH_THROWS( (__VA_ARGS__), Catch::ResultDisposition::ContinueOnFailure, "CHECK_THROWS" ) -#define CHECK_NOTHROW( ... ) INTERNAL_CATCH_NO_THROW( (__VA_ARGS__), Catch::ResultDisposition::ContinueOnFailure, "CHECK_NOTHROW" ) +#define CHECK_THROWS( ... ) INTERNAL_CATCH_THROWS( ( __VA_ARGS__ ), Catch::ResultDisposition::ContinueOnFailure, "CHECK_THROWS" ) +#define CHECK_NOTHROW( ... ) INTERNAL_CATCH_NO_THROW( ( __VA_ARGS__ ), Catch::ResultDisposition::ContinueOnFailure, "CHECK_NOTHROW" ) #else -#define REQUIRE( expr ) INTERNAL_CATCH_TEST( (expr), Catch::ResultDisposition::Normal, "REQUIRE" ) -#define REQUIRE_FALSE( expr ) INTERNAL_CATCH_TEST( (expr), Catch::ResultDisposition::Normal | Catch::ResultDisposition::FalseTest, "REQUIRE_FALSE" ) +#define REQUIRE( expr ) INTERNAL_CATCH_TEST( ( expr ), Catch::ResultDisposition::Normal, "REQUIRE" ) +#define REQUIRE_FALSE( expr ) INTERNAL_CATCH_TEST( ( expr ), Catch::ResultDisposition::Normal | Catch::ResultDisposition::FalseTest, "REQUIRE_FALSE" ) -#define REQUIRE_THROWS( expr ) INTERNAL_CATCH_THROWS( (expr), Catch::ResultDisposition::Normal, "REQUIRE_THROWS" ) -#define REQUIRE_NOTHROW( expr ) INTERNAL_CATCH_NO_THROW( (expr), Catch::ResultDisposition::Normal, "REQUIRE_NOTHROW" ) +#define REQUIRE_THROWS( expr ) INTERNAL_CATCH_THROWS( ( expr ), Catch::ResultDisposition::Normal, "REQUIRE_THROWS" ) +#define REQUIRE_NOTHROW( expr ) INTERNAL_CATCH_NO_THROW( ( expr ), Catch::ResultDisposition::Normal, "REQUIRE_NOTHROW" ) -#define CHECK( expr ) INTERNAL_CATCH_TEST( (expr), Catch::ResultDisposition::ContinueOnFailure, "CHECK" ) -#define CHECK_FALSE( expr ) INTERNAL_CATCH_TEST( (expr), Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::FalseTest, "CHECK_FALSE" ) -#define CHECKED_IF( expr ) INTERNAL_CATCH_IF( (expr), Catch::ResultDisposition::ContinueOnFailure, "CHECKED_IF" ) -#define CHECKED_ELSE( expr ) INTERNAL_CATCH_ELSE( (expr), Catch::ResultDisposition::ContinueOnFailure, "CHECKED_ELSE" ) -#define CHECK_NOFAIL( expr ) INTERNAL_CATCH_TEST( (expr), Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::SuppressFail, "CHECK_NOFAIL" ) +#define CHECK( expr ) INTERNAL_CATCH_TEST( ( expr ), Catch::ResultDisposition::ContinueOnFailure, "CHECK" ) +#define CHECK_FALSE( expr ) INTERNAL_CATCH_TEST( ( expr ), Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::FalseTest, "CHECK_FALSE" ) +#define CHECKED_IF( expr ) INTERNAL_CATCH_IF( ( expr ), Catch::ResultDisposition::ContinueOnFailure, "CHECKED_IF" ) +#define CHECKED_ELSE( expr ) INTERNAL_CATCH_ELSE( ( expr ), Catch::ResultDisposition::ContinueOnFailure, "CHECKED_ELSE" ) +#define CHECK_NOFAIL( expr ) INTERNAL_CATCH_TEST( ( expr ), Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::SuppressFail, "CHECK_NOFAIL" ) -#define CHECK_THROWS( expr ) INTERNAL_CATCH_THROWS( (expr), Catch::ResultDisposition::ContinueOnFailure, "CHECK_THROWS" ) -#define CHECK_NOTHROW( expr ) INTERNAL_CATCH_NO_THROW( (expr), Catch::ResultDisposition::ContinueOnFailure, "CHECK_NOTHROW" ) +#define CHECK_THROWS( expr ) INTERNAL_CATCH_THROWS( ( expr ), Catch::ResultDisposition::ContinueOnFailure, "CHECK_THROWS" ) +#define CHECK_NOTHROW( expr ) INTERNAL_CATCH_NO_THROW( ( expr ), Catch::ResultDisposition::ContinueOnFailure, "CHECK_NOTHROW" ) #endif -#define REQUIRE_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( expr, exceptionType, Catch::ResultDisposition::Normal, "REQUIRE_THROWS_AS" ) -#define CHECK_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( expr, exceptionType, Catch::ResultDisposition::ContinueOnFailure, "CHECK_THROWS_AS" ) +#define REQUIRE_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( ( expr ), exceptionType, Catch::ResultDisposition::Normal, "REQUIRE_THROWS_AS" ) +#define CHECK_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( ( expr ), exceptionType, Catch::ResultDisposition::ContinueOnFailure, "CHECK_THROWS_AS" ) #define CHECK_THAT( arg, matcher ) INTERNAL_CHECK_THAT( arg, matcher, Catch::ResultDisposition::ContinueOnFailure, "CHECK_THAT" ) #define REQUIRE_THAT( arg, matcher ) INTERNAL_CHECK_THAT( arg, matcher, Catch::ResultDisposition::Normal, "REQUIRE_THAT" ) diff --git a/include/internal/catch_version.hpp b/include/internal/catch_version.hpp index db7a7ec8..ddeab289 100644 --- a/include/internal/catch_version.hpp +++ b/include/internal/catch_version.hpp @@ -13,7 +13,7 @@ namespace Catch { // These numbers are maintained by a script - Version libraryVersion( 1, 0, 53, "master" ); + Version libraryVersion( 1, 0, 57, "master" ); } #endif // TWOBLUECUBES_CATCH_VERSION_HPP_INCLUDED diff --git a/single_include/catch.hpp b/single_include/catch.hpp index 07b23a60..abc3c9ee 100644 --- a/single_include/catch.hpp +++ b/single_include/catch.hpp @@ -1,6 +1,6 @@ /* - * CATCH v1.0 build 53 (master branch) - * Generated: 2014-08-20 08:08:19.533804 + * CATCH v1.0 build 57 (master branch) + * Generated: 2014-10-14 01:02:00.864531 * ---------------------------------------------------------- * This file has been merged from multiple headers. Please don't edit it directly * Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved. @@ -5262,7 +5262,7 @@ namespace Catch { Totals totals; - context.testGroupStarting( "", 1, 1 ); // deprecated? + context.testGroupStarting( "all tests", 1, 1 ); // deprecated? TestSpec testSpec = m_config->testSpec(); if( !testSpec.hasFilters() ) @@ -5285,7 +5285,7 @@ namespace Catch { m_testsAlreadyRun.insert( *it ); } } - context.testGroupEnded( "", totals, 1, 1 ); + context.testGroupEnded( "all tests", totals, 1, 1 ); return totals; } @@ -6426,7 +6426,7 @@ namespace Catch { namespace Catch { // These numbers are maintained by a script - Version libraryVersion( 1, 0, 53, "master" ); + Version libraryVersion( 1, 0, 57, "master" ); } // #included from: catch_message.hpp @@ -8859,22 +8859,40 @@ int main (int argc, char * const argv[]) { // If this config identifier is defined then all CATCH macros are prefixed with CATCH_ #ifdef CATCH_CONFIG_PREFIX_ALL -#define CATCH_REQUIRE( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::Normal, "CATCH_REQUIRE" ) -#define CATCH_REQUIRE_FALSE( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::Normal | Catch::ResultDisposition::FalseTest, "CATCH_REQUIRE_FALSE" ) +#ifdef CATCH_CONFIG_VARIADIC_MACROS +#define CATCH_REQUIRE( ... ) INTERNAL_CATCH_TEST( ( __VA_ARGS ), Catch::ResultDisposition::Normal, "CATCH_REQUIRE" ) +#define CATCH_REQUIRE_FALSE( ... ) INTERNAL_CATCH_TEST( ( __VA_ARGS ), Catch::ResultDisposition::Normal | Catch::ResultDisposition::FalseTest, "CATCH_REQUIRE_FALSE" ) -#define CATCH_REQUIRE_THROWS( expr ) INTERNAL_CATCH_THROWS( expr, Catch::ResultDisposition::Normal, "CATCH_REQUIRE_THROWS" ) -#define CATCH_REQUIRE_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( expr, exceptionType, Catch::ResultDisposition::Normal, "CATCH_REQUIRE_THROWS_AS" ) -#define CATCH_REQUIRE_NOTHROW( expr ) INTERNAL_CATCH_NO_THROW( expr, Catch::ResultDisposition::Normal, "CATCH_REQUIRE_NOTHROW" ) +#define CATCH_REQUIRE_THROWS( ... ) INTERNAL_CATCH_THROWS( ( __VA_ARGS ), Catch::ResultDisposition::Normal, "CATCH_REQUIRE_THROWS" ) +#define CATCH_REQUIRE_NOTHROW( ... ) INTERNAL_CATCH_NO_THROW( ( __VA_ARGS ), Catch::ResultDisposition::Normal, "CATCH_REQUIRE_NOTHROW" ) -#define CATCH_CHECK( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECK" ) -#define CATCH_CHECK_FALSE( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::FalseTest, "CATCH_CHECK_FALSE" ) -#define CATCH_CHECKED_IF( expr ) INTERNAL_CATCH_IF( expr, Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECKED_IF" ) -#define CATCH_CHECKED_ELSE( expr ) INTERNAL_CATCH_ELSE( expr, Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECKED_ELSE" ) -#define CATCH_CHECK_NOFAIL( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::SuppressFail, "CATCH_CHECK_NOFAIL" ) +#define CATCH_CHECK( ... ) INTERNAL_CATCH_TEST( ( __VA_ARGS ), Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECK" ) +#define CATCH_CHECK_FALSE( ... ) INTERNAL_CATCH_TEST( ( __VA_ARGS ), Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::FalseTest, "CATCH_CHECK_FALSE" ) +#define CATCH_CHECKED_IF( ... ) INTERNAL_CATCH_IF( ( __VA_ARGS ), Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECKED_IF" ) +#define CATCH_CHECKED_ELSE( ... ) INTERNAL_CATCH_ELSE( ( __VA_ARGS ), Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECKED_ELSE" ) +#define CATCH_CHECK_NOFAIL( ... ) INTERNAL_CATCH_TEST( ( __VA_ARGS ), Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::SuppressFail, "CATCH_CHECK_NOFAIL" ) -#define CATCH_CHECK_THROWS( expr ) INTERNAL_CATCH_THROWS( expr, Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECK_THROWS" ) -#define CATCH_CHECK_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( expr, exceptionType, Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECK_THROWS_AS" ) -#define CATCH_CHECK_NOTHROW( expr ) INTERNAL_CATCH_NO_THROW( expr, Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECK_NOTHROW" ) +#define CATCH_CHECK_THROWS( ... ) INTERNAL_CATCH_THROWS( ( __VA_ARGS ), Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECK_THROWS" ) +#define CATCH_CHECK_NOTHROW( ... ) INTERNAL_CATCH_NO_THROW( ( __VA_ARGS ), Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECK_NOTHROW" ) +#else +#define CATCH_REQUIRE( expr ) INTERNAL_CATCH_TEST( ( expr ), Catch::ResultDisposition::Normal, "CATCH_REQUIRE" ) +#define CATCH_REQUIRE_FALSE( expr ) INTERNAL_CATCH_TEST( ( expr ), Catch::ResultDisposition::Normal | Catch::ResultDisposition::FalseTest, "CATCH_REQUIRE_FALSE" ) + +#define CATCH_REQUIRE_THROWS( expr ) INTERNAL_CATCH_THROWS( ( expr ), Catch::ResultDisposition::Normal, "CATCH_REQUIRE_THROWS" ) +#define CATCH_REQUIRE_NOTHROW( expr ) INTERNAL_CATCH_NO_THROW( ( expr ), Catch::ResultDisposition::Normal, "CATCH_REQUIRE_NOTHROW" ) + +#define CATCH_CHECK( expr ) INTERNAL_CATCH_TEST( ( expr ), Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECK" ) +#define CATCH_CHECK_FALSE( expr ) INTERNAL_CATCH_TEST( ( expr ), Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::FalseTest, "CATCH_CHECK_FALSE" ) +#define CATCH_CHECKED_IF( expr ) INTERNAL_CATCH_IF( ( expr ), Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECKED_IF" ) +#define CATCH_CHECKED_ELSE( expr ) INTERNAL_CATCH_ELSE( ( expr ), Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECKED_ELSE" ) +#define CATCH_CHECK_NOFAIL( expr ) INTERNAL_CATCH_TEST( ( expr ), Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::SuppressFail, "CATCH_CHECK_NOFAIL" ) + +#define CATCH_CHECK_THROWS( expr ) INTERNAL_CATCH_THROWS( ( expr ), Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECK_THROWS" ) +#define CATCH_CHECK_NOTHROW( expr ) INTERNAL_CATCH_NO_THROW( ( expr ), Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECK_NOTHROW" ) +#endif + +#define CATCH_REQUIRE_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( ( expr ), exceptionType, Catch::ResultDisposition::Normal, "CATCH_REQUIRE_THROWS_AS" ) +#define CATCH_CHECK_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( ( expr ), exceptionType, Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECK_THROWS_AS" ) #define CHECK_THAT( arg, matcher ) INTERNAL_CHECK_THAT( arg, matcher, Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECK_THAT" ) #define CATCH_REQUIRE_THAT( arg, matcher ) INTERNAL_CHECK_THAT( arg, matcher, Catch::ResultDisposition::Normal, "CATCH_REQUIRE_THAT" ) @@ -8925,38 +8943,38 @@ int main (int argc, char * const argv[]) { #else #ifdef CATCH_CONFIG_VARIADIC_MACROS -#define REQUIRE( ... ) INTERNAL_CATCH_TEST( (__VA_ARGS__), Catch::ResultDisposition::Normal, "REQUIRE" ) -#define REQUIRE_FALSE( ... ) INTERNAL_CATCH_TEST( (__VA_ARGS__), Catch::ResultDisposition::Normal | Catch::ResultDisposition::FalseTest, "REQUIRE_FALSE" ) +#define REQUIRE( ... ) INTERNAL_CATCH_TEST( ( __VA_ARGS__ ), Catch::ResultDisposition::Normal, "REQUIRE" ) +#define REQUIRE_FALSE( ... ) INTERNAL_CATCH_TEST( ( __VA_ARGS__ ), Catch::ResultDisposition::Normal | Catch::ResultDisposition::FalseTest, "REQUIRE_FALSE" ) -#define REQUIRE_THROWS( ... ) INTERNAL_CATCH_THROWS( (__VA_ARGS__), Catch::ResultDisposition::Normal, "REQUIRE_THROWS" ) -#define REQUIRE_NOTHROW( ... ) INTERNAL_CATCH_NO_THROW( (__VA_ARGS__), Catch::ResultDisposition::Normal, "REQUIRE_NOTHROW" ) +#define REQUIRE_THROWS( ... ) INTERNAL_CATCH_THROWS( ( __VA_ARGS__ ), Catch::ResultDisposition::Normal, "REQUIRE_THROWS" ) +#define REQUIRE_NOTHROW( ... ) INTERNAL_CATCH_NO_THROW( ( __VA_ARGS__ ), Catch::ResultDisposition::Normal, "REQUIRE_NOTHROW" ) -#define CHECK( ... ) INTERNAL_CATCH_TEST( (__VA_ARGS__), Catch::ResultDisposition::ContinueOnFailure, "CHECK" ) -#define CHECK_FALSE( ... ) INTERNAL_CATCH_TEST( (__VA_ARGS__), Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::FalseTest, "CHECK_FALSE" ) -#define CHECKED_IF( ... ) INTERNAL_CATCH_IF( (__VA_ARGS__), Catch::ResultDisposition::ContinueOnFailure, "CHECKED_IF" ) -#define CHECKED_ELSE( ... ) INTERNAL_CATCH_ELSE( (__VA_ARGS__), Catch::ResultDisposition::ContinueOnFailure, "CHECKED_ELSE" ) -#define CHECK_NOFAIL( ... ) INTERNAL_CATCH_TEST( (__VA_ARGS__), Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::SuppressFail, "CHECK_NOFAIL" ) +#define CHECK( ... ) INTERNAL_CATCH_TEST( ( __VA_ARGS__ ), Catch::ResultDisposition::ContinueOnFailure, "CHECK" ) +#define CHECK_FALSE( ... ) INTERNAL_CATCH_TEST( ( __VA_ARGS__ ), Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::FalseTest, "CHECK_FALSE" ) +#define CHECKED_IF( ... ) INTERNAL_CATCH_IF( ( __VA_ARGS__ ), Catch::ResultDisposition::ContinueOnFailure, "CHECKED_IF" ) +#define CHECKED_ELSE( ... ) INTERNAL_CATCH_ELSE( ( __VA_ARGS__ ), Catch::ResultDisposition::ContinueOnFailure, "CHECKED_ELSE" ) +#define CHECK_NOFAIL( ... ) INTERNAL_CATCH_TEST( ( __VA_ARGS__ ), Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::SuppressFail, "CHECK_NOFAIL" ) -#define CHECK_THROWS( ... ) INTERNAL_CATCH_THROWS( (__VA_ARGS__), Catch::ResultDisposition::ContinueOnFailure, "CHECK_THROWS" ) -#define CHECK_NOTHROW( ... ) INTERNAL_CATCH_NO_THROW( (__VA_ARGS__), Catch::ResultDisposition::ContinueOnFailure, "CHECK_NOTHROW" ) +#define CHECK_THROWS( ... ) INTERNAL_CATCH_THROWS( ( __VA_ARGS__ ), Catch::ResultDisposition::ContinueOnFailure, "CHECK_THROWS" ) +#define CHECK_NOTHROW( ... ) INTERNAL_CATCH_NO_THROW( ( __VA_ARGS__ ), Catch::ResultDisposition::ContinueOnFailure, "CHECK_NOTHROW" ) #else -#define REQUIRE( expr ) INTERNAL_CATCH_TEST( (expr), Catch::ResultDisposition::Normal, "REQUIRE" ) -#define REQUIRE_FALSE( expr ) INTERNAL_CATCH_TEST( (expr), Catch::ResultDisposition::Normal | Catch::ResultDisposition::FalseTest, "REQUIRE_FALSE" ) +#define REQUIRE( expr ) INTERNAL_CATCH_TEST( ( expr ), Catch::ResultDisposition::Normal, "REQUIRE" ) +#define REQUIRE_FALSE( expr ) INTERNAL_CATCH_TEST( ( expr ), Catch::ResultDisposition::Normal | Catch::ResultDisposition::FalseTest, "REQUIRE_FALSE" ) -#define REQUIRE_THROWS( expr ) INTERNAL_CATCH_THROWS( (expr), Catch::ResultDisposition::Normal, "REQUIRE_THROWS" ) -#define REQUIRE_NOTHROW( expr ) INTERNAL_CATCH_NO_THROW( (expr), Catch::ResultDisposition::Normal, "REQUIRE_NOTHROW" ) +#define REQUIRE_THROWS( expr ) INTERNAL_CATCH_THROWS( ( expr ), Catch::ResultDisposition::Normal, "REQUIRE_THROWS" ) +#define REQUIRE_NOTHROW( expr ) INTERNAL_CATCH_NO_THROW( ( expr ), Catch::ResultDisposition::Normal, "REQUIRE_NOTHROW" ) -#define CHECK( expr ) INTERNAL_CATCH_TEST( (expr), Catch::ResultDisposition::ContinueOnFailure, "CHECK" ) -#define CHECK_FALSE( expr ) INTERNAL_CATCH_TEST( (expr), Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::FalseTest, "CHECK_FALSE" ) -#define CHECKED_IF( expr ) INTERNAL_CATCH_IF( (expr), Catch::ResultDisposition::ContinueOnFailure, "CHECKED_IF" ) -#define CHECKED_ELSE( expr ) INTERNAL_CATCH_ELSE( (expr), Catch::ResultDisposition::ContinueOnFailure, "CHECKED_ELSE" ) -#define CHECK_NOFAIL( expr ) INTERNAL_CATCH_TEST( (expr), Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::SuppressFail, "CHECK_NOFAIL" ) +#define CHECK( expr ) INTERNAL_CATCH_TEST( ( expr ), Catch::ResultDisposition::ContinueOnFailure, "CHECK" ) +#define CHECK_FALSE( expr ) INTERNAL_CATCH_TEST( ( expr ), Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::FalseTest, "CHECK_FALSE" ) +#define CHECKED_IF( expr ) INTERNAL_CATCH_IF( ( expr ), Catch::ResultDisposition::ContinueOnFailure, "CHECKED_IF" ) +#define CHECKED_ELSE( expr ) INTERNAL_CATCH_ELSE( ( expr ), Catch::ResultDisposition::ContinueOnFailure, "CHECKED_ELSE" ) +#define CHECK_NOFAIL( expr ) INTERNAL_CATCH_TEST( ( expr ), Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::SuppressFail, "CHECK_NOFAIL" ) -#define CHECK_THROWS( expr ) INTERNAL_CATCH_THROWS( (expr), Catch::ResultDisposition::ContinueOnFailure, "CHECK_THROWS" ) -#define CHECK_NOTHROW( expr ) INTERNAL_CATCH_NO_THROW( (expr), Catch::ResultDisposition::ContinueOnFailure, "CHECK_NOTHROW" ) +#define CHECK_THROWS( expr ) INTERNAL_CATCH_THROWS( ( expr ), Catch::ResultDisposition::ContinueOnFailure, "CHECK_THROWS" ) +#define CHECK_NOTHROW( expr ) INTERNAL_CATCH_NO_THROW( ( expr ), Catch::ResultDisposition::ContinueOnFailure, "CHECK_NOTHROW" ) #endif -#define REQUIRE_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( expr, exceptionType, Catch::ResultDisposition::Normal, "REQUIRE_THROWS_AS" ) -#define CHECK_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( expr, exceptionType, Catch::ResultDisposition::ContinueOnFailure, "CHECK_THROWS_AS" ) +#define REQUIRE_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( ( expr ), exceptionType, Catch::ResultDisposition::Normal, "REQUIRE_THROWS_AS" ) +#define CHECK_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( ( expr ), exceptionType, Catch::ResultDisposition::ContinueOnFailure, "CHECK_THROWS_AS" ) #define CHECK_THAT( arg, matcher ) INTERNAL_CHECK_THAT( arg, matcher, Catch::ResultDisposition::ContinueOnFailure, "CHECK_THAT" ) #define REQUIRE_THAT( arg, matcher ) INTERNAL_CHECK_THAT( arg, matcher, Catch::ResultDisposition::Normal, "REQUIRE_THAT" )